blob: 383331551021da99bd25c1d4795bfc9a2b723e50 [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
ibumarskov34d75d32018-09-11 13:18:10 +040054- description: Restart libvirtd on compute nodes (PROD-23034)
55 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' service.restart libvirtd
56 node_name: {{ HOSTNAME_CFG01 }}
57 retry: {count: 1, delay: 5}
58 skip_fail: false
59
ibumarskov712a6872018-04-25 09:22:15 +040060- description: Check IP on computes
61 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
62 'ip a'
63 node_name: {{ HOSTNAME_CFG01 }}
64 retry: {count: 10, delay: 30}
65 skip_fail: false
66
ibumarskov1b85e892018-08-30 11:54:47 +040067# Upload cirros image
ibumarskov712a6872018-04-25 09:22:15 +040068
69- description: Upload cirros image on ctl01
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
71 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 2, delay: 30}
74 skip_fail: false
75
76- description: Register image in glance
77 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
78 '. /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'
79 node_name: {{ HOSTNAME_CFG01 }}
80 retry: {count: 1, delay: 30}
81 skip_fail: false
82
83- description: Create net04_external
84 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
85 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 30}
88 skip_fail: false
89
90- description: Create subnet_external
91 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
92 '. /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'
93 node_name: {{ HOSTNAME_CFG01 }}
94 retry: {count: 1, delay: 30}
95 skip_fail: false
96
97- description: Create net04
98 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
99 '. /root/keystonercv3; neutron net-create net04'
100 node_name: {{ HOSTNAME_CFG01 }}
101 retry: {count: 1, delay: 30}
102 skip_fail: false
103
104- description: Create subnet_net04
105 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
106 '. /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'
107 node_name: {{ HOSTNAME_CFG01 }}
108 retry: {count: 1, delay: 30}
109 skip_fail: false
110
111- description: Create router
112 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
113 '. /root/keystonercv3; neutron router-create net04_router01'
114 node_name: {{ HOSTNAME_CFG01 }}
115 retry: {count: 1, delay: 30}
116 skip_fail: false
117
118- description: Set geteway
119 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
120 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
121 node_name: {{ HOSTNAME_CFG01 }}
122 retry: {count: 1, delay: 30}
123 skip_fail: false
124
125- description: Add interface
126 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
127 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 30}
130 skip_fail: false
131
132#- description: Allow all tcp
133# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
134# '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
135# node_name: {{ HOSTNAME_CFG01 }}
136# retry: {count: 1, delay: 30}
137# skip_fail: false
138#
139#- description: Allow all icmp
140# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
141# '. /root/keystonercv3; openstack security group rule create --proto icmp default'
142# node_name: {{ HOSTNAME_CFG01 }}
143# retry: {count: 1, delay: 30}
144# skip_fail: false
145
146- description: sync time
147 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
148 'service ntp stop; ntpd -gq; service ntp start'
149 node_name: {{ HOSTNAME_CFG01 }}
150 retry: {count: 1, delay: 30}
151 skip_fail: true
152
153- description: Install docker.io on gtw
154 cmd: salt-call cmd.run 'apt-get install docker.io -y'
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 1, delay: 30}
157 skip_fail: false
158
159- description: Enable forward policy on gtw
160 cmd: |
161 set -e;
162 iptables --policy FORWARD ACCEPT;
163 node_name: {{ HOSTNAME_GTW01 }}
164 retry: {count: 1, delay: 30}
165 skip_fail: false
166
167- description: create rc file on cfg
168 cmd: scp ctl01:/root/keystonercv3 /root
169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 1, delay: 30}
171 skip_fail: false
172
173- description: Copy rc file
174 cmd: scp /root/keystonercv3 gtw01:/root
175 node_name: {{ HOSTNAME_CFG01 }}
176 retry: {count: 1, delay: 30}
177 skip_fail: false