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