Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 1 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| 5 | {% from 'virtual-offline-pike-ovs-dpdk/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 %} |
Tatyana Leontovich | eae3205 | 2018-10-24 22:28:18 +0300 | [diff] [blame^] | 8 | {% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'proposed') %} |
Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 9 | # Install OpenStack control services |
Tatyana Leontovich | 0eb5ca3 | 2018-07-13 22:05:17 +0300 | [diff] [blame] | 10 | {% set DOMAIN_NAME = os_env('DOMAIN_NAME', 'virtual-offline-pike-ovs-dpdk') %} |
Tatyana Leontovich | bb29d1d | 2018-06-19 13:23:04 +0300 | [diff] [blame] | 11 | {% import 'shared-backup-restore.yaml' as BACKUP with context %} |
Tatyana Leontovich | 0eb5ca3 | 2018-07-13 22:05:17 +0300 | [diff] [blame] | 12 | {% import 'shared-salt.yaml' as SHARED with context %} |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 13 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
Tatyana Leontovich | 0eb5ca3 | 2018-07-13 22:05:17 +0300 | [diff] [blame] | 14 | |
Tatyana Leontovich | eae3205 | 2018-10-24 22:28:18 +0300 | [diff] [blame^] | 15 | {% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/' + REPOSITORY_SUITE + '/docker/xenial xenial stable') %} |
Tatyana Leontovich | 0eb5ca3 | 2018-07-13 22:05:17 +0300 | [diff] [blame] | 16 | |
sgudz | 62df2fc | 2018-10-09 12:26:19 +0300 | [diff] [blame] | 17 | {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }} |
Tatyana Leontovich | bb29d1d | 2018-06-19 13:23:04 +0300 | [diff] [blame] | 18 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 19 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 20 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 21 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} |
Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 22 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 23 | {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }} |
Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 24 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 25 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }} |
Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 26 | |
Tatyana Leontovich | 5fb5ea5 | 2018-07-27 19:35:36 +0300 | [diff] [blame] | 27 | # isntall designate |
| 28 | - description: Install powerdns |
| 29 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 30 | -C 'I@powerdns:server' state.sls powerdns.server |
| 31 | node_name: {{ HOSTNAME_CFG01 }} |
| 32 | retry: {count: 1, delay: 5} |
| 33 | skip_fail: false |
| 34 | |
| 35 | - description: Install designate |
| 36 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 37 | -C 'I@designate:server' state.sls designate -b 1 |
| 38 | node_name: {{ HOSTNAME_CFG01 }} |
| 39 | retry: {count: 5, delay: 10} |
| 40 | skip_fail: false |
| 41 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 42 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 43 | |
Tatyana Leontovich | 5fb5ea5 | 2018-07-27 19:35:36 +0300 | [diff] [blame] | 44 | # Install Telemetry services (mdb nodes) |
| 45 | - description: Install redis service |
| 46 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:cluster:role:master' state.sls redis && |
| 47 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:server' state.sls redis |
| 48 | node_name: {{ HOSTNAME_CFG01 }} |
| 49 | retry: {count: 1, delay: 5} |
| 50 | skip_fail: false |
| 51 | |
| 52 | - description: Install gnocchi server |
| 53 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server and *01*' state.sls gnocchi.server && |
| 54 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server' state.sls gnocchi.server |
| 55 | node_name: {{ HOSTNAME_CFG01 }} |
| 56 | retry: {count: 1, delay: 5} |
| 57 | skip_fail: false |
| 58 | |
Dennis Dmitriev | 85145a6 | 2018-08-03 19:22:08 +0300 | [diff] [blame] | 59 | - description: Setup gnocchi client |
| 60 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client and *01*' state.sls gnocchi.client && |
| 61 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client' state.sls gnocchi.client |
| 62 | node_name: {{ HOSTNAME_CFG01 }} |
| 63 | retry: {count: 1, delay: 5} |
| 64 | skip_fail: false |
| 65 | |
Tatyana Leontovich | 5fb5ea5 | 2018-07-27 19:35:36 +0300 | [diff] [blame] | 66 | - description: Install panko server |
| 67 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server and *01*' state.sls panko && |
| 68 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server' state.sls panko |
| 69 | node_name: {{ HOSTNAME_CFG01 }} |
| 70 | retry: {count: 1, delay: 5} |
| 71 | skip_fail: false |
| 72 | |
| 73 | - description: Install ceilometer server on first node |
| 74 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server and *01*' state.sls ceilometer |
| 75 | node_name: {{ HOSTNAME_CFG01 }} |
| 76 | retry: {count: 2, delay: 5} |
| 77 | skip_fail: false |
| 78 | |
| 79 | - description: Install ceilometer server on other nodes |
| 80 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server' state.sls ceilometer |
| 81 | node_name: {{ HOSTNAME_CFG01 }} |
| 82 | retry: {count: 2, delay: 5} |
| 83 | skip_fail: false |
| 84 | |
| 85 | - description: Install aodh server |
| 86 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server and *01*' state.sls aodh && |
| 87 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server' state.sls aodh |
| 88 | node_name: {{ HOSTNAME_CFG01 }} |
| 89 | retry: {count: 1, delay: 5} |
| 90 | skip_fail: false |
Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 91 | |
| 92 | - description: Deploy horizon dashboard |
| 93 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 94 | -C 'I@horizon:server' state.sls horizon |
| 95 | node_name: {{ HOSTNAME_CFG01 }} |
| 96 | retry: {count: 1, delay: 5} |
| 97 | skip_fail: true |
| 98 | |
| 99 | - description: Deploy nginx proxy |
| 100 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 101 | -C 'I@nginx:server' state.sls nginx |
| 102 | node_name: {{ HOSTNAME_CFG01 }} |
| 103 | retry: {count: 1, delay: 5} |
| 104 | skip_fail: true |
| 105 | |
| 106 | |
| 107 | # Install compute node |
| 108 | |
| 109 | - description: Apply formulas for compute node |
| 110 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 111 | node_name: {{ HOSTNAME_CFG01 }} |
| 112 | retry: {count: 1, delay: 5} |
| 113 | skip_fail: true |
| 114 | |
| 115 | - description: Re-apply(as in doc) formulas for compute node |
| 116 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 117 | node_name: {{ HOSTNAME_CFG01 }} |
| 118 | retry: {count: 1, delay: 5} |
| 119 | skip_fail: false |
| 120 | |
| 121 | - description: Check IP on computes |
| 122 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 123 | 'ip a' |
| 124 | node_name: {{ HOSTNAME_CFG01 }} |
| 125 | retry: {count: 10, delay: 30} |
| 126 | skip_fail: false |
| 127 | |
Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 128 | # Upload cirros image |
Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 129 | - description: Upload cirros image on ctl01 |
| 130 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 131 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| 132 | node_name: {{ HOSTNAME_CFG01 }} |
| 133 | retry: {count: 2, delay: 30} |
| 134 | skip_fail: false |
| 135 | |
| 136 | - description: Create net04_external |
| 137 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 138 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 139 | node_name: {{ HOSTNAME_CFG01 }} |
| 140 | retry: {count: 1, delay: 30} |
| 141 | skip_fail: false |
| 142 | |
| 143 | - description: Create subnet_external |
| 144 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 145 | '. /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' |
| 146 | node_name: {{ HOSTNAME_CFG01 }} |
| 147 | retry: {count: 1, delay: 30} |
| 148 | skip_fail: false |
| 149 | |
| 150 | - description: Create net04 |
| 151 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 152 | '. /root/keystonercv3; neutron net-create net04' |
| 153 | node_name: {{ HOSTNAME_CFG01 }} |
| 154 | retry: {count: 1, delay: 30} |
| 155 | skip_fail: false |
| 156 | |
| 157 | - description: Create subnet_net04 |
| 158 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 159 | '. /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' |
| 160 | node_name: {{ HOSTNAME_CFG01 }} |
| 161 | retry: {count: 1, delay: 30} |
| 162 | skip_fail: false |
| 163 | |
| 164 | - description: Create router |
| 165 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 166 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 167 | node_name: {{ HOSTNAME_CFG01 }} |
| 168 | retry: {count: 1, delay: 30} |
| 169 | skip_fail: false |
| 170 | |
| 171 | - description: Set geteway |
| 172 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 173 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 174 | node_name: {{ HOSTNAME_CFG01 }} |
| 175 | retry: {count: 1, delay: 30} |
| 176 | skip_fail: false |
| 177 | |
| 178 | - description: Add interface |
| 179 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 180 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 181 | node_name: {{ HOSTNAME_CFG01 }} |
| 182 | retry: {count: 1, delay: 30} |
| 183 | skip_fail: false |
| 184 | |
| 185 | - description: sync time |
| 186 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 187 | 'service ntp stop; ntpd -gq; service ntp start' |
| 188 | node_name: {{ HOSTNAME_CFG01 }} |
| 189 | retry: {count: 1, delay: 30} |
| 190 | skip_fail: false |
| 191 | |
| 192 | - description: Enable local docker repo |
| 193 | cmd: | |
| 194 | set -e; |
| 195 | echo "{{ DOCKER_LOCAL_REPO }}" > /etc/apt/sources.list.d/mcp_docker.list; |
| 196 | apt-get clean; apt-get update; |
| 197 | node_name: {{ HOSTNAME_GTW01 }} |
| 198 | retry: {count: 1, delay: 30} |
| 199 | skip_fail: false |
| 200 | |
| 201 | - description: Install docker-ce on gtw |
| 202 | cmd: salt-call cmd.run 'apt-get install docker-ce -y' |
| 203 | node_name: {{ HOSTNAME_GTW01 }} |
| 204 | retry: {count: 1, delay: 30} |
| 205 | skip_fail: false |
| 206 | |
| 207 | - description: Enable forward policy on gtw |
| 208 | cmd: | |
| 209 | set -e; |
| 210 | iptables --policy FORWARD ACCEPT; |
| 211 | node_name: {{ HOSTNAME_GTW01 }} |
| 212 | retry: {count: 1, delay: 30} |
| 213 | skip_fail: false |
| 214 | |
| 215 | - description: create rc file on cfg |
| 216 | cmd: scp ctl01:/root/keystonercv3 /root |
| 217 | node_name: {{ HOSTNAME_CFG01 }} |
| 218 | retry: {count: 1, delay: 30} |
| 219 | skip_fail: false |
| 220 | |
| 221 | - description: Copy rc file |
| 222 | cmd: scp /root/keystonercv3 gtw01:/root |
| 223 | node_name: {{ HOSTNAME_CFG01 }} |
| 224 | retry: {count: 1, delay: 30} |
| 225 | skip_fail: false |
Tatyana Leontovich | bb29d1d | 2018-06-19 13:23:04 +0300 | [diff] [blame] | 226 | |
Tatyana Leontovich | e1d1619 | 2018-07-18 15:07:51 +0300 | [diff] [blame] | 227 | {{ BACKUP.MACRO_WR_NGINX_MASTER() }} |
Tatyana Leontovich | bb29d1d | 2018-06-19 13:23:04 +0300 | [diff] [blame] | 228 | {{ BACKUP.MACRO_BACKUP_BACKUPNINJA() }} |
sgudz | 62df2fc | 2018-10-09 12:26:19 +0300 | [diff] [blame] | 229 | {{ BACKUP.MACRO_BACKUP_XTRABACKUP() }} |