blob: ab13cb214c50921e27e51aab5d30b5cc75d05cbb [file] [log] [blame]
Oleksii Butenko7c2c55b2018-09-20 15:22:13 +03001{# Collection of common macroses shared across ceph and radosgw #}
Oleksii Butenkoba680de2018-08-23 14:15:19 +03002
Oleksii Butenko7c2c55b2018-09-20 15:22:13 +03003{%- macro MACRO_INSTALL_CEPH_MONS() %}
4
Oleksii Butenkoba680de2018-08-23 14:15:19 +03005- 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
Oleksii Butenko7c2c55b2018-09-20 15:22:13 +030039{%- endmacro %}
40
41{%- macro MACRO_INSTALL_CEPH_MGR() %}
Oleksii Butenkoba680de2018-08-23 14:15:19 +030042
43- description: Install ceph mgr if defined(needed only for Luminious)
44 cmd: |
45 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then
46 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' state.sls ceph.mgr
47 fi
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 2, delay: 5}
50 skip_fail: false
Oleksii Butenko7c2c55b2018-09-20 15:22:13 +030051{%- endmacro %}
52
53{%- macro MACRO_INSTALL_CEPH_OSD_AND_RADOSGW() %}
Oleksii Butenkoba680de2018-08-23 14:15:19 +030054
55- description: Install ceph osd
56 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
57 -C 'I@ceph:osd' state.sls ceph.osd
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 5}
60 skip_fail: false
61
62- description: Sync grains
63 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
64 -C 'I@ceph:osd' saltutil.sync_grains
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
69- description: Install ceph osd nodes
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
71 -C 'I@ceph:osd' state.sls ceph.osd.custom
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 1, delay: 5}
74 skip_fail: true
75
76- description: Sync grains
77 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
78 -C 'I@ceph:osd' saltutil.sync_grains
79 node_name: {{ HOSTNAME_CFG01 }}
80 retry: {count: 1, delay: 5}
81 skip_fail: false
82
83- description: Update mine on ceph osd
84 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
85 -C 'I@ceph:osd' mine.update
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 10}
88 skip_fail: false
89
90- description: Setup pools, keyrings and maybe crush
91 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
92 -C 'I@ceph:setup' state.sls ceph.setup
93 node_name: {{ HOSTNAME_CFG01 }}
94 retry: {count: 1, delay: 10}
95 skip_fail: false
96
97- description: Install ceph clinet
98 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
99 -C 'I@ceph:setup' state.sls ceph.setup
100 node_name: {{ HOSTNAME_CFG01 }}
101 retry: {count: 1, delay: 10}
102 skip_fail: false
103
104- description: Install radosgw if exists
105 cmd: |
106 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains;
107 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw;
Oleksii Butenkoba680de2018-08-23 14:15:19 +0300108 node_name: {{ HOSTNAME_CFG01 }}
109 retry: {count: 2, delay: 5}
110 skip_fail: false
Oleksii Butenko7c2c55b2018-09-20 15:22:13 +0300111{%- endmacro %}
Oleksii Butenkoba680de2018-08-23 14:15:19 +0300112
Oleksii Butenko7c2c55b2018-09-20 15:22:13 +0300113{%- macro CONNECT_CEPH_TO_SERVICES() %}
obutenko9d195be2018-11-08 18:14:57 +0200114- description: Setup keyring for glance
Oleksii Butenkoba680de2018-08-23 14:15:19 +0300115 cmd: |
Oleksii Butenko7c2c55b2018-09-20 15:22:13 +0300116 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' state.sls ceph.common,ceph.setup.keyring;
Oleksii Butenkoba680de2018-08-23 14:15:19 +0300117 node_name: {{ HOSTNAME_CFG01 }}
118 retry: {count: 2, delay: 5}
119 skip_fail: false
120
obutenko9d195be2018-11-08 18:14:57 +0200121- description: Setup keyring for cinder and nova
Oleksii Butenkoba680de2018-08-23 14:15:19 +0300122 cmd: |
Oleksii Butenko7c2c55b2018-09-20 15:22:13 +0300123 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@cinder:controller' state.sls ceph.common,ceph.setup.keyring;
Oleksii Butenkoba680de2018-08-23 14:15:19 +0300124 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring;
125 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains;
Oleksii Butenkoba680de2018-08-23 14:15:19 +0300126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 2, delay: 5}
128 skip_fail: false
obutenko9d195be2018-11-08 18:14:57 +0200129
130- description: Setup keyring for gnocchi
131 cmd: |
132 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@gnocchi:server' match.pillar 'ceph:common' ; then
133 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@gnocchi:server' state.sls ceph.common,ceph.setup.keyring
134 fi
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 1, delay: 5}
137 skip_fail: false
Oleksii Butenko7c2c55b2018-09-20 15:22:13 +0300138{%- endmacro %}