Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 1 | {% from 'virtual-mcp-pike-ovs-ceph/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 3 | |
| 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: | |
| 42 | if salt -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then |
| 43 | salt -C 'I@ceph:mgr' state.sls ceph.mgr |
| 44 | 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: | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 100 | if salt -C 'I@ceph:radosgw' match.pillar 'ceph:radosgw' ; then |
| 101 | salt -C 'I@ceph:radosgw' saltutil.sync_grains; |
| 102 | salt -C 'I@ceph:radosgw' state.sls ceph.radosgw; |
| 103 | salt -C 'I@keystone:client' state.sls keystone.client; |
| 104 | fi |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 105 | 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 | |
Tatyana Leontovich | 3fc6a09 | 2018-01-23 13:41:49 +0200 | [diff] [blame^] | 116 | {% for ssh in config.underlay.ssh %} |
| 117 | - description: Restart salt-minion as workaround of PROD-16970 |
| 118 | cmd: | |
| 119 | service salt-minion restart; # For case if salt-minion was already installed |
| 120 | node_name: {{ ssh['node_name'] }} |
| 121 | retry: {count: 1, delay: 1} |
| 122 | skip_fail: false |
| 123 | {% endfor %} |
| 124 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 125 | - description: Connect ceph to glance |
| 126 | cmd: | |
| 127 | salt -C 'I@ceph:common and I@glance:server' state.sls ceph.common,ceph.setup.keyring,glance; |
| 128 | salt -C 'I@ceph:common and I@glance:server' service.restart glance-api; |
| 129 | salt -C 'I@ceph:common and I@glance:server' service.restart glance-glare; |
| 130 | salt -C 'I@ceph:common and I@glance:server' service.restart glance-registry; |
| 131 | node_name: {{ HOSTNAME_CFG01 }} |
| 132 | retry: {count: 2, delay: 5} |
| 133 | skip_fail: false |
| 134 | |
| 135 | - description: Connect ceph to cinder and nova |
| 136 | cmd: | |
| 137 | salt -C 'I@ceph:common and I@cinder:controller' state.sls ceph.common,ceph.setup.keyring,cinder; |
| 138 | salt -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring; |
| 139 | salt -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains; |
| 140 | salt -C 'I@ceph:common and I@nova:compute' state.sls nova; |
| 141 | node_name: {{ HOSTNAME_CFG01 }} |
| 142 | retry: {count: 2, delay: 5} |
| 143 | skip_fail: false |
| 144 | |
| 145 | - description: Restart cinder volume |
| 146 | cmd: | |
| 147 | salt -C 'I@cinder:controller' service.restart cinder-volume; |
| 148 | node_name: {{ HOSTNAME_CFG01 }} |
| 149 | retry: {count: 2, delay: 5} |
| 150 | skip_fail: false |
| 151 | |
| 152 | - description: Restart nova-compute |
| 153 | cmd: | |
| 154 | salt -C 'I@nova:compute' service.restart nova-compute; |
| 155 | node_name: {{ HOSTNAME_CFG01 }} |
| 156 | retry: {count: 2, delay: 5} |
| 157 | skip_fail: false |
| 158 | |
| 159 | - description: conver cirros image |
| 160 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 161 | 'qemu-img convert cirros-0.3.4-i386-disk.img cirros.raw' |
| 162 | node_name: {{ HOSTNAME_CFG01 }} |
| 163 | retry: {count: 2, delay: 30} |
| 164 | skip_fail: false |
| 165 | |
| 166 | - description: Register image in glance |
| 167 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 168 | '. /root/keystonercv3; glance --timeout 120 image-create --name "cirros" --disk-format raw --container-format bare --visibility public --file cirros.raw' |
| 169 | node_name: {{ HOSTNAME_CFG01 }} |
| 170 | retry: {count: 1, delay: 30} |
| 171 | skip_fail: false |