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() %} |
Tatyana Leontovich | 28dcd6a | 2018-07-03 00:38:32 +0300 | [diff] [blame] | 4 | |
| 5 | - description: WR for https://mirantis.jira.com/browse/PROD-21132 |
| 6 | cmd: | |
| 7 | sed -i 's/listen \[\:\:\]\:80/listen \[\:\:\]\:8181/g' /etc/nginx/sites-available/default ; |
| 8 | sed -i 's/listen 80 default_server/listen 8181 default_server/g' /etc/nginx/sites-available/default ; |
| 9 | systemctl restart nginx; |
| 10 | node_name: {{ HOSTNAME_CFG01 }} |
| 11 | retry: {count: 1, delay: 1} |
| 12 | skip_fail: false |
| 13 | |
Tatyana Leontovich | 2675691 | 2018-06-06 20:11:05 +0300 | [diff] [blame] | 14 | - description: Apply backup state on minions |
| 15 | cmd: salt -C 'I@backupninja:server or backupninja:client' state.sls salt.minion |
| 16 | node_name: {{ HOSTNAME_CFG01 }} |
| 17 | retry: {count: 1, delay: 1} |
| 18 | skip_fail: false |
| 19 | |
| 20 | - description: Refresh grains and mine for the backupninja client node |
| 21 | cmd: | |
| 22 | salt -C 'I@backupninja:client' state.sls salt.minion.grains |
| 23 | salt -C 'I@backupninja:client' mine.flush |
| 24 | salt -C 'I@backupninja:client' mine.update |
| 25 | node_name: {{ HOSTNAME_CFG01 }} |
| 26 | retry: {count: 1, delay: 1} |
| 27 | skip_fail: false |
| 28 | |
| 29 | - description: Apply the backupninja state to the backupninja client node |
| 30 | cmd: | |
| 31 | salt -C 'I@backupninja:client' state.sls backupninja |
| 32 | node_name: {{ HOSTNAME_CFG01 }} |
| 33 | retry: {count: 1, delay: 1} |
| 34 | skip_fail: false |
| 35 | |
| 36 | - description: Refresh grains for the backupninja server node |
| 37 | cmd: | |
| 38 | salt -C 'I@backupninja:server' state.sls salt.minion.grains |
| 39 | node_name: {{ HOSTNAME_CFG01 }} |
| 40 | retry: {count: 1, delay: 1} |
| 41 | skip_fail: false |
| 42 | |
| 43 | - description: Apply the backupninja state to the backupninja server node |
| 44 | cmd: | |
| 45 | salt -C 'I@backupninja:server' state.sls backupninja |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 1, delay: 1} |
| 48 | skip_fail: false |
| 49 | |
| 50 | {%- endmacro %} |
| 51 | |
| 52 | {%- macro MACRO_BACKUP_XTRABACKUP() %} |
| 53 | |
| 54 | - description: Refresh pillars |
| 55 | cmd: salt '*' saltutil.refresh_pillar |
| 56 | node_name: {{ HOSTNAME_CFG01 }} |
| 57 | retry: {count: 1, delay: 1} |
| 58 | skip_fail: false |
| 59 | |
| 60 | - description: Apply the salt.minion state |
| 61 | cmd: | |
| 62 | salt -C 'I@xtrabackup:client or I@xtrabackup:server' state.sls salt.minion |
| 63 | node_name: {{ HOSTNAME_CFG01 }} |
| 64 | retry: {count: 1, delay: 1} |
| 65 | skip_fail: false |
| 66 | |
| 67 | - description: Refresh grains for the xtrabackup client node |
| 68 | cmd: salt -C 'I@xtrabackup:client' saltutil.sync_grains |
| 69 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 643ca27 | 2018-06-15 13:50:07 +0300 | [diff] [blame] | 70 | retry: {count: 5, delay: 10} |
Tatyana Leontovich | 2675691 | 2018-06-06 20:11:05 +0300 | [diff] [blame] | 71 | skip_fail: false |
| 72 | |
| 73 | - description: Update the mine for the xtrabackup client node |
| 74 | cmd: | |
| 75 | salt -C 'I@xtrabackup:client' mine.flush |
| 76 | salt -C 'I@xtrabackup:client' mine.update |
| 77 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 643ca27 | 2018-06-15 13:50:07 +0300 | [diff] [blame] | 78 | retry: {count: 3, delay: 5} |
Tatyana Leontovich | 2675691 | 2018-06-06 20:11:05 +0300 | [diff] [blame] | 79 | skip_fail: false |
| 80 | |
| 81 | - description: Apply the xtrabackup client state |
| 82 | cmd: | |
| 83 | salt -C 'I@xtrabackup:client' state.sls openssh.client,xtrabackup |
| 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 1, delay: 1} |
| 86 | skip_fail: false |
| 87 | |
| 88 | - description: Apply the xtrabackup server state |
| 89 | cmd: | |
| 90 | salt -C 'I@xtrabackup:server' state.sls xtrabackup |
| 91 | node_name: {{ HOSTNAME_CFG01 }} |
| 92 | retry: {count: 1, delay: 1} |
| 93 | skip_fail: false |
| 94 | |
| 95 | {%- endmacro %} |
| 96 | |
| 97 | {%- macro MACRO_BACKUP_CEPH() %} |
| 98 | |
| 99 | - description: Refresh pillars |
| 100 | cmd: salt '*' saltutil.refresh_pillar |
| 101 | node_name: {{ HOSTNAME_CFG01 }} |
| 102 | retry: {count: 1, delay: 1} |
| 103 | skip_fail: false |
| 104 | |
| 105 | - description: Apply the salt.minion state |
| 106 | cmd: | |
| 107 | salt -C 'I@ceph:backup:client or I@ceph:backup:server' state.sls salt.minion |
| 108 | node_name: {{ HOSTNAME_CFG01 }} |
| 109 | retry: {count: 1, delay: 1} |
| 110 | skip_fail: false |
| 111 | |
| 112 | - description: Refresh grains for the ceph client node |
| 113 | cmd: salt -C 'I@ceph:backup:client' saltutil.sync_grains |
| 114 | node_name: {{ HOSTNAME_CFG01 }} |
| 115 | retry: {count: 1, delay: 1} |
| 116 | skip_fail: false |
| 117 | |
| 118 | - description: Update the mine for the client node |
| 119 | cmd: | |
| 120 | salt -C 'I@ceph:backup:client' mine.flush |
| 121 | salt -C 'I@ceph:backup:client' mine.update |
| 122 | node_name: {{ HOSTNAME_CFG01 }} |
| 123 | retry: {count: 1, delay: 1} |
| 124 | skip_fail: false |
| 125 | |
| 126 | - description: Apply the backup client state |
| 127 | cmd: | |
| 128 | salt -C 'I@ceph:backup:client' state.sls openssh.client,ceph.backup |
| 129 | node_name: {{ HOSTNAME_CFG01 }} |
| 130 | retry: {count: 1, delay: 1} |
| 131 | skip_fail: false |
| 132 | |
| 133 | - description: Apply the backup server state |
| 134 | cmd: | |
| 135 | salt -C 'I@ceph:backup:server' state.sls ceph.backup |
| 136 | node_name: {{ HOSTNAME_CFG01 }} |
| 137 | retry: {count: 1, delay: 1} |
| 138 | skip_fail: false |
| 139 | |
| 140 | {%- endmacro %} |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |