From c1be687a93c43a2bce793e080d22aaf210718be8 Mon Sep 17 00:00:00 2001 From: Romanos Skiadas Date: Mon, 30 Jan 2017 13:02:16 +0200 Subject: [PATCH] Install and start quagga/zrpcd - compile and install zrpcd on the controller node using the compile script provided by upstream zrpcd - install a systemd file for zrpcd - start the service - increase the timeout for odl-install.pp to account for the compilation time Change-Id: Ia75cd9a2c9fa76ba128c943d373de4be96292e86 Signed-off-by: Romanos Skiadas --- .gitignore | 1 + .../puppet/manifests/odl-install.pp | 4 +++ .../modules/opendaylight/manifests/quagga.pp | 30 ++++++++++--------- .../opendaylight/templates/zrpcd.service | 11 +++++++ deployment_tasks.yaml | 2 +- pre_build_hook | 8 +++++ 6 files changed, 41 insertions(+), 15 deletions(-) create mode 100644 deployment_scripts/puppet/modules/opendaylight/templates/zrpcd.service diff --git a/.gitignore b/.gitignore index 445c48a..d9dbfd7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .project .pydevproject tmp/ +deployment_scripts/install_quagga.sh diff --git a/deployment_scripts/puppet/manifests/odl-install.pp b/deployment_scripts/puppet/manifests/odl-install.pp index fd7ab0b..44be6d3 100644 --- a/deployment_scripts/puppet/manifests/odl-install.pp +++ b/deployment_scripts/puppet/manifests/odl-install.pp @@ -6,3 +6,7 @@ class { 'opendaylight::install': rest_port => $opendaylight::rest_api_port, bind_address => $opendaylight::node_internal_address } + +class {'opendaylight::quagga': + before => Service['opendaylight'] +} diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/quagga.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/quagga.pp index 378a405..b97a174 100644 --- a/deployment_scripts/puppet/modules/opendaylight/manifests/quagga.pp +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/quagga.pp @@ -1,5 +1,6 @@ class opendaylight::quagga ( ){ + $master_ip = hiera('master_ip') firewall {'215 quagga': dport => 179, @@ -7,21 +8,22 @@ class opendaylight::quagga ( action => 'accept', } - package { ['opnfv-quagga', 'libcapnp-0.5.99', 'python-pycapnp', 'python-thriftpy']: - ensure => installed, - } - service {'opnfv-quagga': - ensure => running + $service_file = '/etc/systemd/system/zrpcd.service' + file { $service_file: + ensure => file, + content => template('opendaylight/zrpcd.service'), } - $config_path = '/usr/lib/quagga/qthrift/bgpd.conf' - ini_setting { 'bgp_password': - ensure => present, - setting => 'password', - value => 'sdncbgpc', - path => $config_path, - key_val_separator => ' ', - require => Package['opnfv-quagga'], - notify => Service['opnfv-quagga'] + if $::operatingsystem == 'Ubuntu' { + exec { 'install_quagga': + command => "curl http://${master_ip}:8080/plugins/opendaylight-1.0/deployment_scripts/install_quagga.sh | bash -s", + path => '/usr/bin:/usr/sbin:/bin:/sbin', + timeout => 0, + require => File[$service_file], + before => Service['zrpcd'] + } + service {'zrpcd': + ensure => running + } } } diff --git a/deployment_scripts/puppet/modules/opendaylight/templates/zrpcd.service b/deployment_scripts/puppet/modules/opendaylight/templates/zrpcd.service new file mode 100644 index 0000000..d8f88ba --- /dev/null +++ b/deployment_scripts/puppet/modules/opendaylight/templates/zrpcd.service @@ -0,0 +1,11 @@ +[Unit] +Description=ZRPC daemon for quagga +After=network.service + +[Service] +ExecStart=/opt/quagga/sbin/zrpcd +Type=simple +PIDFile=/var/run/zrpcd.pid + +[Install] +WantedBy=default.target diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index 96a7056..c4b6d86 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -20,7 +20,7 @@ parameters: puppet_manifest: puppet/manifests/odl-install.pp puppet_modules: puppet/modules:/etc/puppet/modules - timeout: 720 + timeout: 3000 # We remove override file, because 'odl_hiera_override' task is not reenterant and # cannot correctly handled data on subsequent calls diff --git a/pre_build_hook b/pre_build_hook index 0d00137..78a66bb 100755 --- a/pre_build_hook +++ b/pre_build_hook @@ -68,3 +68,11 @@ if ! in_cache $NETWORKING_ODL_DEB ;then wget -O ${CACHE_DEB_DIR}/${NETWORKING_ODL_DEB} ${NETWORKING_ODL_REPO}/${NETWORKING_ODL_DEB} fi copy_from_cache $NETWORKING_ODL_DEB + +curl https://raw.githubusercontent.com/6wind/zrpcd/eddf5bd6305ef52a2d39df99860c734935dbc4af/pkgsrc/dev_compile_script.sh -o deployment_scripts/install_quagga.sh +# ubuntu 16.04 compatibility +sed -i 's/libboost1.55/libboost1.58/' deployment_scripts/install_quagga.sh +# pin the versions of things that the compile script downloads. +# These are the latest commits at the time this script was written. +sed -i 's/cd zrpcd/cd zrpcd \&\& git checkout eddf5bd6305ef52a2d39df99860c734935dbc4af/' deployment_scripts/install_quagga.sh +sed -i 's/quagga_110_mpbgp_capnp/95bb0f4a5/' deployment_scripts/install_quagga.sh