blob: 2ec4d5dd1c6ccf288c5d7023da5242ccf4a1c595 [file] [log] [blame]
{# 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
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 %}