blob: bcbcad0ac4661151adf165dd25a4776d1fd67c93 [file] [log] [blame]
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +02001{% from 'virtual-mcp-pike-ovs-ceph/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
Tatyana Leontovich56005da2017-12-11 13:16:51 +02003
4# Install ceph mons
5- description: Update grains
6 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
7 -C 'I@ceph:common' state.sls salt.minion.grains
8 node_name: {{ HOSTNAME_CFG01 }}
9 retry: {count: 1, delay: 10}
10 skip_fail: false
11
12- description: Generate keyrings
13 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
14 -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' state.sls ceph.mon
15 node_name: {{ HOSTNAME_CFG01 }}
16 retry: {count: 1, delay: 10}
17 skip_fail: false
18
19- description: Sync grains on ceph mon nodes
20 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
21 -C 'I@ceph:mon' saltutil.sync_grains
22 node_name: {{ HOSTNAME_CFG01 }}
23 retry: {count: 1, delay: 10}
24 skip_fail: false
25
26- description: Update mine on ceph mons
27 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
28 -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' mine.update
29 node_name: {{ HOSTNAME_CFG01 }}
30 retry: {count: 1, delay: 10}
31 skip_fail: false
32
33- description: Install ceph mon
34 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
35 -C 'I@ceph:mon' state.sls ceph.mon
36 node_name: {{ HOSTNAME_CFG01 }}
37 retry: {count: 1, delay: 5}
38 skip_fail: false
39
40- description: Install ceph mgr if defined(needed only for Luminious)
41 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +020042 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then
43 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' state.sls ceph.mgr
Tatyana Leontovich56005da2017-12-11 13:16:51 +020044 fi
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 2, delay: 5}
47 skip_fail: false
48
49- description: Install ceph osd
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
51 -C 'I@ceph:osd' state.sls ceph.osd
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 1, delay: 5}
54 skip_fail: false
55
56- description: Sync grains
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
58 -C 'I@ceph:osd' saltutil.sync_grains
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 5}
61 skip_fail: false
62
63- description: Install ceph osd nodes
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
65 -C 'I@ceph:osd' state.sls ceph.osd.custom
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: true
69
70- description: Sync grains
71 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
72 -C 'I@ceph:osd' saltutil.sync_grains
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 1, delay: 5}
75 skip_fail: false
76
77- description: Update mine on ceph osd
78 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
79 -C 'I@ceph:osd' mine.update
80 node_name: {{ HOSTNAME_CFG01 }}
81 retry: {count: 1, delay: 10}
82 skip_fail: false
83
84- description: Setup pools, keyrings and maybe crush
85 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
86 -C 'I@ceph:setup' state.sls ceph.setup
87 node_name: {{ HOSTNAME_CFG01 }}
88 retry: {count: 1, delay: 10}
89 skip_fail: false
90
91- description: Install ceph clinet
92 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
93 -C 'I@ceph:setup' state.sls ceph.setup
94 node_name: {{ HOSTNAME_CFG01 }}
95 retry: {count: 1, delay: 10}
96 skip_fail: false
97
98- description: Install radosgw if exists
99 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200100 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' match.pillar 'ceph:radosgw' ; then
101 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains;
102 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw;
103 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keystone:client' state.sls keystone.client;
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +0200104 fi
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 2, delay: 5}
107 skip_fail: false
108
109- description: Install ceph clinet
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@ceph:setup' state.sls ceph.setup
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 10}
114 skip_fail: false
115
Dennis Dmitriev5bcbdc52018-03-23 18:05:10 +0200116{%- for ssh in config.underlay.ssh %}
117 {%- set salt_roles = [] %}
118 {%- for role in ssh['roles'] %}
119 {%- if role in config.salt_deploy.salt_roles %}
120 {%- set _ = salt_roles.append(role) %}
121 {%- endif %}
122 {%- endfor %}
123
124 {%- if salt_roles %}
Tatyana Leontovich3fc6a092018-01-23 13:41:49 +0200125- description: Restart salt-minion as workaround of PROD-16970
126 cmd: |
127 service salt-minion restart; # For case if salt-minion was already installed
128 node_name: {{ ssh['node_name'] }}
129 retry: {count: 1, delay: 1}
130 skip_fail: false
Dennis Dmitriev5bcbdc52018-03-23 18:05:10 +0200131 {%- endif %}
132{%- endfor %}
Tatyana Leontovich3fc6a092018-01-23 13:41:49 +0200133
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200134- description: Connect ceph to glance
135 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200136 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' state.sls ceph.common,ceph.setup.keyring,glance;
137 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-api;
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200138 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-registry;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200139 node_name: {{ HOSTNAME_CFG01 }}
140 retry: {count: 2, delay: 5}
141 skip_fail: false
142
143- description: Connect ceph to cinder and nova
144 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200145 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@cinder:controller' state.sls ceph.common,ceph.setup.keyring,cinder;
146 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring;
147 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains;
148 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls nova;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200149 node_name: {{ HOSTNAME_CFG01 }}
150 retry: {count: 2, delay: 5}
151 skip_fail: false
152
153- description: Restart cinder volume
154 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200155 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' service.restart cinder-volume;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200156 node_name: {{ HOSTNAME_CFG01 }}
157 retry: {count: 2, delay: 5}
158 skip_fail: false
159
160- description: Restart nova-compute
161 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200162 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:compute' service.restart nova-compute;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 2, delay: 5}
165 skip_fail: false
166
167- description: conver cirros image
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
169 'qemu-img convert cirros-0.3.4-i386-disk.img cirros.raw'
170 node_name: {{ HOSTNAME_CFG01 }}
171 retry: {count: 2, delay: 30}
172 skip_fail: false
173
174- description: Register image in glance
175 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
176 '. /root/keystonercv3; glance --timeout 120 image-create --name "cirros" --disk-format raw --container-format bare --visibility public --file cirros.raw'
177 node_name: {{ HOSTNAME_CFG01 }}
178 retry: {count: 1, delay: 30}
sgudz8b6a8542018-03-19 18:13:51 +0200179 skip_fail: false