Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 1 | {% from 'virtual-mcp-ocata-ceph-offline/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | |
| 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 }} |
Dennis Dmitriev | 838f427 | 2018-01-15 16:34:57 +0200 | [diff] [blame] | 9 | retry: {count: 3, delay: 20} |
Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 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: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 42 | if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then |
| 43 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' state.sls ceph.mgr |
Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 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: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 100 | if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' match.pillar 'ceph:radosgw' ; then |
| 101 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains; |
| 102 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw; |
| 103 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keystone:client' state.sls keystone.client; |
Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 104 | fi |
| 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 | |
| 116 | - description: Connect ceph to glance |
| 117 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 118 | 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; |
| 119 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-api; |
| 120 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-glare; |
| 121 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-registry; |
Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 122 | node_name: {{ HOSTNAME_CFG01 }} |
| 123 | retry: {count: 2, delay: 5} |
| 124 | skip_fail: false |
| 125 | |
| 126 | - description: Connect ceph to cinder and nova |
| 127 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 128 | 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; |
| 129 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring; |
| 130 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains; |
| 131 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls nova; |
Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 132 | node_name: {{ HOSTNAME_CFG01 }} |
| 133 | retry: {count: 2, delay: 5} |
| 134 | skip_fail: false |
| 135 | |
| 136 | - description: Restart cinder volume |
| 137 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 138 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' service.restart cinder-volume; |
Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 139 | node_name: {{ HOSTNAME_CFG01 }} |
| 140 | retry: {count: 2, delay: 5} |
| 141 | skip_fail: false |
| 142 | |
| 143 | - description: Restart nova-compute |
| 144 | cmd: | |
Dennis Dmitriev | 281221b | 2018-02-13 16:40:48 +0200 | [diff] [blame] | 145 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:compute' service.restart nova-compute; |
Dennis Dmitriev | 75776c5 | 2017-12-26 18:22:53 +0200 | [diff] [blame] | 146 | node_name: {{ HOSTNAME_CFG01 }} |
| 147 | retry: {count: 2, delay: 5} |
| 148 | skip_fail: false |
| 149 | |
| 150 | - description: conver cirros image |
| 151 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 152 | 'qemu-img convert cirros-0.3.4-i386-disk.img cirros.raw' |
| 153 | node_name: {{ HOSTNAME_CFG01 }} |
| 154 | retry: {count: 2, delay: 30} |
| 155 | skip_fail: false |
| 156 | |
| 157 | - description: Register image in glance |
| 158 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 159 | '. /root/keystonercv3; glance --timeout 120 image-create --name "cirros" --disk-format raw --container-format bare --visibility public --file cirros.raw' |
| 160 | node_name: {{ HOSTNAME_CFG01 }} |
| 161 | retry: {count: 1, delay: 30} |
| 162 | skip_fail: false |