diff options
author | CNlukai <lukai1@huawei.com> | 2016-01-11 17:39:55 +0800 |
---|---|---|
committer | CNlukai <lukai1@huawei.com> | 2016-01-11 17:41:56 +0800 |
commit | a94e0159d98d511be4b4da9afe077e1188cc6ce6 (patch) | |
tree | 46015bb12d272deef477fb90ebbc8bef67f960f8 /framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/ovs.pp | |
parent | 5d28b35794d9bdd8def6dfdf0224420daaa05f11 (diff) |
ONOSFW-157
Add script of installer integration onos
Change-Id: I0ac05b6a7ede8654af2c2573ea7ecb3e5e7a9473
Signed-off-by: CNlukai <lukai1@huawei.com>
Diffstat (limited to 'framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/ovs.pp')
-rw-r--r-- | framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/ovs.pp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/ovs.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/ovs.pp new file mode 100644 index 00000000..26332f3c --- /dev/null +++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/ovs.pp @@ -0,0 +1,77 @@ +include onos + + +Exec{path => "/usr/bin:/usr/sbin:/bin:/sbin",} + +case $::operatingsystem{ +centos:{ + $neutron_ovs_agent='neutron-openvswitch-agent' + $ovs_service='openvswitch' + $cmd_remove_agent='chkconfig --del neutron-openvswitch-agent' +} +ubuntu:{ + $neutron_ovs_agent='neutron-plugin-openvswitch-agent' + $ovs_service='openvswitch-switch' + $cmd_remove_agent='update-rc.d neutron-plugin-openvswitch-agent remove' +} + +} + +$roles = $onos::roles + +if member($roles, 'primary-controller') { +cs_resource { "p_${neutron_ovs_agent}": + ensure => absent, + before => Service["shut down and disable Neutron's agent services"], + }} +else{ +exec{'remove neutron-openvswitch-agent auto start': + command => "touch /opt/service; + $cmd_remove_agent; + sed -i /neutron-openvswitch-agent/d /opt/service", + before => Service["shut down and disable Neutron's agent services"], +} +} + + +firewall{'222 vxlan': + port => [4789], + proto => 'udp', + action => 'accept', +}-> +service {"shut down and disable Neutron's agent services": + name => $neutron_ovs_agent, + ensure => stopped, + enable => false, +}-> +exec{'Stop the OpenvSwitch service and clear existing OVSDB': + command => "service $ovs_service stop ; + rm -rf /var/log/openvswitch/* ; + rm -rf /etc/openvswitch/conf.db ; + service $ovs_service start ;" + +} -> +exec{'Set ONOS as the manager': + command => "su -s /bin/sh -c 'ovs-vsctl set-manager tcp:${onos::manager_ip}:6640'", + +} + + +$public_eth = $onos::public_eth +if member($roles, 'compute') { +exec{"net config": + command => "ifconfig $public_eth up", +} +} +else +{ +exec{"sleep 20 for ovsconnect": + command => "sleep 20", + require => Exec['Set ONOS as the manager'], +}-> +exec{"delete public port from ovs of controllers": + command => "ovs-vsctl del-port br-int $public_eth", +} +} + + |