blob: 50bad03cc469d2a77f0ec43048f6f263d56f343c [file] [log] [blame]
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03001{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
Tatyana Leontovich47dbd3a2017-06-22 17:36:53 +03002{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
Tatyana Leontovichac38bac2017-07-17 14:05:33 +03005{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %}
Sergii Golovatiuk50f91892017-08-04 18:11:06 +02006{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
7{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +03008
ibumarskov942417e2018-08-23 22:05:59 +04009{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
10
ibumarskov7bdc7ed2018-08-24 12:06:38 +040011# Deploy nginx before openstack services (PROD-22740)
12- description: Deploy nginx proxy
13 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
14 -C 'I@nginx:server' state.sls nginx
15 node_name: {{ HOSTNAME_CFG01 }}
16 retry: {count: 1, delay: 5}
17 skip_fail: true
18
sgudz62df2fc2018-10-09 12:26:19 +030019{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030020
ibumarskov7e886672018-08-23 13:52:13 +040021{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
ibumarskove23c10e2018-08-20 15:47:58 +040022
ibumarskov7e886672018-08-23 13:52:13 +040023{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030024
ibumarskov7e886672018-08-23 13:52:13 +040025{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030026
ibumarskov7e886672018-08-23 13:52:13 +040027{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
Tatyana Leontovichfa7ae4d2017-04-25 13:46:14 +030028
ibumarskov7e886672018-08-23 13:52:13 +040029{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
Tatyana Leontovichfa7ae4d2017-04-25 13:46:14 +030030
ibumarskov7e886672018-08-23 13:52:13 +040031# install designate backend
Tatyana Leontovich85e822a2017-06-15 11:52:01 +030032- description: Install bind
33 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich033aac02017-06-15 15:01:21 +030034 -C 'I@bind:server' state.sls bind
Tatyana Leontovich85e822a2017-06-15 11:52:01 +030035 node_name: {{ HOSTNAME_CFG01 }}
36 retry: {count: 1, delay: 5}
37 skip_fail: false
38
ibumarskov7e886672018-08-23 13:52:13 +040039{{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030040
ibumarskov7e886672018-08-23 13:52:13 +040041{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030042
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030043# Install compute node
44
45- description: Apply formulas for compute node
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: true
50
51- description: Re-apply(as in doc) formulas for compute node
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +020055 skip_fail: false
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030056
57- description: Check IP on computes
58 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
59 'ip a'
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 10, delay: 30}
62 skip_fail: false
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +030063
64
65 # Upload cirros image
66
67- description: Upload cirros image on ctl01
68 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +040069 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +030070 node_name: {{ HOSTNAME_CFG01 }}
71 retry: {count: 2, delay: 30}
72 skip_fail: false
73
74- description: Register image in glance
75 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +040076 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +030077 node_name: {{ HOSTNAME_CFG01 }}
78 retry: {count: 1, delay: 30}
79 skip_fail: false
80
81- description: Create net04_external
82 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Tatyana Leontovich674abf82017-07-20 15:44:15 +030083 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +030084 node_name: {{ HOSTNAME_CFG01 }}
85 retry: {count: 1, delay: 30}
86 skip_fail: false
87
88- description: Create subnet_external
89 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
90 '. /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'
91 node_name: {{ HOSTNAME_CFG01 }}
92 retry: {count: 1, delay: 30}
93 skip_fail: false
94
95- description: Create net04
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
97 '. /root/keystonercv3; neutron net-create net04'
98 node_name: {{ HOSTNAME_CFG01 }}
99 retry: {count: 1, delay: 30}
100 skip_fail: false
101
102- description: Create subnet_net04
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
104 '. /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'
105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 1, delay: 30}
107 skip_fail: false
108
109- description: Create router
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
111 '. /root/keystonercv3; neutron router-create net04_router01'
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 30}
114 skip_fail: false
115
ibumarskovc075df82018-07-30 13:23:07 +0400116- description: Set gateway
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300117 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
118 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
119 node_name: {{ HOSTNAME_CFG01 }}
120 retry: {count: 1, delay: 30}
121 skip_fail: false
122
123- description: Add interface
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
125 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 1, delay: 30}
128 skip_fail: false
129
130- description: Allow all tcp
131 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
132 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
133 node_name: {{ HOSTNAME_CFG01 }}
134 retry: {count: 1, delay: 30}
135 skip_fail: false
136
137- description: Allow all icmp
138 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
139 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
140 node_name: {{ HOSTNAME_CFG01 }}
141 retry: {count: 1, delay: 30}
142 skip_fail: false
143
Tatyana Leontovich07bc6ed2017-07-25 13:26:48 +0300144- description: sync time
145 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
146 'service ntp stop; ntpd -gq; service ntp start'
147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 30}
149 skip_fail: false
150
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300151- description: Install docker.io on gtw
152 cmd: salt-call cmd.run 'apt-get install docker.io -y'
153 node_name: {{ HOSTNAME_GTW01 }}
154 retry: {count: 1, delay: 30}
155 skip_fail: false
156
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200157- description: Enable forward policy
158 cmd: iptables --policy FORWARD ACCEPT
159 node_name: {{ HOSTNAME_GTW01 }}
160 retry: {count: 1, delay: 30}
161 skip_fail: false
162
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300163- description: create rc file on cfg
164 cmd: scp ctl01:/root/keystonercv3 /root
165 node_name: {{ HOSTNAME_CFG01 }}
166 retry: {count: 1, delay: 30}
167 skip_fail: false
168
169- description: Copy rc file
170 cmd: scp /root/keystonercv3 gtw01:/root
171 node_name: {{ HOSTNAME_CFG01 }}
172 retry: {count: 1, delay: 30}
173 skip_fail: false