| {# Collection of common macroses shared across different deployments #} |
| |
| {%- macro MACRO_BACKUP_BACKUPNINJA() %} |
| |
| - description: Apply backup state on minions |
| cmd: salt -C 'I@backupninja:server or backupninja:client' state.sls salt.minion |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Refresh grains and mine for the backupninja client node |
| cmd: | |
| salt -C 'I@backupninja:client' state.sls salt.minion.grains |
| salt -C 'I@backupninja:client' mine.flush |
| salt -C 'I@backupninja:client' mine.update |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Apply the backupninja state to the backupninja client node |
| cmd: | |
| salt -C 'I@backupninja:client' state.sls backupninja |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Refresh grains for the backupninja server node |
| cmd: | |
| salt -C 'I@backupninja:server' state.sls salt.minion.grains |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Apply the backupninja state to the backupninja server node |
| cmd: | |
| salt -C 'I@backupninja:server' state.sls backupninja |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| {%- endmacro %} |
| |
| {%- macro MACRO_BACKUP_XTRABACKUP() %} |
| |
| - description: Refresh pillars |
| cmd: salt '*' saltutil.refresh_pillar |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Apply the salt.minion state |
| cmd: | |
| salt -C 'I@xtrabackup:client or I@xtrabackup:server' state.sls salt.minion && sleep 10 |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Refresh grains for the xtrabackup client node |
| cmd: salt -C 'I@xtrabackup:client' saltutil.sync_grains |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 5, delay: 10} |
| skip_fail: false |
| |
| - description: Update the mine for the xtrabackup client node |
| cmd: | |
| salt -C 'I@xtrabackup:client' mine.flush |
| salt -C 'I@xtrabackup:client' mine.update |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 3, delay: 5} |
| skip_fail: false |
| |
| - description: Apply the xtrabackup client state |
| cmd: | |
| salt -C 'I@xtrabackup:client' state.sls openssh.client,xtrabackup |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Apply the xtrabackup server state |
| cmd: | |
| salt -C 'I@xtrabackup:server' state.sls xtrabackup |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| {%- endmacro %} |
| |
| {%- macro MACRO_BACKUP_CEPH() %} |
| |
| - description: Refresh pillars |
| cmd: salt '*' saltutil.refresh_pillar |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Apply the salt.minion state |
| cmd: | |
| salt -C 'I@ceph:backup:client or I@ceph:backup:server' state.sls salt.minion |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Refresh grains for the ceph client node |
| cmd: salt -C 'I@ceph:backup:client' saltutil.sync_grains |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Update the mine for the client node |
| cmd: | |
| salt -C 'I@ceph:backup:client' mine.flush |
| salt -C 'I@ceph:backup:client' mine.update |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Apply the backup client state |
| cmd: | |
| salt -C 'I@ceph:backup:client' state.sls openssh.client,ceph.backup |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| - description: Apply the backup server state |
| cmd: | |
| salt -C 'I@ceph:backup:server' state.sls ceph.backup |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: false |
| |
| {%- endmacro %} |
| |
| {%- macro MACRO_WR_NGINX_MASTER() %} |
| |
| - description: WR for https://mirantis.jira.com/browse/PROD-21132 |
| cmd: | |
| sed -i 's/listen 8080/listen 8181/g' /etc/nginx/sites-available/nginx_proxy_ceph_radosgw.conf ; |
| sed -i 's/listen \[\:\:\]\:80/listen \[\:\:\]\:8181/g' /etc/nginx/sites-available/default ; |
| sed -i 's/listen 80 default_server/listen 8181 default_server/g' /etc/nginx/sites-available/default ; |
| systemctl restart nginx; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 1} |
| skip_fail: true |
| |
| {%- endmacro %} |
| |
| |