Oleksii Butenko | be369b2 | 2018-07-19 12:40:23 +0300 | [diff] [blame] | 1 | {% from 'cookied-bm-dpdk-pipeline/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 3 | |
| 4 | - description: "Give each node root access with key from cfg01" |
| 5 | cmd: | |
| 6 | set -e; |
| 7 | set -x; |
| 8 | key=$(ssh-keygen -y -f /root/.ssh/id_rsa); |
| 9 | salt '*' cmd.run "echo $key >> /root/.ssh/authorized_keys"; |
| 10 | salt '*' cmd.run "service sshd restart" |
| 11 | node_name: {{ HOSTNAME_CFG01 }} |
| 12 | retry: {count: 1, delay: 5} |
| 13 | skip_fail: true |
| 14 | |
| 15 | - description: temp WR |
| 16 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 17 | 'ifdown br-prv; ifup br-prv' |
| 18 | node_name: {{ HOSTNAME_CFG01 }} |
| 19 | retry: {count: 1, delay: 30} |
| 20 | skip_fail: false |
| 21 | |
| 22 | - description: Create net04_external |
| 23 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 24 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 25 | node_name: {{ HOSTNAME_CFG01 }} |
| 26 | retry: {count: 1, delay: 30} |
| 27 | skip_fail: false |
| 28 | |
| 29 | - description: Create subnet_external |
| 30 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 31 | '. /root/keystonercv3; neutron subnet-create net04_ext 172.17.42.128/26 --name net04_ext__subnet --disable-dhcp --allocation-pool start=172.17.42.130,end=172.17.42.180 --gateway 172.17.42.129' |
| 32 | node_name: {{ HOSTNAME_CFG01 }} |
| 33 | retry: {count: 1, delay: 30} |
| 34 | skip_fail: false |
| 35 | |
| 36 | - description: Create net04 |
| 37 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 38 | '. /root/keystonercv3; neutron net-create net04 --provider:network_type vxlan' |
| 39 | node_name: {{ HOSTNAME_CFG01 }} |
| 40 | retry: {count: 1, delay: 30} |
| 41 | skip_fail: false |
| 42 | |
| 43 | - description: Create subnet_net04 |
| 44 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 45 | '. /root/keystonercv3; neutron subnet-create net04 192.168.1.0/24 --name net04__subnet --allocation-pool start=192.168.1.150,end=192.168.1.240' |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 1, delay: 30} |
| 48 | skip_fail: false |
| 49 | |
| 50 | - description: Create router |
| 51 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 52 | '. /root/keystonercv3; neutron router-create net04_router01 --ha False' |
| 53 | node_name: {{ HOSTNAME_CFG01 }} |
| 54 | retry: {count: 1, delay: 30} |
| 55 | skip_fail: false |
| 56 | |
| 57 | - description: Set geteway |
| 58 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 59 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 60 | node_name: {{ HOSTNAME_CFG01 }} |
| 61 | retry: {count: 1, delay: 30} |
| 62 | skip_fail: false |
| 63 | |
| 64 | - description: Add interface |
| 65 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 66 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 67 | node_name: {{ HOSTNAME_CFG01 }} |
| 68 | retry: {count: 1, delay: 30} |
| 69 | skip_fail: false |
| 70 | |
| 71 | {{ SHARED.INSTALL_DOCKER_ON_GTW() }} |