Dennis Dmitriev | ab83ea4 | 2017-05-12 16:52:45 +0300 | [diff] [blame] | 1 | {% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %} |
Tatyana Leontovich | 47dbd3a | 2017-06-22 17:36:53 +0300 | [diff] [blame] | 2 | {% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %} |
Tatyana Leontovich | ac38bac | 2017-07-17 14:05:33 +0300 | [diff] [blame] | 5 | {% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %} |
Sergii Golovatiuk | 50f9189 | 2017-08-04 18:11:06 +0200 | [diff] [blame] | 6 | {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| 7 | {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 8 | |
ibumarskov | 942417e | 2018-08-23 22:05:59 +0400 | [diff] [blame] | 9 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
| 10 | |
ibumarskov | 7bdc7ed | 2018-08-24 12:06:38 +0400 | [diff] [blame] | 11 | # Deploy nginx before openstack services (PROD-22740) |
| 12 | - description: Deploy nginx proxy |
| 13 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 14 | -C 'I@nginx:server' state.sls nginx |
| 15 | node_name: {{ HOSTNAME_CFG01 }} |
| 16 | retry: {count: 1, delay: 5} |
| 17 | skip_fail: true |
| 18 | |
| 19 | {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 20 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 21 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
ibumarskov | e23c10e | 2018-08-20 15:47:58 +0400 | [diff] [blame] | 22 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 23 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} |
Dennis Dmitriev | 4ab889c | 2017-04-27 14:11:04 +0300 | [diff] [blame] | 24 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 25 | {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 26 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 27 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }} |
Tatyana Leontovich | fa7ae4d | 2017-04-25 13:46:14 +0300 | [diff] [blame] | 28 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 29 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
Tatyana Leontovich | fa7ae4d | 2017-04-25 13:46:14 +0300 | [diff] [blame] | 30 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 31 | # install designate backend |
Tatyana Leontovich | 85e822a | 2017-06-15 11:52:01 +0300 | [diff] [blame] | 32 | - description: Install bind |
| 33 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | 033aac0 | 2017-06-15 15:01:21 +0300 | [diff] [blame] | 34 | -C 'I@bind:server' state.sls bind |
Tatyana Leontovich | 85e822a | 2017-06-15 11:52:01 +0300 | [diff] [blame] | 35 | node_name: {{ HOSTNAME_CFG01 }} |
| 36 | retry: {count: 1, delay: 5} |
| 37 | skip_fail: false |
| 38 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 39 | {{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 40 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 41 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 42 | |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 43 | # Install compute node |
| 44 | |
| 45 | - description: Apply formulas for compute node |
| 46 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 47 | node_name: {{ HOSTNAME_CFG01 }} |
| 48 | retry: {count: 1, delay: 5} |
| 49 | skip_fail: true |
| 50 | |
| 51 | - description: Re-apply(as in doc) formulas for compute node |
| 52 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 53 | node_name: {{ HOSTNAME_CFG01 }} |
| 54 | retry: {count: 1, delay: 5} |
Oleksii Butenko | 9f2601c | 2018-02-08 15:13:21 +0200 | [diff] [blame] | 55 | skip_fail: false |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 56 | |
| 57 | - description: Check IP on computes |
| 58 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 59 | 'ip a' |
| 60 | node_name: {{ HOSTNAME_CFG01 }} |
| 61 | retry: {count: 10, delay: 30} |
| 62 | skip_fail: false |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 63 | |
| 64 | |
| 65 | # Upload cirros image |
| 66 | |
| 67 | - description: Upload cirros image on ctl01 |
| 68 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
ibumarskov | 2cea0d4 | 2018-07-24 08:40:50 +0400 | [diff] [blame] | 69 | 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2' |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 70 | node_name: {{ HOSTNAME_CFG01 }} |
| 71 | retry: {count: 2, delay: 30} |
| 72 | skip_fail: false |
| 73 | |
| 74 | - description: Register image in glance |
| 75 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
ibumarskov | 2cea0d4 | 2018-07-24 08:40:50 +0400 | [diff] [blame] | 76 | '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2' |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 77 | node_name: {{ HOSTNAME_CFG01 }} |
| 78 | retry: {count: 1, delay: 30} |
| 79 | skip_fail: false |
| 80 | |
| 81 | - description: Create net04_external |
| 82 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
Tatyana Leontovich | 674abf8 | 2017-07-20 15:44:15 +0300 | [diff] [blame] | 83 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 1, delay: 30} |
| 86 | skip_fail: false |
| 87 | |
| 88 | - description: Create subnet_external |
| 89 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 90 | '. /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' |
| 91 | node_name: {{ HOSTNAME_CFG01 }} |
| 92 | retry: {count: 1, delay: 30} |
| 93 | skip_fail: false |
| 94 | |
| 95 | - description: Create net04 |
| 96 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 97 | '. /root/keystonercv3; neutron net-create net04' |
| 98 | node_name: {{ HOSTNAME_CFG01 }} |
| 99 | retry: {count: 1, delay: 30} |
| 100 | skip_fail: false |
| 101 | |
| 102 | - description: Create subnet_net04 |
| 103 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 104 | '. /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' |
| 105 | node_name: {{ HOSTNAME_CFG01 }} |
| 106 | retry: {count: 1, delay: 30} |
| 107 | skip_fail: false |
| 108 | |
| 109 | - description: Create router |
| 110 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 111 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 112 | node_name: {{ HOSTNAME_CFG01 }} |
| 113 | retry: {count: 1, delay: 30} |
| 114 | skip_fail: false |
| 115 | |
ibumarskov | c075df8 | 2018-07-30 13:23:07 +0400 | [diff] [blame] | 116 | - description: Set gateway |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 117 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 118 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 119 | node_name: {{ HOSTNAME_CFG01 }} |
| 120 | retry: {count: 1, delay: 30} |
| 121 | skip_fail: false |
| 122 | |
| 123 | - description: Add interface |
| 124 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 125 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 126 | node_name: {{ HOSTNAME_CFG01 }} |
| 127 | retry: {count: 1, delay: 30} |
| 128 | skip_fail: false |
| 129 | |
| 130 | - description: Allow all tcp |
| 131 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 132 | '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0' |
| 133 | node_name: {{ HOSTNAME_CFG01 }} |
| 134 | retry: {count: 1, delay: 30} |
| 135 | skip_fail: false |
| 136 | |
| 137 | - description: Allow all icmp |
| 138 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 139 | '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0' |
| 140 | node_name: {{ HOSTNAME_CFG01 }} |
| 141 | retry: {count: 1, delay: 30} |
| 142 | skip_fail: false |
| 143 | |
Tatyana Leontovich | 07bc6ed | 2017-07-25 13:26:48 +0300 | [diff] [blame] | 144 | - description: sync time |
| 145 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 146 | 'service ntp stop; ntpd -gq; service ntp start' |
| 147 | node_name: {{ HOSTNAME_CFG01 }} |
| 148 | retry: {count: 1, delay: 30} |
| 149 | skip_fail: false |
| 150 | |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 151 | # Configure cinder-volume salt-call |
| 152 | - description: Set disks 01 |
| 153 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
Tatyana Leontovich | 135d815 | 2017-06-27 16:10:42 +0300 | [diff] [blame] | 154 | node_name: {{ HOSTNAME_CTL01 }} |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 155 | retry: {count: 1, delay: 30} |
| 156 | skip_fail: false |
| 157 | |
| 158 | - description: Set disks 02 |
| 159 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 160 | node_name: {{ HOSTNAME_CTL02 }} |
| 161 | retry: {count: 1, delay: 30} |
| 162 | skip_fail: false |
| 163 | |
| 164 | - description: Set disks 03 |
| 165 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 166 | node_name: {{ HOSTNAME_CTL03 }} |
| 167 | retry: {count: 1, delay: 30} |
| 168 | skip_fail: false |
| 169 | |
| 170 | - description: Create partitions 01 |
| 171 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 172 | node_name: {{ HOSTNAME_CTL01 }} |
| 173 | retry: {count: 1, delay: 30} |
| 174 | skip_fail: false |
| 175 | |
| 176 | - description: Create partitions 02 |
| 177 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
sgudz | 2e39339 | 2017-10-17 12:51:26 +0300 | [diff] [blame] | 178 | node_name: {{ HOSTNAME_CTL02 }} |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 179 | retry: {count: 1, delay: 30} |
| 180 | skip_fail: false |
| 181 | |
| 182 | - description: Create partitions 03 |
| 183 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
sgudz | 2e39339 | 2017-10-17 12:51:26 +0300 | [diff] [blame] | 184 | node_name: {{ HOSTNAME_CTL03 }} |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 185 | retry: {count: 1, delay: 30} |
Tatyana Leontovich | ac38bac | 2017-07-17 14:05:33 +0300 | [diff] [blame] | 186 | skip_fail: false |
| 187 | |
| 188 | - description: create volume_group |
| 189 | cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1' |
| 190 | node_name: {{ HOSTNAME_CFG01 }} |
| 191 | retry: {count: 1, delay: 30} |
| 192 | skip_fail: false |
| 193 | |
| 194 | - description: Install cinder-volume |
| 195 | cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y' |
| 196 | node_name: {{ HOSTNAME_CFG01 }} |
| 197 | retry: {count: 1, delay: 30} |
| 198 | skip_fail: false |
| 199 | |
| 200 | - description: Install crudini |
| 201 | cmd: salt "ctl*" cmd.run 'apt-get install crudini -y' |
| 202 | node_name: {{ HOSTNAME_CFG01 }} |
| 203 | retry: {count: 1, delay: 30} |
| 204 | skip_fail: false |
| 205 | |
| 206 | - description: Temporary WR set enabled backends value 01 |
| 207 | cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm' |
| 208 | node_name: {{ HOSTNAME_CTL01 }} |
| 209 | retry: {count: 1, delay: 30} |
| 210 | skip_fail: false |
| 211 | |
| 212 | - description: Temporary WR set enabled backends value 02 |
| 213 | cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm' |
| 214 | node_name: {{ HOSTNAME_CTL02 }} |
| 215 | retry: {count: 1, delay: 30} |
| 216 | skip_fail: false |
| 217 | |
| 218 | - description: Temporary WR set enabled backends value 03 |
| 219 | cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm' |
| 220 | node_name: {{ HOSTNAME_CTL03 }} |
| 221 | retry: {count: 1, delay: 30} |
| 222 | skip_fail: false |
| 223 | |
Tatyana Leontovich | 47f7bfe | 2018-01-05 13:36:09 +0200 | [diff] [blame] | 224 | - description: Restart cinder volume |
| 225 | cmd: | |
| 226 | salt -C 'I@cinder:controller' service.restart cinder-volume; |
| 227 | node_name: {{ HOSTNAME_CFG01 }} |
| 228 | retry: {count: 2, delay: 5} |
| 229 | skip_fail: false |
| 230 | |
Tatyana Leontovich | ac38bac | 2017-07-17 14:05:33 +0300 | [diff] [blame] | 231 | - description: Install docker.io on gtw |
| 232 | cmd: salt-call cmd.run 'apt-get install docker.io -y' |
| 233 | node_name: {{ HOSTNAME_GTW01 }} |
| 234 | retry: {count: 1, delay: 30} |
| 235 | skip_fail: false |
| 236 | |
Tatyana Leontovich | d6bcbc9 | 2018-03-23 15:02:28 +0200 | [diff] [blame] | 237 | - description: Enable forward policy |
| 238 | cmd: iptables --policy FORWARD ACCEPT |
| 239 | node_name: {{ HOSTNAME_GTW01 }} |
| 240 | retry: {count: 1, delay: 30} |
| 241 | skip_fail: false |
| 242 | |
Tatyana Leontovich | ac38bac | 2017-07-17 14:05:33 +0300 | [diff] [blame] | 243 | - description: create rc file on cfg |
| 244 | cmd: scp ctl01:/root/keystonercv3 /root |
| 245 | node_name: {{ HOSTNAME_CFG01 }} |
| 246 | retry: {count: 1, delay: 30} |
| 247 | skip_fail: false |
| 248 | |
| 249 | - description: Copy rc file |
| 250 | cmd: scp /root/keystonercv3 gtw01:/root |
| 251 | node_name: {{ HOSTNAME_CFG01 }} |
| 252 | retry: {count: 1, delay: 30} |
| 253 | skip_fail: false |