blob: 05fe6eeaf619dd354b3f0ccde3993d7889394ec2 [file] [log] [blame]
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +02001{% 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 Butenkoc05c9f62018-04-19 19:00:02 +03006{% 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 Leontovich56005da2017-12-11 13:16:51 +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 Leontovichb0b68d92018-01-11 13:27:08 +020010{% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %}
Oleksii Butenkoc05c9f62018-04-19 19:00:02 +030011{% import 'shared-salt.yaml' as SHARED with context %}
Tatyana Leontovich4f613672018-06-12 21:41:19 +030012{% import 'shared-backup-restore.yaml' as BACKUP with context %}
Tatyana Leontovich56005da2017-12-11 13:16:51 +020013
Dennis Dmitriev4034db02018-08-26 21:50:13 +030014{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
15
Tatyana Leontovich56005da2017-12-11 13:16:51 +020016# Install OpenStack control services
17
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +020018{%- 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
sgudz62df2fc2018-10-09 12:26:19 +030038{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
Tatyana Leontovich56005da2017-12-11 13:16:51 +020039
Dennis Dmitriev4034db02018-08-26 21:50:13 +030040{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
Tatyana Leontovich56005da2017-12-11 13:16:51 +020041
Dennis Dmitriev4034db02018-08-26 21:50:13 +030042{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
Tatyana Leontovich56005da2017-12-11 13:16:51 +020043
Dennis Dmitriev4034db02018-08-26 21:50:13 +030044{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
Tatyana Leontovich56005da2017-12-11 13:16:51 +020045
Dennis Dmitriev4034db02018-08-26 21:50:13 +030046{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
Tatyana Leontovich56005da2017-12-11 13:16:51 +020047
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +020048# isntall designate
49- description: Install powerdns
Tatyana Leontovich56005da2017-12-11 13:16:51 +020050 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +020051 -C 'I@powerdns:server' state.sls powerdns.server
Tatyana Leontovich56005da2017-12-11 13:16:51 +020052 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 1, delay: 5}
54 skip_fail: false
55
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +020056- 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 Dmitriev4034db02018-08-26 21:50:13 +030063{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
Tatyana Leontovich56005da2017-12-11 13:16:51 +020064
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 Butenko9f2601c2018-02-08 15:13:21 +020092 skip_fail: false
Tatyana Leontovich56005da2017-12-11 13:16:51 +020093
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
sgudz3fd44542018-04-02 11:45:49 +0300101- 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 Leontovich3cc1c132018-04-03 00:41:17 +0300129- description: WR https://mirantis.jira.com/browse/PROD-19012
130 cmd: |
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300131 salt 'ctl*' cmd.run 'systemctl restart apache2'
Tatyana Leontovich3cc1c132018-04-03 00:41:17 +0300132 node_name: {{ HOSTNAME_CFG01 }}
133 retry: {count: 1, delay: 5}
134 skip_fail: false
135
sgudz3fd44542018-04-02 11:45:49 +0300136- description: Check manila-services
137 cmd: |
138 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list'
139 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovich1618a2a2018-04-03 10:19:25 +0300140 retry: {count: 3, delay: 15}
sgudz3fd44542018-04-02 11:45:49 +0300141 skip_fail: false
142
Maksym Shalamovae15a772018-07-20 13:13:29 +0300143- 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
sgudz3fd44542018-04-02 11:45:49 +0300150- 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 Butenkoc05c9f62018-04-19 19:00:02 +0300159
Tatyana Leontovich92063ef2018-07-04 14:28:09 +0300160{{ BACKUP.MACRO_WR_NGINX_MASTER() }}
Tatyana Leontovich4f613672018-06-12 21:41:19 +0300161{{ BACKUP.MACRO_BACKUP_BACKUPNINJA() }}
sgudz62df2fc2018-10-09 12:26:19 +0300162{{ BACKUP.MACRO_BACKUP_XTRABACKUP() }}