blob: ceffe3254e6f417c8c624c262f7b8538e93ee0e6 [file] [log] [blame]
Tatyana Leontovichc447b122018-02-22 12:30:42 +02001{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_GTW01 with context %}
Oleksii Butenkoc05c9f62018-04-19 19:00:02 +03006{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import LAB_CONFIG_NAME with context %}
7{% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import DOMAIN_NAME with context %}
Tatyana Leontovichc447b122018-02-22 12:30:42 +02008{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
9{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
Tatyana Leontovichc447b122018-02-22 12:30:42 +020010{% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %}
Oleksii Butenkoc05c9f62018-04-19 19:00:02 +030011
Dennis Dmitriev4034db02018-08-26 21:50:13 +030012{% import 'shared-salt.yaml' as SHARED with context %}
13{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
Tatyana Leontovichc447b122018-02-22 12:30:42 +020014
15# Install OpenStack control services
16
17{%- if OVERRIDE_POLICY != '' %}
18- description: Upload policy override
19 upload:
20 local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
21 local_filename: overrides-policy.yml
22 remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/
23 node_name: {{ HOSTNAME_CFG01 }}
24
25- description: Create custom cluster control class
26 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
27 node_name: {{ HOSTNAME_CFG01 }}
28
29- description: Rename control classes
30 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 &&
31 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 &&
32 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all &&
33 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
34 node_name: {{ HOSTNAME_CFG01 }}
35{%- endif %}
36
37- description: Nginx
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
39 -C 'I@nginx:server' state.sls salt.minion
40 node_name: {{ HOSTNAME_CFG01 }}
41 retry: {count: 1, delay: 5}
42 skip_fail: true
43
44- description: Deploy nginx proxy
45 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
46 -C 'I@nginx:server' state.sls nginx
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: true
50
Dennis Dmitriev4034db02018-08-26 21:50:13 +030051{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }}
Tatyana Leontovichc447b122018-02-22 12:30:42 +020052
Dennis Dmitriev4034db02018-08-26 21:50:13 +030053{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
Tatyana Leontovichc447b122018-02-22 12:30:42 +020054
Dennis Dmitriev4034db02018-08-26 21:50:13 +030055{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
Tatyana Leontovichc447b122018-02-22 12:30:42 +020056
Dennis Dmitriev4034db02018-08-26 21:50:13 +030057{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
Tatyana Leontovichc447b122018-02-22 12:30:42 +020058
Dennis Dmitriev4034db02018-08-26 21:50:13 +030059{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
Tatyana Leontovichc447b122018-02-22 12:30:42 +020060
61# isntall designate
62- description: Install powerdns
63 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
64 -C 'I@powerdns:server' state.sls powerdns.server
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
69- description: Install designate
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
71 -C 'I@designate:server' state.sls designate -b 1
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 5, delay: 10}
74 skip_fail: false
75
Dennis Dmitriev4034db02018-08-26 21:50:13 +030076{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
Tatyana Leontovichc447b122018-02-22 12:30:42 +020077
78- description: Deploy horizon dashboard
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
80 -C 'I@horizon:server' state.sls horizon
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 1, delay: 5}
83 skip_fail: true
84
85# Install compute node
86
87- description: Apply formulas for compute node
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
89 node_name: {{ HOSTNAME_CFG01 }}
90 retry: {count: 1, delay: 5}
91 skip_fail: true
92
93- description: Re-apply(as in doc) formulas for compute node
94 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
95 node_name: {{ HOSTNAME_CFG01 }}
96 retry: {count: 1, delay: 5}
97 skip_fail: false
98
99- description: Check IP on computes
100 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
101 'ip a'
102 node_name: {{ HOSTNAME_CFG01 }}
103 retry: {count: 10, delay: 30}
104 skip_fail: false
105
Tatyanka Leontovichcc4568c2018-09-26 10:47:16 +0000106- description: Create net04_external
107 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
108 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 30}
111 skip_fail: false
112
113- description: Create subnet_external
114 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
115 '. /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'
116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 1, delay: 30}
118 skip_fail: false
119
120- description: Create net04
121 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
122 '. /root/keystonercv3; neutron net-create net04'
123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 30}
125 skip_fail: false
126
127- description: Create subnet_net04
128 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
129 '. /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'
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 30}
132 skip_fail: false
133
134- description: Create router
135 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
136 '. /root/keystonercv3; neutron router-create net04_router01'
137 node_name: {{ HOSTNAME_CFG01 }}
138 retry: {count: 1, delay: 30}
139 skip_fail: false
140
141- description: Set geteway
142 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
143 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
144 node_name: {{ HOSTNAME_CFG01 }}
145 retry: {count: 1, delay: 30}
146 skip_fail: false
147
148- description: Add interface
149 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
150 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
151 node_name: {{ HOSTNAME_CFG01 }}
152 retry: {count: 1, delay: 30}
153 skip_fail: false
154
155- description: sync time
156 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
157 'service ntp stop; ntpd -gq; service ntp start'
158 node_name: {{ HOSTNAME_CFG01 }}
159 retry: {count: 1, delay: 30}
160 skip_fail: false
161
sgudz3fd44542018-04-02 11:45:49 +0300162- description: Install manila-api on first node
163 cmd: |
164 salt -C 'I@manila:api and *01*' state.sls manila.api;
165 node_name: {{ HOSTNAME_CFG01 }}
166 retry: {count: 1, delay: 5}
167 skip_fail: false
168
169- description: Install manila-api on other nodes
170 cmd: |
171 salt -C 'I@manila:api and not *01*' state.sls manila.api;
172 node_name: {{ HOSTNAME_CFG01 }}
173 retry: {count: 1, delay: 5}
174 skip_fail: false
175
176- description: Install manila-scheduler
177 cmd: |
178 salt -C 'I@manila:scheduler' state.sls manila.scheduler;
179 node_name: {{ HOSTNAME_CFG01 }}
180 retry: {count: 1, delay: 5}
181 skip_fail: false
182
183- description: Install manila-share
184 cmd: |
185 salt -C 'I@manila:share' state.sls manila.share;
186 node_name: {{ HOSTNAME_CFG01 }}
187 retry: {count: 1, delay: 5}
188 skip_fail: false
189
Tatyana Leontovich3cc1c132018-04-03 00:41:17 +0300190- description: WR https://mirantis.jira.com/browse/PROD-19012
191 cmd: |
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300192 salt 'ctl*' cmd.run 'systemctl restart apache2'
Tatyana Leontovich3cc1c132018-04-03 00:41:17 +0300193 node_name: {{ HOSTNAME_CFG01 }}
194 retry: {count: 1, delay: 5}
195 skip_fail: false
196
sgudz3fd44542018-04-02 11:45:49 +0300197- description: Check manila-services
198 cmd: |
199 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list'
200 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300201 retry: {count: 3, delay: 15}
sgudz3fd44542018-04-02 11:45:49 +0300202 skip_fail: false
203
Maksym Shalamovae15a772018-07-20 13:13:29 +0300204- description: Create manila type
205 cmd: |
206 salt 'cfg01*' state.sls manila.client
207 node_name: {{ HOSTNAME_CFG01 }}
208 retry: {count: 1, delay: 5}
209 skip_fail: false
210
sgudz3fd44542018-04-02 11:45:49 +0300211- description: Create CIFS and NFS share and check it status
212 cmd: |
213 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default';
214 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default';
215 sleep 5;
216 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list';
217 node_name: {{ HOSTNAME_CFG01 }}
Oleksii Butenkoa561a8a2018-05-08 15:12:26 +0300218 retry: {count: 3, delay: 5}
sgudz3fd44542018-04-02 11:45:49 +0300219 skip_fail: false
Oleksii Butenko5cd0a162018-06-14 18:18:10 +0300220
Tatyanka Leontovichcc4568c2018-09-26 10:47:16 +0000221{{ SHARED.INSTALL_DOCKER_ON_GTW() }}
222