Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 1 | {% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| 5 | {% from 'virtual-mcp-pike-dvr/underlay.yaml' import HOSTNAME_GTW01 with context %} |
Oleksii Butenko | c05c9f6 | 2018-04-19 19:00:02 +0300 | [diff] [blame] | 6 | {% from 'virtual-mcp-pike-dvr/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 7 | {% from 'virtual-mcp-pike-dvr/underlay.yaml' import DOMAIN_NAME with context %} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +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 | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 10 | {% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %} |
Oleksii Butenko | c05c9f6 | 2018-04-19 19:00:02 +0300 | [diff] [blame] | 11 | {% import 'shared-salt.yaml' as SHARED with context %} |
Tatyana Leontovich | 4f61367 | 2018-06-12 21:41:19 +0300 | [diff] [blame] | 12 | {% import 'shared-backup-restore.yaml' as BACKUP with context %} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 13 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 14 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
| 15 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 16 | # Install OpenStack control services |
| 17 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 18 | {%- if OVERRIDE_POLICY != '' %} |
| 19 | - description: Upload policy override |
| 20 | upload: |
| 21 | local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/ |
| 22 | local_filename: overrides-policy.yml |
| 23 | remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/ |
| 24 | node_name: {{ HOSTNAME_CFG01 }} |
| 25 | |
| 26 | - description: Create custom cluster control class |
| 27 | cmd: echo -e "classes:\n- cluster.{{ LAB_CONFIG_NAME }}.openstack.control_orig\n$(cat /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml)" > /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml |
| 28 | node_name: {{ HOSTNAME_CFG01 }} |
| 29 | |
| 30 | - description: Rename control classes |
| 31 | cmd: mv /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control_orig.yml && |
| 32 | ln -s /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml && |
| 33 | salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && |
| 34 | salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar |
| 35 | node_name: {{ HOSTNAME_CFG01 }} |
| 36 | {%- endif %} |
| 37 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 38 | {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 39 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 40 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 41 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 42 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 43 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 44 | {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 45 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 46 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 47 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 48 | # isntall designate |
| 49 | - description: Install powerdns |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 50 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 51 | -C 'I@powerdns:server' state.sls powerdns.server |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 52 | node_name: {{ HOSTNAME_CFG01 }} |
| 53 | retry: {count: 1, delay: 5} |
| 54 | skip_fail: false |
| 55 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 56 | - description: Install designate |
| 57 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 58 | -C 'I@designate:server' state.sls designate -b 1 |
| 59 | node_name: {{ HOSTNAME_CFG01 }} |
| 60 | retry: {count: 5, delay: 10} |
| 61 | skip_fail: false |
| 62 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 63 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 64 | |
| 65 | - description: Deploy horizon dashboard |
| 66 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 67 | -C 'I@horizon:server' state.sls horizon |
| 68 | node_name: {{ HOSTNAME_CFG01 }} |
| 69 | retry: {count: 1, delay: 5} |
| 70 | skip_fail: true |
| 71 | |
| 72 | - description: Deploy nginx proxy |
| 73 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 74 | -C 'I@nginx:server' state.sls nginx |
| 75 | node_name: {{ HOSTNAME_CFG01 }} |
| 76 | retry: {count: 1, delay: 5} |
| 77 | skip_fail: true |
| 78 | |
| 79 | |
| 80 | # Install compute node |
| 81 | |
| 82 | - description: Apply formulas for compute node |
| 83 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 1, delay: 5} |
| 86 | skip_fail: true |
| 87 | |
| 88 | - description: Re-apply(as in doc) formulas for compute node |
| 89 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 90 | node_name: {{ HOSTNAME_CFG01 }} |
| 91 | retry: {count: 1, delay: 5} |
Oleksii Butenko | 9f2601c | 2018-02-08 15:13:21 +0200 | [diff] [blame] | 92 | skip_fail: false |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 93 | |
| 94 | - description: Check IP on computes |
| 95 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 96 | 'ip a' |
| 97 | node_name: {{ HOSTNAME_CFG01 }} |
| 98 | retry: {count: 10, delay: 30} |
| 99 | skip_fail: false |
| 100 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 101 | - description: Create net04_external |
| 102 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 103 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 104 | node_name: {{ HOSTNAME_CFG01 }} |
| 105 | retry: {count: 1, delay: 30} |
| 106 | skip_fail: false |
| 107 | |
| 108 | - description: Create subnet_external |
| 109 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 110 | '. /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' |
| 111 | node_name: {{ HOSTNAME_CFG01 }} |
| 112 | retry: {count: 1, delay: 30} |
| 113 | skip_fail: false |
| 114 | |
| 115 | - description: Create net04 |
| 116 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 117 | '. /root/keystonercv3; neutron net-create net04' |
| 118 | node_name: {{ HOSTNAME_CFG01 }} |
| 119 | retry: {count: 1, delay: 30} |
| 120 | skip_fail: false |
| 121 | |
| 122 | - description: Create subnet_net04 |
| 123 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
Tatyana Leontovich | 7305c41 | 2018-04-27 00:26:27 +0300 | [diff] [blame] | 124 | '. /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 }}.180' |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 125 | node_name: {{ HOSTNAME_CFG01 }} |
| 126 | retry: {count: 1, delay: 30} |
| 127 | skip_fail: false |
| 128 | |
| 129 | - description: Create router |
| 130 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 131 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 132 | node_name: {{ HOSTNAME_CFG01 }} |
| 133 | retry: {count: 1, delay: 30} |
| 134 | skip_fail: false |
| 135 | |
| 136 | - description: Set geteway |
| 137 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 138 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 139 | node_name: {{ HOSTNAME_CFG01 }} |
| 140 | retry: {count: 1, delay: 30} |
| 141 | skip_fail: false |
| 142 | |
| 143 | - description: Add interface |
| 144 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 145 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 146 | node_name: {{ HOSTNAME_CFG01 }} |
| 147 | retry: {count: 1, delay: 30} |
| 148 | skip_fail: false |
| 149 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 150 | - description: sync time |
| 151 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 152 | 'service ntp stop; ntpd -gq; service ntp start' |
| 153 | node_name: {{ HOSTNAME_CFG01 }} |
| 154 | retry: {count: 1, delay: 30} |
| 155 | skip_fail: false |
| 156 | |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 157 | - description: Install manila-api on first node |
| 158 | cmd: | |
| 159 | salt -C 'I@manila:api and *01*' state.sls manila.api; |
| 160 | node_name: {{ HOSTNAME_CFG01 }} |
| 161 | retry: {count: 1, delay: 5} |
| 162 | skip_fail: false |
| 163 | |
| 164 | - description: Install manila-api on other nodes |
| 165 | cmd: | |
| 166 | salt -C 'I@manila:api and not *01*' state.sls manila.api; |
| 167 | node_name: {{ HOSTNAME_CFG01 }} |
| 168 | retry: {count: 1, delay: 5} |
| 169 | skip_fail: false |
| 170 | |
| 171 | - description: Install manila-scheduler |
| 172 | cmd: | |
| 173 | salt -C 'I@manila:scheduler' state.sls manila.scheduler; |
| 174 | node_name: {{ HOSTNAME_CFG01 }} |
| 175 | retry: {count: 1, delay: 5} |
| 176 | skip_fail: false |
| 177 | |
| 178 | - description: Install manila-share |
| 179 | cmd: | |
| 180 | salt -C 'I@manila:share' state.sls manila.share; |
| 181 | node_name: {{ HOSTNAME_CFG01 }} |
| 182 | retry: {count: 1, delay: 5} |
| 183 | skip_fail: false |
| 184 | |
Tatyana Leontovich | 3cc1c13 | 2018-04-03 00:41:17 +0300 | [diff] [blame] | 185 | - description: WR https://mirantis.jira.com/browse/PROD-19012 |
| 186 | cmd: | |
Tatyana Leontovich | 1618a2a | 2018-04-03 10:19:25 +0300 | [diff] [blame] | 187 | salt 'ctl*' cmd.run 'systemctl restart apache2' |
Tatyana Leontovich | 3cc1c13 | 2018-04-03 00:41:17 +0300 | [diff] [blame] | 188 | node_name: {{ HOSTNAME_CFG01 }} |
| 189 | retry: {count: 1, delay: 5} |
| 190 | skip_fail: false |
| 191 | |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 192 | - description: Check manila-services |
| 193 | cmd: | |
| 194 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list' |
| 195 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 1618a2a | 2018-04-03 10:19:25 +0300 | [diff] [blame] | 196 | retry: {count: 3, delay: 15} |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 197 | skip_fail: false |
| 198 | |
Maksym Shalamov | ae15a77 | 2018-07-20 13:13:29 +0300 | [diff] [blame] | 199 | - description: Create manila type |
| 200 | cmd: | |
| 201 | salt 'cfg01*' state.sls manila.client |
| 202 | node_name: {{ HOSTNAME_CFG01 }} |
| 203 | retry: {count: 1, delay: 5} |
| 204 | skip_fail: false |
| 205 | |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 206 | - description: Create CIFS and NFS share and check it status |
| 207 | cmd: | |
| 208 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default'; |
| 209 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default'; |
| 210 | sleep 5; |
| 211 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list'; |
| 212 | node_name: {{ HOSTNAME_CFG01 }} |
| 213 | retry: {count: 1, delay: 5} |
| 214 | skip_fail: false |
Oleksii Butenko | c05c9f6 | 2018-04-19 19:00:02 +0300 | [diff] [blame] | 215 | |
Tatyana Leontovich | 92063ef | 2018-07-04 14:28:09 +0300 | [diff] [blame] | 216 | {{ BACKUP.MACRO_WR_NGINX_MASTER() }} |
Tatyana Leontovich | 4f61367 | 2018-06-12 21:41:19 +0300 | [diff] [blame] | 217 | {{ BACKUP.MACRO_BACKUP_BACKUPNINJA() }} |
| 218 | {{ BACKUP.MACRO_BACKUP_XTRABACKUP() }} |
Oleksii Butenko | 5cd0a16 | 2018-06-14 18:18:10 +0300 | [diff] [blame] | 219 | {{ SHARED.INSTALL_DOCKER_ON_GTW() }} |