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 | |
sgudz | 62df2fc | 2018-10-09 12:26:19 +0300 | [diff] [blame] | 38 | {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }} |
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 | |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 101 | - description: Install manila-api on first node |
| 102 | cmd: | |
| 103 | salt -C 'I@manila:api and *01*' state.sls manila.api; |
| 104 | node_name: {{ HOSTNAME_CFG01 }} |
| 105 | retry: {count: 1, delay: 5} |
| 106 | skip_fail: false |
| 107 | |
| 108 | - description: Install manila-api on other nodes |
| 109 | cmd: | |
| 110 | salt -C 'I@manila:api and not *01*' state.sls manila.api; |
| 111 | node_name: {{ HOSTNAME_CFG01 }} |
| 112 | retry: {count: 1, delay: 5} |
| 113 | skip_fail: false |
| 114 | |
| 115 | - description: Install manila-scheduler |
| 116 | cmd: | |
| 117 | salt -C 'I@manila:scheduler' state.sls manila.scheduler; |
| 118 | node_name: {{ HOSTNAME_CFG01 }} |
| 119 | retry: {count: 1, delay: 5} |
| 120 | skip_fail: false |
| 121 | |
| 122 | - description: Install manila-share |
| 123 | cmd: | |
| 124 | salt -C 'I@manila:share' state.sls manila.share; |
| 125 | node_name: {{ HOSTNAME_CFG01 }} |
| 126 | retry: {count: 1, delay: 5} |
| 127 | skip_fail: false |
| 128 | |
Tatyana Leontovich | 3cc1c13 | 2018-04-03 00:41:17 +0300 | [diff] [blame] | 129 | - description: WR https://mirantis.jira.com/browse/PROD-19012 |
| 130 | cmd: | |
Tatyana Leontovich | 1618a2a | 2018-04-03 10:19:25 +0300 | [diff] [blame] | 131 | salt 'ctl*' cmd.run 'systemctl restart apache2' |
Tatyana Leontovich | 3cc1c13 | 2018-04-03 00:41:17 +0300 | [diff] [blame] | 132 | node_name: {{ HOSTNAME_CFG01 }} |
| 133 | retry: {count: 1, delay: 5} |
| 134 | skip_fail: false |
| 135 | |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 136 | - description: Check manila-services |
| 137 | cmd: | |
| 138 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list' |
| 139 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 1618a2a | 2018-04-03 10:19:25 +0300 | [diff] [blame] | 140 | retry: {count: 3, delay: 15} |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 141 | skip_fail: false |
| 142 | |
Maksym Shalamov | ae15a77 | 2018-07-20 13:13:29 +0300 | [diff] [blame] | 143 | - description: Create manila type |
| 144 | cmd: | |
| 145 | salt 'cfg01*' state.sls manila.client |
| 146 | node_name: {{ HOSTNAME_CFG01 }} |
| 147 | retry: {count: 1, delay: 5} |
| 148 | skip_fail: false |
| 149 | |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 150 | - description: Create CIFS and NFS share and check it status |
| 151 | cmd: | |
| 152 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default'; |
| 153 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default'; |
| 154 | sleep 5; |
| 155 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list'; |
| 156 | node_name: {{ HOSTNAME_CFG01 }} |
| 157 | retry: {count: 1, delay: 5} |
| 158 | skip_fail: false |
Oleksii Butenko | c05c9f6 | 2018-04-19 19:00:02 +0300 | [diff] [blame] | 159 | |
Tatyana Leontovich | 92063ef | 2018-07-04 14:28:09 +0300 | [diff] [blame] | 160 | {{ BACKUP.MACRO_WR_NGINX_MASTER() }} |
Tatyana Leontovich | 4f61367 | 2018-06-12 21:41:19 +0300 | [diff] [blame] | 161 | {{ BACKUP.MACRO_BACKUP_BACKUPNINJA() }} |
sgudz | 62df2fc | 2018-10-09 12:26:19 +0300 | [diff] [blame] | 162 | {{ BACKUP.MACRO_BACKUP_XTRABACKUP() }} |