blob: 157992075839ecdd43775dfa8ccd4c37475f2800 [file] [log] [blame]
Anastasia Kuznetsova6823b062018-03-23 15:52:17 +04001{% from 'virtual-mcp-pike-ovs-l2gw-bgpvpn/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-pike-ovs-l2gw-bgpvpn/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-pike-ovs-l2gw-bgpvpn/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-pike-ovs-l2gw-bgpvpn/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-mcp-pike-ovs-l2gw-bgpvpn/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
Dennis Dmitriev4034db02018-08-26 21:50:13 +03009{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
10
Anastasia Kuznetsova6823b062018-03-23 15:52:17 +040011# Install OpenStack control services
12
sgudz62df2fc2018-10-09 12:26:19 +030013{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
Anastasia Kuznetsova6823b062018-03-23 15:52:17 +040014
Dennis Dmitriev4034db02018-08-26 21:50:13 +030015{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
Anastasia Kuznetsova6823b062018-03-23 15:52:17 +040016
Dennis Dmitriev4034db02018-08-26 21:50:13 +030017{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
Anastasia Kuznetsova6823b062018-03-23 15:52:17 +040018
Dennis Dmitriev4034db02018-08-26 21:50:13 +030019{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
Anastasia Kuznetsova6823b062018-03-23 15:52:17 +040020
Dennis Dmitriev4034db02018-08-26 21:50:13 +030021{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
Anastasia Kuznetsova6823b062018-03-23 15:52:17 +040022
23# Install OpenStack dashboard and proxy services
24- description: Deploy horizon dashboard
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@horizon:server' state.sls horizon
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 5}
29 skip_fail: true
30
31- description: Deploy nginx proxy
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
33 -C 'I@nginx:server' state.sls nginx
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 5}
36 skip_fail: true
37
38
39# Install compute node
40
41- description: Apply formulas for compute node
42 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
43 node_name: {{ HOSTNAME_CFG01 }}
44 retry: {count: 1, delay: 5}
45 skip_fail: true
46
47- description: Re-apply(as in doc) formulas for compute node
48 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
49 node_name: {{ HOSTNAME_CFG01 }}
50 retry: {count: 1, delay: 5}
51 skip_fail: false
52
53- description: Check IP on computes
54 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
55 'ip a'
56 node_name: {{ HOSTNAME_CFG01 }}
57 retry: {count: 10, delay: 30}
58 skip_fail: false
59
60
61 # Upload cirros image
62
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: false
146
147- description: Install docker.io on gtw
148 cmd: salt-call cmd.run 'apt-get install docker.io -y'
149 node_name: {{ HOSTNAME_GTW01 }}
150 retry: {count: 1, delay: 30}
151 skip_fail: false
152
153- description: create rc file on cfg
154 cmd: scp ctl01:/root/keystonercv3 /root
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 1, delay: 30}
157 skip_fail: false
158
159- description: Copy rc file
160 cmd: scp /root/keystonercv3 gtw01:/root
161 node_name: {{ HOSTNAME_CFG01 }}
162 retry: {count: 1, delay: 30}
163 skip_fail: false