blob: dcc854e920175d86d521cba296da14b257a2213f [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
sgudz62df2fc2018-10-09 12:26:19 +030051{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
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
sgudz3fd44542018-04-02 11:45:49 +0300106- description: Install manila-api on first node
107 cmd: |
108 salt -C 'I@manila:api and *01*' state.sls manila.api;
109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 5}
111 skip_fail: false
112
113- description: Install manila-api on other nodes
114 cmd: |
115 salt -C 'I@manila:api and not *01*' state.sls manila.api;
116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 1, delay: 5}
118 skip_fail: false
119
120- description: Install manila-scheduler
121 cmd: |
122 salt -C 'I@manila:scheduler' state.sls manila.scheduler;
123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 5}
125 skip_fail: false
126
127- description: Install manila-share
128 cmd: |
129 salt -C 'I@manila:share' state.sls manila.share;
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 5}
132 skip_fail: false
133
Tatyana Leontovich3cc1c132018-04-03 00:41:17 +0300134- description: WR https://mirantis.jira.com/browse/PROD-19012
135 cmd: |
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300136 salt 'ctl*' cmd.run 'systemctl restart apache2'
Tatyana Leontovich3cc1c132018-04-03 00:41:17 +0300137 node_name: {{ HOSTNAME_CFG01 }}
138 retry: {count: 1, delay: 5}
139 skip_fail: false
140
sgudz3fd44542018-04-02 11:45:49 +0300141- description: Check manila-services
142 cmd: |
143 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list'
144 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300145 retry: {count: 3, delay: 15}
sgudz3fd44542018-04-02 11:45:49 +0300146 skip_fail: false
147
Maksym Shalamovae15a772018-07-20 13:13:29 +0300148- description: Create manila type
149 cmd: |
150 salt 'cfg01*' state.sls manila.client
151 node_name: {{ HOSTNAME_CFG01 }}
152 retry: {count: 1, delay: 5}
153 skip_fail: false
154
sgudz3fd44542018-04-02 11:45:49 +0300155- description: Create CIFS and NFS share and check it status
156 cmd: |
157 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default';
158 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default';
159 sleep 5;
160 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list';
161 node_name: {{ HOSTNAME_CFG01 }}
Oleksii Butenkoa561a8a2018-05-08 15:12:26 +0300162 retry: {count: 3, delay: 5}
sgudz3fd44542018-04-02 11:45:49 +0300163 skip_fail: false
Oleksii Butenko5cd0a162018-06-14 18:18:10 +0300164