Tatyana Leontovich | 2675691 | 2018-06-06 20:11:05 +0300 | [diff] [blame] | 1 | {# Collection of common macroses shared across different deployments #} |
| 2 | |
| 3 | {%- macro MACRO_BACKUP_BACKUPNINJA() %} |
| 4 | - description: Apply backup state on minions |
| 5 | cmd: salt -C 'I@backupninja:server or backupninja:client' state.sls salt.minion |
| 6 | node_name: {{ HOSTNAME_CFG01 }} |
| 7 | retry: {count: 1, delay: 1} |
| 8 | skip_fail: false |
| 9 | |
| 10 | - description: Refresh grains and mine for the backupninja client node |
| 11 | cmd: | |
| 12 | salt -C 'I@backupninja:client' state.sls salt.minion.grains |
| 13 | salt -C 'I@backupninja:client' mine.flush |
| 14 | salt -C 'I@backupninja:client' mine.update |
| 15 | node_name: {{ HOSTNAME_CFG01 }} |
| 16 | retry: {count: 1, delay: 1} |
| 17 | skip_fail: false |
| 18 | |
| 19 | - description: Apply the backupninja state to the backupninja client node |
| 20 | cmd: | |
| 21 | salt -C 'I@backupninja:client' state.sls backupninja |
| 22 | node_name: {{ HOSTNAME_CFG01 }} |
| 23 | retry: {count: 1, delay: 1} |
| 24 | skip_fail: false |
| 25 | |
| 26 | - description: Refresh grains for the backupninja server node |
| 27 | cmd: | |
| 28 | salt -C 'I@backupninja:server' state.sls salt.minion.grains |
| 29 | node_name: {{ HOSTNAME_CFG01 }} |
| 30 | retry: {count: 1, delay: 1} |
| 31 | skip_fail: false |
| 32 | |
| 33 | - description: Apply the backupninja state to the backupninja server node |
| 34 | cmd: | |
| 35 | salt -C 'I@backupninja:server' state.sls backupninja |
| 36 | node_name: {{ HOSTNAME_CFG01 }} |
| 37 | retry: {count: 1, delay: 1} |
| 38 | skip_fail: false |
| 39 | |
| 40 | {%- endmacro %} |
| 41 | |
| 42 | {%- macro MACRO_BACKUP_XTRABACKUP() %} |
| 43 | |
| 44 | - description: Refresh pillars |
| 45 | cmd: salt '*' saltutil.refresh_pillar |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 1, delay: 1} |
| 48 | skip_fail: false |
| 49 | |
| 50 | - description: Apply the salt.minion state |
| 51 | cmd: | |
| 52 | salt -C 'I@xtrabackup:client or I@xtrabackup:server' state.sls salt.minion |
| 53 | node_name: {{ HOSTNAME_CFG01 }} |
| 54 | retry: {count: 1, delay: 1} |
| 55 | skip_fail: false |
| 56 | |
| 57 | - description: Refresh grains for the xtrabackup client node |
| 58 | cmd: salt -C 'I@xtrabackup:client' saltutil.sync_grains |
| 59 | node_name: {{ HOSTNAME_CFG01 }} |
| 60 | retry: {count: 1, delay: 1} |
| 61 | skip_fail: false |
| 62 | |
| 63 | - description: Update the mine for the xtrabackup client node |
| 64 | cmd: | |
| 65 | salt -C 'I@xtrabackup:client' mine.flush |
| 66 | salt -C 'I@xtrabackup:client' mine.update |
| 67 | node_name: {{ HOSTNAME_CFG01 }} |
| 68 | retry: {count: 1, delay: 1} |
| 69 | skip_fail: false |
| 70 | |
| 71 | - description: Apply the xtrabackup client state |
| 72 | cmd: | |
| 73 | salt -C 'I@xtrabackup:client' state.sls openssh.client,xtrabackup |
| 74 | node_name: {{ HOSTNAME_CFG01 }} |
| 75 | retry: {count: 1, delay: 1} |
| 76 | skip_fail: false |
| 77 | |
| 78 | - description: Apply the xtrabackup server state |
| 79 | cmd: | |
| 80 | salt -C 'I@xtrabackup:server' state.sls xtrabackup |
| 81 | node_name: {{ HOSTNAME_CFG01 }} |
| 82 | retry: {count: 1, delay: 1} |
| 83 | skip_fail: false |
| 84 | |
| 85 | {%- endmacro %} |
| 86 | |
| 87 | {%- macro MACRO_BACKUP_CEPH() %} |
| 88 | |
| 89 | - description: Refresh pillars |
| 90 | cmd: salt '*' saltutil.refresh_pillar |
| 91 | node_name: {{ HOSTNAME_CFG01 }} |
| 92 | retry: {count: 1, delay: 1} |
| 93 | skip_fail: false |
| 94 | |
| 95 | - description: Apply the salt.minion state |
| 96 | cmd: | |
| 97 | salt -C 'I@ceph:backup:client or I@ceph:backup:server' state.sls salt.minion |
| 98 | node_name: {{ HOSTNAME_CFG01 }} |
| 99 | retry: {count: 1, delay: 1} |
| 100 | skip_fail: false |
| 101 | |
| 102 | - description: Refresh grains for the ceph client node |
| 103 | cmd: salt -C 'I@ceph:backup:client' saltutil.sync_grains |
| 104 | node_name: {{ HOSTNAME_CFG01 }} |
| 105 | retry: {count: 1, delay: 1} |
| 106 | skip_fail: false |
| 107 | |
| 108 | - description: Update the mine for the client node |
| 109 | cmd: | |
| 110 | salt -C 'I@ceph:backup:client' mine.flush |
| 111 | salt -C 'I@ceph:backup:client' mine.update |
| 112 | node_name: {{ HOSTNAME_CFG01 }} |
| 113 | retry: {count: 1, delay: 1} |
| 114 | skip_fail: false |
| 115 | |
| 116 | - description: Apply the backup client state |
| 117 | cmd: | |
| 118 | salt -C 'I@ceph:backup:client' state.sls openssh.client,ceph.backup |
| 119 | node_name: {{ HOSTNAME_CFG01 }} |
| 120 | retry: {count: 1, delay: 1} |
| 121 | skip_fail: false |
| 122 | |
| 123 | - description: Apply the backup server state |
| 124 | cmd: | |
| 125 | salt -C 'I@ceph:backup:server' state.sls ceph.backup |
| 126 | node_name: {{ HOSTNAME_CFG01 }} |
| 127 | retry: {count: 1, delay: 1} |
| 128 | skip_fail: false |
| 129 | |
| 130 | {%- endmacro %} |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |