blob: 21ffdc3c4889b72dced8f8a306db2a1f49148ca0 [file] [log] [blame]
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +02001{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_GTW01 with context %}
Oleksii Butenko2e8e8ee2018-06-21 11:10:13 +03006{% from 'cookied-mcp-pike-dvr/underlay.yaml' import LAB_CONFIG_NAME with context %}
7{% from 'cookied-mcp-pike-dvr/underlay.yaml' import DOMAIN_NAME with context %}
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +02008{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
9{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
10{% set LAB_CONFIG_NAME = os_env('LAB_CONFIG_NAME') %}
11{% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %}
12
Oleksii Butenko5cd0a162018-06-14 18:18:10 +030013{% import 'shared-salt.yaml' as SHARED with context %}
Dennis Dmitriev4034db02018-08-26 21:50:13 +030014{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
Oleksii Butenko5cd0a162018-06-14 18:18:10 +030015
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020016# Install OpenStack control services
17
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
Dennis Dmitriev4034db02018-08-26 21:50:13 +030038{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }}
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020039
Dennis Dmitriev4034db02018-08-26 21:50:13 +030040{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020041
Dennis Dmitriev4034db02018-08-26 21:50:13 +030042{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020043
Dennis Dmitriev4034db02018-08-26 21:50:13 +030044{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020045
Dennis Dmitriev4034db02018-08-26 21:50:13 +030046{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020047
48# isntall designate
obutenko830e6f62018-07-03 16:37:13 +030049#- description: Install powerdns
50# cmd: salt --hard-crash --state-output=mixed --state-verbose=False
51# -C 'I@powerdns:server' state.sls powerdns.server
52# node_name: {{ HOSTNAME_CFG01 }}
53# retry: {count: 1, delay: 5}
54# skip_fail: false
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020055
obutenko830e6f62018-07-03 16:37:13 +030056#- 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
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020062
Dennis Dmitriev4034db02018-08-26 21:50:13 +030063{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +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}
92 skip_fail: false
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
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +0200101- description: Create net04_external
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
103 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 30}
106 skip_fail: false
107
108- description: Create subnet_external
109 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
110 '. /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'
111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 1, delay: 30}
113 skip_fail: false
114
115- description: Create net04
116 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
117 '. /root/keystonercv3; neutron net-create net04'
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 1, delay: 30}
120 skip_fail: false
121
122- description: Create subnet_net04
123 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
124 '. /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'
125 node_name: {{ HOSTNAME_CFG01 }}
126 retry: {count: 1, delay: 30}
127 skip_fail: false
128
129- description: Create router
130 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
131 '. /root/keystonercv3; neutron router-create net04_router01'
132 node_name: {{ HOSTNAME_CFG01 }}
133 retry: {count: 1, delay: 30}
134 skip_fail: false
135
136- description: Set geteway
137 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
138 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
139 node_name: {{ HOSTNAME_CFG01 }}
140 retry: {count: 1, delay: 30}
141 skip_fail: false
142
143- description: Add interface
144 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
145 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
146 node_name: {{ HOSTNAME_CFG01 }}
147 retry: {count: 1, delay: 30}
148 skip_fail: false
149
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +0200150- description: sync time
151 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
152 'service ntp stop; ntpd -gq; service ntp start'
153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 1, delay: 30}
155 skip_fail: false
156
Oleksii Butenko5cd0a162018-06-14 18:18:10 +0300157{{ SHARED.INSTALL_DOCKER_ON_GTW() }}