ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 1 | {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| 5 | {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| 6 | {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| 7 | {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
| 8 | |
| 9 | # Install OpenStack control services |
ibumarskov | 5986763 | 2018-05-21 17:03:24 +0400 | [diff] [blame] | 10 | - description: Sync time |
| 11 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -G 'oscodename:trusty' cmd.run "service ntp stop && ntpdate pool.ntp.org && service ntp start" |
| 12 | node_name: {{ HOSTNAME_CFG01 }} |
| 13 | retry: {count: 1, delay: 5} |
| 14 | skip_fail: false |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 15 | |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 16 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
ibumarskov | e23c10e | 2018-08-20 15:47:58 +0400 | [diff] [blame] | 17 | |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 18 | # Deploy nginx before openstack services (PROD-22740) |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 19 | - description: Deploy nginx proxy |
| 20 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 21 | -C 'I@nginx:server' state.sls nginx |
| 22 | node_name: {{ HOSTNAME_CFG01 }} |
| 23 | retry: {count: 1, delay: 5} |
| 24 | skip_fail: true |
| 25 | |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 26 | {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }} |
| 27 | |
| 28 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
| 29 | |
| 30 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} |
| 31 | |
| 32 | {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }} |
| 33 | |
| 34 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }} |
| 35 | |
| 36 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
| 37 | |
| 38 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }} |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 39 | |
| 40 | # Install compute node |
| 41 | |
| 42 | - description: Apply formulas for compute node |
| 43 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 44 | node_name: {{ HOSTNAME_CFG01 }} |
| 45 | retry: {count: 1, delay: 5} |
| 46 | skip_fail: true |
| 47 | |
| 48 | - description: Re-apply(as in doc) formulas for compute node |
| 49 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 50 | node_name: {{ HOSTNAME_CFG01 }} |
| 51 | retry: {count: 1, delay: 5} |
| 52 | skip_fail: true |
| 53 | |
ibumarskov | 34d75d3 | 2018-09-11 13:18:10 +0400 | [diff] [blame^] | 54 | - description: Restart libvirtd on compute nodes (PROD-23034) |
| 55 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' service.restart libvirtd |
| 56 | node_name: {{ HOSTNAME_CFG01 }} |
| 57 | retry: {count: 1, delay: 5} |
| 58 | skip_fail: false |
| 59 | |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 60 | - description: Check IP on computes |
| 61 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 62 | 'ip a' |
| 63 | node_name: {{ HOSTNAME_CFG01 }} |
| 64 | retry: {count: 10, delay: 30} |
| 65 | skip_fail: false |
| 66 | |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 67 | # Upload cirros image |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 68 | |
| 69 | - description: Upload cirros image on ctl01 |
| 70 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 71 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| 72 | node_name: {{ HOSTNAME_CFG01 }} |
| 73 | retry: {count: 2, delay: 30} |
| 74 | skip_fail: false |
| 75 | |
| 76 | - description: Register image in glance |
| 77 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 78 | '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img' |
| 79 | node_name: {{ HOSTNAME_CFG01 }} |
| 80 | retry: {count: 1, delay: 30} |
| 81 | skip_fail: false |
| 82 | |
| 83 | - description: Create net04_external |
| 84 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 85 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 86 | node_name: {{ HOSTNAME_CFG01 }} |
| 87 | retry: {count: 1, delay: 30} |
| 88 | skip_fail: false |
| 89 | |
| 90 | - description: Create subnet_external |
| 91 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 92 | '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1' |
| 93 | node_name: {{ HOSTNAME_CFG01 }} |
| 94 | retry: {count: 1, delay: 30} |
| 95 | skip_fail: false |
| 96 | |
| 97 | - description: Create net04 |
| 98 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 99 | '. /root/keystonercv3; neutron net-create net04' |
| 100 | node_name: {{ HOSTNAME_CFG01 }} |
| 101 | retry: {count: 1, delay: 30} |
| 102 | skip_fail: false |
| 103 | |
| 104 | - description: Create subnet_net04 |
| 105 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 106 | '. /root/keystonercv3; neutron subnet-create net04 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240' |
| 107 | node_name: {{ HOSTNAME_CFG01 }} |
| 108 | retry: {count: 1, delay: 30} |
| 109 | skip_fail: false |
| 110 | |
| 111 | - description: Create router |
| 112 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 113 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 114 | node_name: {{ HOSTNAME_CFG01 }} |
| 115 | retry: {count: 1, delay: 30} |
| 116 | skip_fail: false |
| 117 | |
| 118 | - description: Set geteway |
| 119 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 120 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 121 | node_name: {{ HOSTNAME_CFG01 }} |
| 122 | retry: {count: 1, delay: 30} |
| 123 | skip_fail: false |
| 124 | |
| 125 | - description: Add interface |
| 126 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 127 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 128 | node_name: {{ HOSTNAME_CFG01 }} |
| 129 | retry: {count: 1, delay: 30} |
| 130 | skip_fail: false |
| 131 | |
| 132 | #- description: Allow all tcp |
| 133 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 134 | # '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default' |
| 135 | # node_name: {{ HOSTNAME_CFG01 }} |
| 136 | # retry: {count: 1, delay: 30} |
| 137 | # skip_fail: false |
| 138 | # |
| 139 | #- description: Allow all icmp |
| 140 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 141 | # '. /root/keystonercv3; openstack security group rule create --proto icmp default' |
| 142 | # node_name: {{ HOSTNAME_CFG01 }} |
| 143 | # retry: {count: 1, delay: 30} |
| 144 | # skip_fail: false |
| 145 | |
| 146 | - description: sync time |
| 147 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 148 | 'service ntp stop; ntpd -gq; service ntp start' |
| 149 | node_name: {{ HOSTNAME_CFG01 }} |
| 150 | retry: {count: 1, delay: 30} |
| 151 | skip_fail: true |
| 152 | |
| 153 | - description: Install docker.io on gtw |
| 154 | cmd: salt-call cmd.run 'apt-get install docker.io -y' |
| 155 | node_name: {{ HOSTNAME_CFG01 }} |
| 156 | retry: {count: 1, delay: 30} |
| 157 | skip_fail: false |
| 158 | |
| 159 | - description: Enable forward policy on gtw |
| 160 | cmd: | |
| 161 | set -e; |
| 162 | iptables --policy FORWARD ACCEPT; |
| 163 | node_name: {{ HOSTNAME_GTW01 }} |
| 164 | retry: {count: 1, delay: 30} |
| 165 | skip_fail: false |
| 166 | |
| 167 | - description: create rc file on cfg |
| 168 | cmd: scp ctl01:/root/keystonercv3 /root |
| 169 | node_name: {{ HOSTNAME_CFG01 }} |
| 170 | retry: {count: 1, delay: 30} |
| 171 | skip_fail: false |
| 172 | |
| 173 | - description: Copy rc file |
| 174 | cmd: scp /root/keystonercv3 gtw01:/root |
| 175 | node_name: {{ HOSTNAME_CFG01 }} |
| 176 | retry: {count: 1, delay: 30} |
| 177 | skip_fail: false |