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