blob: 0e542beb20bd699596c0066fa0c3ef1f26f5cbf5 [file] [log] [blame]
Pavel Glazov5dc63a92018-11-27 12:48:25 +04001{% from 'cookied-mcp-ocata-dvr-ceph/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-ocata-dvr-ceph/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'cookied-mcp-ocata-dvr-ceph/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'cookied-mcp-ocata-dvr-ceph/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'cookied-mcp-ocata-dvr-ceph/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 %}
8
9{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
10{% import 'shared-salt.yaml' as SHARED with context %}
11
12{% import 'shared-ceph.yaml' as SHARED_CEPH with context %}
13
14# Deploy nginx before openstack services (PROD-22740)
15- description: Deploy nginx proxy
16 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
17 -C 'I@nginx:server' state.sls nginx
18 node_name: {{ HOSTNAME_CFG01 }}
19 retry: {count: 1, delay: 5}
20 skip_fail: true
21
22{{ SHARED_CEPH.MACRO_INSTALL_CEPH_MONS() }}
23
24{{ SHARED_CEPH.MACRO_INSTALL_CEPH_MGR() }}
25
26{{ SHARED_CEPH.MACRO_INSTALL_CEPH_OSD_AND_RADOSGW() }}
27
28{{ SHARED_CEPH.CONNECT_CEPH_TO_SERVICES() }}
29
30{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
31
32{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
33
34{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
35
36{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
37
38{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
39
40{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
41
42# install designate backend
43- description: Install bind
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@bind:server' state.sls bind
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 1, delay: 5}
48 skip_fail: false
49
50{{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }}
51
52{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
53
54# Install compute node
55
56- description: Apply formulas for compute node
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 5}
60 skip_fail: true
61
62- description: Re-apply(as in doc) formulas for compute node
63 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
64 node_name: {{ HOSTNAME_CFG01 }}
65 retry: {count: 1, delay: 5}
66 skip_fail: false
67
68- description: Check IP on computes
69 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
70 'ip a'
71 node_name: {{ HOSTNAME_CFG01 }}
72 retry: {count: 10, delay: 30}
73 skip_fail: false
74
75
76 # Upload cirros image
77
78- description: Upload cirros image on ctl01
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
80 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 2, delay: 30}
83 skip_fail: false
84
85- description: Register image in glance
86 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
87 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2'
88 node_name: {{ HOSTNAME_CFG01 }}
89 retry: {count: 1, delay: 30}
90 skip_fail: false
91
92- description: Create net04_external
93 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
94 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
95 node_name: {{ HOSTNAME_CFG01 }}
96 retry: {count: 1, delay: 30}
97 skip_fail: false
98
99- description: Create subnet_external
100 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
101 '. /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'
102 node_name: {{ HOSTNAME_CFG01 }}
103 retry: {count: 1, delay: 30}
104 skip_fail: false
105
106- description: Create net04
107 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
108 '. /root/keystonercv3; neutron net-create net04'
109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 30}
111 skip_fail: false
112
113- description: Create subnet_net04
114 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
115 '. /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'
116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 1, delay: 30}
118 skip_fail: false
119
120- description: Create router
121 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
122 '. /root/keystonercv3; neutron router-create net04_router01'
123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 30}
125 skip_fail: false
126
127- description: Set gateway
128 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
129 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 30}
132 skip_fail: false
133
134- description: Add interface
135 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
136 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
137 node_name: {{ HOSTNAME_CFG01 }}
138 retry: {count: 1, delay: 30}
139 skip_fail: false
140
141- description: Allow all tcp
142 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
143 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
144 node_name: {{ HOSTNAME_CFG01 }}
145 retry: {count: 1, delay: 30}
146 skip_fail: false
147
148- description: Allow all icmp
149 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
150 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
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
162{{ SHARED.INSTALL_DOCKER_ON_GTW() }}
163
164- description: create rc file on cfg
165 cmd: scp ctl01:/root/keystonercv3 /root
166 node_name: {{ HOSTNAME_CFG01 }}
167 retry: {count: 1, delay: 30}
168 skip_fail: false
169
170- description: Copy rc file
171 cmd: scp /root/keystonercv3 gtw01:/root
172 node_name: {{ HOSTNAME_CFG01 }}
173 retry: {count: 1, delay: 30}
174 skip_fail: false