DEV-1058 bugfix backup process

- added become to gpg import
qa
Sven Ketelsen 3 years ago
parent 62145f04ca
commit 69e37093b9

@ -1,3 +1,4 @@
--- ---
backup_communication_keys_repository: "https://{{ gitea_admin_username | urlencode() }}:{{ gitea_admin_password | urlencode() }}@{{ shared_service_hostname_gitea }}/gitea-admin/communication-keys.git" backup_communication_keys_repository: "https://{{ gitea_admin_username | urlencode() }}:{{ gitea_admin_password | urlencode() }}@{{ shared_service_hostname_gitea }}/gitea-admin/communication-keys.git"
backup_communication_keys_stage_gpg_key: "smardigo_automation_{{ stage }}.gpg.pub" backup_communication_keys_stage_gpg_key: "smardigo_automation_{{ stage }}.gpg.pub"
backup_gpg_recipient: "smardigo automation {{ stage | upper }}"

@ -1,3 +1,4 @@
--- ---
# TODO use stage specific gpg key # TODO use stage specific gpg key
backup_communication_keys_stage_gpg_key: "smardigo_automation_prodnso.gpg.pub" backup_communication_keys_stage_gpg_key: "smardigo_automation_dev.gpg.pub"
backup_gpg_recipient: "smardigo automation DEV"

@ -37,6 +37,7 @@
# linting violation needs to be whitelisted # linting violation needs to be whitelisted
- name: "Importing stage specific automation gpg-key" # noqa command-instead-of-shell - name: "Importing stage specific automation gpg-key" # noqa command-instead-of-shell
shell: 'gpg --import {{ tempdir.path }}/{{ backup_communication_keys_stage_gpg_key }}' shell: 'gpg --import {{ tempdir.path }}/{{ backup_communication_keys_stage_gpg_key }}'
become: yes
# there is no ansible module already in place for (mariabackup|gpg) # there is no ansible module already in place for (mariabackup|gpg)
# so using shell module # so using shell module
@ -47,7 +48,7 @@
shell: | shell: |
set -o pipefail set -o pipefail
/usr/bin/mariabackup --defaults-file={{ my_cnf_file }} --backup --stream=xbstream | gzip > {{ backup_file }} && \ /usr/bin/mariabackup --defaults-file={{ my_cnf_file }} --backup --stream=xbstream | gzip > {{ backup_file }} && \
gpg --encrypt --recipient "smardigo automation {{ stage | upper }}" --trust-model always {{ backup_file }} && \ gpg --encrypt --recipient "smardigo automation DEV" --trust-model always {{ backup_file }} && \
rm {{ backup_file }} rm {{ backup_file }}
args: args:
executable: /bin/bash executable: /bin/bash

Loading…
Cancel
Save