Oleksii Butenko | 7c2c55b | 2018-09-20 15:22:13 +0300 | [diff] [blame] | 1 | {# Collection of common macroses shared across ceph and radosgw #} |
Oleksii Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 2 | |
Oleksii Butenko | 7c2c55b | 2018-09-20 15:22:13 +0300 | [diff] [blame] | 3 | {%- macro MACRO_INSTALL_CEPH_MONS() %} |
| 4 | |
Oleksii Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 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 |
Oleksii Butenko | 7c2c55b | 2018-09-20 15:22:13 +0300 | [diff] [blame] | 39 | {%- endmacro %} |
| 40 | |
| 41 | {%- macro MACRO_INSTALL_CEPH_MGR() %} |
Oleksii Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 42 | |
| 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 Butenko | 7c2c55b | 2018-09-20 15:22:13 +0300 | [diff] [blame] | 51 | {%- endmacro %} |
| 52 | |
| 53 | {%- macro MACRO_INSTALL_CEPH_OSD_AND_RADOSGW() %} |
Oleksii Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 54 | |
| 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 Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 108 | node_name: {{ HOSTNAME_CFG01 }} |
| 109 | retry: {count: 2, delay: 5} |
| 110 | skip_fail: false |
Oleksii Butenko | 7c2c55b | 2018-09-20 15:22:13 +0300 | [diff] [blame] | 111 | {%- endmacro %} |
Oleksii Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 112 | |
Oleksii Butenko | 7c2c55b | 2018-09-20 15:22:13 +0300 | [diff] [blame] | 113 | {%- macro CONNECT_CEPH_TO_SERVICES() %} |
obutenko | 9d195be | 2018-11-08 18:14:57 +0200 | [diff] [blame^] | 114 | - description: Setup keyring for glance |
Oleksii Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 115 | cmd: | |
Oleksii Butenko | 7c2c55b | 2018-09-20 15:22:13 +0300 | [diff] [blame] | 116 | 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 Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 117 | node_name: {{ HOSTNAME_CFG01 }} |
| 118 | retry: {count: 2, delay: 5} |
| 119 | skip_fail: false |
| 120 | |
obutenko | 9d195be | 2018-11-08 18:14:57 +0200 | [diff] [blame^] | 121 | - description: Setup keyring for cinder and nova |
Oleksii Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 122 | cmd: | |
Oleksii Butenko | 7c2c55b | 2018-09-20 15:22:13 +0300 | [diff] [blame] | 123 | 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 Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 124 | 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 Butenko | ba680de | 2018-08-23 14:15:19 +0300 | [diff] [blame] | 126 | node_name: {{ HOSTNAME_CFG01 }} |
| 127 | retry: {count: 2, delay: 5} |
| 128 | skip_fail: false |
obutenko | 9d195be | 2018-11-08 18:14:57 +0200 | [diff] [blame^] | 129 | |
| 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 Butenko | 7c2c55b | 2018-09-20 15:22:13 +0300 | [diff] [blame] | 138 | {%- endmacro %} |