Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #https://gerrit.opnfv.org/gerrit/#/c/648/
- #Get Controler IP
- contr_ip=$(fuel node | grep controller | awk '{print $10}')
- #Get Compute IPs
- ips=$(fuel node | grep compute | awk '{print $10}')
- comp_ips_arr=($ips)
- echo "Controller node:"
- echo $contr_ip
- echo "Compute nodes:"
- for i in "${comp_ips_arr[@]}" ; do
- echo $i
- done
- # Change DNS config and call config_net_odl.sh on all Nodes
- cmd1='echo -e "domain domain.tld\nnameserver" 8.8.8.8> /etc/resolv.conf'
- cmd2='/etc/puppet/modules/opnfv/scripts/config_net_odl.sh'
- ssh $contr_ip $cmd1
- ssh $contr_ip $cmd2
- for i in "${comp_ips_arr[@]}" ; do
- #ssh $i $cmd1 ยท on computes, the br-ex doesn't have an IP, and they cannot even ping 8.8.8.8
- ssh $i $cmd2
- done
- # Stage ODL on controller
- ssh $contr_ip "/etc/puppet/modules/opnfv/scripts/stage_odl.sh"
- # Wait a bit (not sure how long or if this is needed...)
- sleep 60
- # Reboot Nodes
- ssh $contr_ip "reboot"
- for i in "${comp_ips_arr[@]}" ; do
- ssh $i "reboot"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement