Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 1 | {% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import HOSTNAME_CFG01 with context %} |
Tatyana Leontovich | 7a869a7 | 2018-04-20 17:20:00 +0300 | [diff] [blame] | 2 | {% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import HOSTNAME_GTW01 with context %} |
Oleksii Butenko | fa5f067 | 2018-04-20 14:43:14 +0300 | [diff] [blame] | 3 | {% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 4 | {% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import DOMAIN_NAME with context %} |
| 5 | {% import 'shared-salt.yaml' as SHARED with context %} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 6 | |
Tatyana Leontovich | 2675691 | 2018-06-06 20:11:05 +0300 | [diff] [blame] | 7 | {% import 'shared-backup-restore.yaml' as BACKUP with context %} |
| 8 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 9 | # Install ceph mons |
| 10 | - description: Update grains |
| 11 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 12 | -C 'I@ceph:common' state.sls salt.minion.grains |
| 13 | node_name: {{ HOSTNAME_CFG01 }} |
| 14 | retry: {count: 1, delay: 10} |
| 15 | skip_fail: false |
| 16 | |
| 17 | - description: Generate keyrings |
| 18 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 19 | -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' state.sls ceph.mon |
| 20 | node_name: {{ HOSTNAME_CFG01 }} |
| 21 | retry: {count: 1, delay: 10} |
| 22 | skip_fail: false |
| 23 | |
| 24 | - description: Sync grains on ceph mon nodes |
| 25 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 26 | -C 'I@ceph:mon' saltutil.sync_grains |
| 27 | node_name: {{ HOSTNAME_CFG01 }} |
| 28 | retry: {count: 1, delay: 10} |
| 29 | skip_fail: false |
| 30 | |
| 31 | - description: Update mine on ceph mons |
| 32 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 33 | -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' mine.update |
| 34 | node_name: {{ HOSTNAME_CFG01 }} |
| 35 | retry: {count: 1, delay: 10} |
| 36 | skip_fail: false |
| 37 | |
| 38 | - description: Install ceph mon |
| 39 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 40 | -C 'I@ceph:mon' state.sls ceph.mon |
| 41 | node_name: {{ HOSTNAME_CFG01 }} |
| 42 | retry: {count: 1, delay: 5} |
| 43 | skip_fail: false |
| 44 | |
| 45 | - description: Install ceph mgr if defined(needed only for Luminious) |
| 46 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 47 | if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then |
| 48 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' state.sls ceph.mgr |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 49 | fi |
| 50 | node_name: {{ HOSTNAME_CFG01 }} |
| 51 | retry: {count: 2, delay: 5} |
| 52 | skip_fail: false |
| 53 | |
| 54 | - description: Install ceph osd |
| 55 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 56 | -C 'I@ceph:osd' state.sls ceph.osd |
| 57 | node_name: {{ HOSTNAME_CFG01 }} |
| 58 | retry: {count: 1, delay: 5} |
| 59 | skip_fail: false |
| 60 | |
| 61 | - description: Sync grains |
| 62 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 63 | -C 'I@ceph:osd' saltutil.sync_grains |
| 64 | node_name: {{ HOSTNAME_CFG01 }} |
| 65 | retry: {count: 1, delay: 5} |
| 66 | skip_fail: false |
| 67 | |
| 68 | - description: Install ceph osd nodes |
| 69 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 70 | -C 'I@ceph:osd' state.sls ceph.osd.custom |
| 71 | node_name: {{ HOSTNAME_CFG01 }} |
| 72 | retry: {count: 1, delay: 5} |
| 73 | skip_fail: true |
| 74 | |
| 75 | - description: Sync grains |
| 76 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 77 | -C 'I@ceph:osd' saltutil.sync_grains |
| 78 | node_name: {{ HOSTNAME_CFG01 }} |
| 79 | retry: {count: 1, delay: 5} |
| 80 | skip_fail: false |
| 81 | |
| 82 | - description: Update mine on ceph osd |
| 83 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 84 | -C 'I@ceph:osd' mine.update |
| 85 | node_name: {{ HOSTNAME_CFG01 }} |
| 86 | retry: {count: 1, delay: 10} |
| 87 | skip_fail: false |
| 88 | |
| 89 | - description: Setup pools, keyrings and maybe crush |
| 90 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 91 | -C 'I@ceph:setup' state.sls ceph.setup |
| 92 | node_name: {{ HOSTNAME_CFG01 }} |
| 93 | retry: {count: 1, delay: 10} |
| 94 | skip_fail: false |
| 95 | |
| 96 | - description: Install ceph clinet |
| 97 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 98 | -C 'I@ceph:setup' state.sls ceph.setup |
| 99 | node_name: {{ HOSTNAME_CFG01 }} |
| 100 | retry: {count: 1, delay: 10} |
| 101 | skip_fail: false |
| 102 | |
| 103 | - description: Install radosgw if exists |
| 104 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 105 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains; |
| 106 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw; |
| 107 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keystone:client' state.sls keystone.client; |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 108 | node_name: {{ HOSTNAME_CFG01 }} |
| 109 | retry: {count: 2, delay: 5} |
| 110 | skip_fail: false |
| 111 | |
| 112 | - description: Install ceph clinet |
| 113 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 114 | -C 'I@ceph:setup' state.sls ceph.setup |
| 115 | node_name: {{ HOSTNAME_CFG01 }} |
| 116 | retry: {count: 1, delay: 10} |
| 117 | skip_fail: false |
| 118 | |
Dennis Dmitriev | 5bcbdc5 | 2018-03-23 18:05:10 +0200 | [diff] [blame] | 119 | {%- for ssh in config.underlay.ssh %} |
| 120 | {%- set salt_roles = [] %} |
| 121 | {%- for role in ssh['roles'] %} |
| 122 | {%- if role in config.salt_deploy.salt_roles %} |
| 123 | {%- set _ = salt_roles.append(role) %} |
| 124 | {%- endif %} |
| 125 | {%- endfor %} |
| 126 | |
| 127 | {%- if salt_roles %} |
Tatyana Leontovich | 3fc6a09 | 2018-01-23 13:41:49 +0200 | [diff] [blame] | 128 | - description: Restart salt-minion as workaround of PROD-16970 |
| 129 | cmd: | |
| 130 | service salt-minion restart; # For case if salt-minion was already installed |
| 131 | node_name: {{ ssh['node_name'] }} |
| 132 | retry: {count: 1, delay: 1} |
| 133 | skip_fail: false |
Dennis Dmitriev | 5bcbdc5 | 2018-03-23 18:05:10 +0200 | [diff] [blame] | 134 | {%- endif %} |
| 135 | {%- endfor %} |
Tatyana Leontovich | 3fc6a09 | 2018-01-23 13:41:49 +0200 | [diff] [blame] | 136 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 137 | - description: Connect ceph to glance |
| 138 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 139 | 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; |
| 140 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-api; |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 141 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-registry; |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 142 | node_name: {{ HOSTNAME_CFG01 }} |
| 143 | retry: {count: 2, delay: 5} |
| 144 | skip_fail: false |
| 145 | |
| 146 | - description: Connect ceph to cinder and nova |
| 147 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 148 | 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; |
| 149 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring; |
| 150 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains; |
| 151 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls nova; |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 152 | node_name: {{ HOSTNAME_CFG01 }} |
| 153 | retry: {count: 2, delay: 5} |
| 154 | skip_fail: false |
| 155 | |
| 156 | - description: Restart cinder volume |
| 157 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 158 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' service.restart cinder-volume; |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 159 | node_name: {{ HOSTNAME_CFG01 }} |
| 160 | retry: {count: 2, delay: 5} |
| 161 | skip_fail: false |
| 162 | |
| 163 | - description: Restart nova-compute |
| 164 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 165 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:compute' service.restart nova-compute; |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 166 | node_name: {{ HOSTNAME_CFG01 }} |
| 167 | retry: {count: 2, delay: 5} |
| 168 | skip_fail: false |
| 169 | |
Tatyana Leontovich | 2675691 | 2018-06-06 20:11:05 +0300 | [diff] [blame] | 170 | {{ BACKUP.MACRO_BACKUP_CEPH() }} |
Oleksii Butenko | 5cd0a16 | 2018-06-14 18:18:10 +0300 | [diff] [blame] | 171 | {{ SHARED.INSTALL_DOCKER_ON_GTW() }} |