#!/bin/bash exec > /tmp/calico_compute.log 2>&1 set -x echo "Hi, I'm a compute node!" this_node_address=$(python get_node_ip.py `hostname`) controller_node_address=$(python get_controller_ip.py) # Get APT key for binaries.projectcalico.org. curl -L http://binaries.projectcalico.org/repo/key | apt-key add - # Add source for binaries.projectcalico.org, removing the priority files that # were automatically created by the fuel plugin installer (the version number # in the file names causes problems as it contains full stops, and the file # contents aren't what we want). rm -f /etc/apt/preferences.d/calico-fuel-plugin-1.0.0 /etc/apt/sources.list.d/calico-fuel-plugin-1.0.0.list cat > /etc/apt/sources.list.d/calico.list <> /etc/apt/preferences.d/calico-fuel Package: * Pin: origin binaries.projectcalico.org Pin-Priority: 1100 PREFS # Add PPA for the etcd packages, and ensure that it has lower priority than # binaries.projectcalico.org so that we get the fuel versions of the calico # packages. apt-add-repository -y ppa:project-calico/juno cat > /etc/apt/preferences.d/calico-etcd < tmp mv tmp /etc/init/etcd.conf cat << EXEC_CMD >> /etc/init/etcd.conf exec /usr/bin/etcd -proxy on \\ -listen-client-urls http://127.0.0.1:4001 \\ -advertise-client-urls http://127.0.0.1:7001 \\ -initial-cluster controller=http://${controller_node_address}:2380 EXEC_CMD service etcd start # Run apt-get upgrade and apt-get dist-upgrade. These commands will # bring in Calico-specific updates to the OpenStack packages and to # dnsmasq. apt-get -y upgrade apt-get -y dist-upgrade # Open /etc/nova/nova.conf and remove the linuxnet_interface_driver line. cp /etc/nova/nova.conf /etc/nova/nova.conf.pre-calico sed -i "/^linuxnet_interface_driver/d" /etc/nova/nova.conf service nova-compute restart # Install some extra packages. apt-get -y install neutron-common neutron-dhcp-agent nova-api-metadata # Open /etc/neutron/dhcp_agent.ini in your preferred text editor. In # the [DEFAULT] section, add the following line: # # interface_driver = neutron.agent.linux.interface.RoutedInterfaceDriver cp /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.pre-calico sed -i "/^interface_driver/d" /etc/neutron/dhcp_agent.ini sed -i "/^\[DEFAULT\]/a\ interface_driver = neutron.agent.linux.interface.RoutedInterfaceDriver " /etc/neutron/dhcp_agent.ini # Allow BGP connections through the Fuel firewall. We do this before # installing calico-compute, so that they will be included when the # calico-compute install script does iptables-save. iptables -I INPUT 1 -p tcp --dport 179 -j ACCEPT # Add sources for BIRD and Ubuntu Precise. gpg --keyserver keyserver.ubuntu.com --recv-keys F9C59A45 gpg -a --export F9C59A45 | apt-key add - cat > /etc/apt/sources.list.d/bird.list < /etc/apt/sources.list.d/trusty.list <