blob: 88f654338ab9304eae6b3cbccc50ac8b860d7f7b [file] [log] [blame]
ibumarskov712a6872018-04-25 09:22:15 +04001{% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-mcp-trusty/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# Install OpenStack control services
ibumarskov59867632018-05-21 17:03:24 +040010- description: Sync time
11 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -G 'oscodename:trusty' cmd.run "service ntp stop && ntpdate pool.ntp.org && service ntp start"
12 node_name: {{ HOSTNAME_CFG01 }}
13 retry: {count: 1, delay: 5}
14 skip_fail: false
ibumarskov712a6872018-04-25 09:22:15 +040015
ibumarskov1b85e892018-08-30 11:54:47 +040016{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
ibumarskove23c10e2018-08-20 15:47:58 +040017
ibumarskov1b85e892018-08-30 11:54:47 +040018# Deploy nginx before openstack services (PROD-22740)
ibumarskov712a6872018-04-25 09:22:15 +040019- description: Deploy nginx proxy
20 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
21 -C 'I@nginx:server' state.sls nginx
22 node_name: {{ HOSTNAME_CFG01 }}
23 retry: {count: 1, delay: 5}
24 skip_fail: true
25
ibumarskov1b85e892018-08-30 11:54:47 +040026{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }}
27
28{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
29
30{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
31
32{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
33
34{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
35
36{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
37
38{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
ibumarskov712a6872018-04-25 09:22:15 +040039
40# Install compute node
41
42- description: Apply formulas for compute node
43 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
44 node_name: {{ HOSTNAME_CFG01 }}
45 retry: {count: 1, delay: 5}
46 skip_fail: true
47
48- description: Re-apply(as in doc) formulas for compute node
49 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
50 node_name: {{ HOSTNAME_CFG01 }}
51 retry: {count: 1, delay: 5}
52 skip_fail: true
53
54- description: Check IP on computes
55 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
56 'ip a'
57 node_name: {{ HOSTNAME_CFG01 }}
58 retry: {count: 10, delay: 30}
59 skip_fail: false
60
ibumarskov1b85e892018-08-30 11:54:47 +040061# Upload cirros image
ibumarskov712a6872018-04-25 09:22:15 +040062
63- description: Upload cirros image on ctl01
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
65 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 2, delay: 30}
68 skip_fail: false
69
70- description: Register image in glance
71 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
72 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img'
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 1, delay: 30}
75 skip_fail: false
76
77- description: Create net04_external
78 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
79 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
80 node_name: {{ HOSTNAME_CFG01 }}
81 retry: {count: 1, delay: 30}
82 skip_fail: false
83
84- description: Create subnet_external
85 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
86 '. /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'
87 node_name: {{ HOSTNAME_CFG01 }}
88 retry: {count: 1, delay: 30}
89 skip_fail: false
90
91- description: Create net04
92 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
93 '. /root/keystonercv3; neutron net-create net04'
94 node_name: {{ HOSTNAME_CFG01 }}
95 retry: {count: 1, delay: 30}
96 skip_fail: false
97
98- description: Create subnet_net04
99 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
100 '. /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'
101 node_name: {{ HOSTNAME_CFG01 }}
102 retry: {count: 1, delay: 30}
103 skip_fail: false
104
105- description: Create router
106 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
107 '. /root/keystonercv3; neutron router-create net04_router01'
108 node_name: {{ HOSTNAME_CFG01 }}
109 retry: {count: 1, delay: 30}
110 skip_fail: false
111
112- description: Set geteway
113 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
114 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 1, delay: 30}
117 skip_fail: false
118
119- description: Add interface
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
121 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 30}
124 skip_fail: false
125
126#- description: Allow all tcp
127# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
128# '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
129# node_name: {{ HOSTNAME_CFG01 }}
130# retry: {count: 1, delay: 30}
131# skip_fail: false
132#
133#- description: Allow all icmp
134# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
135# '. /root/keystonercv3; openstack security group rule create --proto icmp default'
136# node_name: {{ HOSTNAME_CFG01 }}
137# retry: {count: 1, delay: 30}
138# skip_fail: false
139
140- description: sync time
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
142 'service ntp stop; ntpd -gq; service ntp start'
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 30}
145 skip_fail: true
146
147- description: Install docker.io on gtw
148 cmd: salt-call cmd.run 'apt-get install docker.io -y'
149 node_name: {{ HOSTNAME_CFG01 }}
150 retry: {count: 1, delay: 30}
151 skip_fail: false
152
153- description: Enable forward policy on gtw
154 cmd: |
155 set -e;
156 iptables --policy FORWARD ACCEPT;
157 node_name: {{ HOSTNAME_GTW01 }}
158 retry: {count: 1, delay: 30}
159 skip_fail: false
160
161- description: create rc file on cfg
162 cmd: scp ctl01:/root/keystonercv3 /root
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 1, delay: 30}
165 skip_fail: false
166
167- description: Copy rc file
168 cmd: scp /root/keystonercv3 gtw01:/root
169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 1, delay: 30}
171 skip_fail: false