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 | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 2 | |
| 3 | # Install ceph mons |
| 4 | - description: Update grains |
| 5 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 6 | -C 'I@ceph:common' state.sls salt.minion.grains |
| 7 | node_name: {{ HOSTNAME_CFG01 }} |
| 8 | retry: {count: 1, delay: 10} |
| 9 | skip_fail: false |
| 10 | |
| 11 | - description: Generate keyrings |
| 12 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 13 | -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' state.sls ceph.mon |
| 14 | node_name: {{ HOSTNAME_CFG01 }} |
| 15 | retry: {count: 1, delay: 10} |
| 16 | skip_fail: false |
| 17 | |
| 18 | - description: Sync grains on ceph mon nodes |
| 19 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 20 | -C 'I@ceph:mon' saltutil.sync_grains |
| 21 | node_name: {{ HOSTNAME_CFG01 }} |
| 22 | retry: {count: 1, delay: 10} |
| 23 | skip_fail: false |
| 24 | |
| 25 | - description: Update mine on ceph mons |
| 26 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 27 | -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' mine.update |
| 28 | node_name: {{ HOSTNAME_CFG01 }} |
| 29 | retry: {count: 1, delay: 10} |
| 30 | skip_fail: false |
| 31 | |
| 32 | - description: Install ceph mon |
| 33 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 34 | -C 'I@ceph:mon' state.sls ceph.mon |
| 35 | node_name: {{ HOSTNAME_CFG01 }} |
| 36 | retry: {count: 1, delay: 5} |
| 37 | skip_fail: false |
| 38 | |
| 39 | - description: Install ceph mgr if defined(needed only for Luminious) |
| 40 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 41 | if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then |
| 42 | 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] | 43 | fi |
| 44 | node_name: {{ HOSTNAME_CFG01 }} |
| 45 | retry: {count: 2, delay: 5} |
| 46 | skip_fail: false |
| 47 | |
| 48 | - description: Install ceph osd |
| 49 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 50 | -C 'I@ceph:osd' state.sls ceph.osd |
| 51 | node_name: {{ HOSTNAME_CFG01 }} |
| 52 | retry: {count: 1, delay: 5} |
| 53 | skip_fail: false |
| 54 | |
| 55 | - description: Sync grains |
| 56 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 57 | -C 'I@ceph:osd' saltutil.sync_grains |
| 58 | node_name: {{ HOSTNAME_CFG01 }} |
| 59 | retry: {count: 1, delay: 5} |
| 60 | skip_fail: false |
| 61 | |
| 62 | - description: Install ceph osd nodes |
| 63 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 64 | -C 'I@ceph:osd' state.sls ceph.osd.custom |
| 65 | node_name: {{ HOSTNAME_CFG01 }} |
| 66 | retry: {count: 1, delay: 5} |
| 67 | skip_fail: true |
| 68 | |
| 69 | - description: Sync grains |
| 70 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 71 | -C 'I@ceph:osd' saltutil.sync_grains |
| 72 | node_name: {{ HOSTNAME_CFG01 }} |
| 73 | retry: {count: 1, delay: 5} |
| 74 | skip_fail: false |
| 75 | |
| 76 | - description: Update mine on ceph osd |
| 77 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 78 | -C 'I@ceph:osd' mine.update |
| 79 | node_name: {{ HOSTNAME_CFG01 }} |
| 80 | retry: {count: 1, delay: 10} |
| 81 | skip_fail: false |
| 82 | |
| 83 | - description: Setup pools, keyrings and maybe crush |
| 84 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 85 | -C 'I@ceph:setup' state.sls ceph.setup |
| 86 | node_name: {{ HOSTNAME_CFG01 }} |
| 87 | retry: {count: 1, delay: 10} |
| 88 | skip_fail: false |
| 89 | |
| 90 | - description: Install ceph clinet |
| 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 radosgw if exists |
| 98 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 99 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains; |
| 100 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw; |
| 101 | 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] | 102 | node_name: {{ HOSTNAME_CFG01 }} |
| 103 | retry: {count: 2, delay: 5} |
| 104 | skip_fail: false |
| 105 | |
| 106 | - description: Install ceph clinet |
| 107 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 108 | -C 'I@ceph:setup' state.sls ceph.setup |
| 109 | node_name: {{ HOSTNAME_CFG01 }} |
| 110 | retry: {count: 1, delay: 10} |
| 111 | skip_fail: false |
| 112 | |
Dennis Dmitriev | 5bcbdc5 | 2018-03-23 18:05:10 +0200 | [diff] [blame^] | 113 | {%- for ssh in config.underlay.ssh %} |
| 114 | {%- set salt_roles = [] %} |
| 115 | {%- for role in ssh['roles'] %} |
| 116 | {%- if role in config.salt_deploy.salt_roles %} |
| 117 | {%- set _ = salt_roles.append(role) %} |
| 118 | {%- endif %} |
| 119 | {%- endfor %} |
| 120 | |
| 121 | {%- if salt_roles %} |
Tatyana Leontovich | 3fc6a09 | 2018-01-23 13:41:49 +0200 | [diff] [blame] | 122 | - description: Restart salt-minion as workaround of PROD-16970 |
| 123 | cmd: | |
| 124 | service salt-minion restart; # For case if salt-minion was already installed |
| 125 | node_name: {{ ssh['node_name'] }} |
| 126 | retry: {count: 1, delay: 1} |
| 127 | skip_fail: false |
Dennis Dmitriev | 5bcbdc5 | 2018-03-23 18:05:10 +0200 | [diff] [blame^] | 128 | {%- endif %} |
| 129 | {%- endfor %} |
Tatyana Leontovich | 3fc6a09 | 2018-01-23 13:41:49 +0200 | [diff] [blame] | 130 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 131 | - description: Connect ceph to glance |
| 132 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 133 | 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; |
| 134 | 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] | 135 | 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] | 136 | node_name: {{ HOSTNAME_CFG01 }} |
| 137 | retry: {count: 2, delay: 5} |
| 138 | skip_fail: false |
| 139 | |
| 140 | - description: Connect ceph to cinder and nova |
| 141 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 142 | 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; |
| 143 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring; |
| 144 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains; |
| 145 | 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] | 146 | node_name: {{ HOSTNAME_CFG01 }} |
| 147 | retry: {count: 2, delay: 5} |
| 148 | skip_fail: false |
| 149 | |
| 150 | - description: Restart cinder volume |
| 151 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 152 | 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] | 153 | node_name: {{ HOSTNAME_CFG01 }} |
| 154 | retry: {count: 2, delay: 5} |
| 155 | skip_fail: false |
| 156 | |
| 157 | - description: Restart nova-compute |
| 158 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 159 | 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] | 160 | node_name: {{ HOSTNAME_CFG01 }} |
| 161 | retry: {count: 2, delay: 5} |
| 162 | skip_fail: false |
| 163 | |
| 164 | - description: conver cirros image |
| 165 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 166 | 'qemu-img convert cirros-0.3.4-i386-disk.img cirros.raw' |
| 167 | node_name: {{ HOSTNAME_CFG01 }} |
| 168 | retry: {count: 2, delay: 30} |
| 169 | skip_fail: false |
| 170 | |
| 171 | - description: Register image in glance |
| 172 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 173 | '. /root/keystonercv3; glance --timeout 120 image-create --name "cirros" --disk-format raw --container-format bare --visibility public --file cirros.raw' |
| 174 | node_name: {{ HOSTNAME_CFG01 }} |
| 175 | retry: {count: 1, delay: 30} |
sgudz | 8b6a854 | 2018-03-19 18:13:51 +0200 | [diff] [blame] | 176 | skip_fail: false |