Skip to content

Commit

Permalink
fix backup and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
SK1Y101 committed Aug 20, 2023
1 parent 375267e commit 4308373
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion restore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
delegate_to: localhost
become: false
register: backup_file

- hosts:
- maas_postgres
- maas_region_controller
Expand Down
8 changes: 6 additions & 2 deletions roles/common/tasks/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
when: (('maas_region_controller' in group_names) or ('maas_rack_controller' in group_names)) and (not maas_install_deb | bool)

- name: Backup MAAS snap
ansible.builtin.command: snap save maas
ansible.builtin.shell: "\
set -o pipefail && \
snap save maas | awk 'NR==2' | awk '{print $1}'"
args:
executable: /bin/bash
register: snap_id
when: (('maas_region_controller' in group_names) or ('maas_rack_controller' in group_names)) and (not maas_install_deb | bool)

Expand Down Expand Up @@ -51,4 +55,4 @@

- name: Start MAAS snap
ansible.builtin.command: snap start maas
when: (('maas_region_controller' in group_names) or ('maas_rack_controller' in group_names)) and (not maas_install_deb | bool)
when: (('maas_region_controller' in group_names) or ('maas_rack_controller' in group_names)) and (not maas_install_deb | bool)
8 changes: 6 additions & 2 deletions roles/common/tasks/restore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
ansible.builtin.command: snap stop maas
when: (('maas_region_controller' in group_names) or ('maas_rack_controller' in group_names)) and (not maas_install_deb | bool)

- name: Import snap data
ansible.builtin.command: "snap import-snapshot /tmp/maas_backup/{{ maas_snap_backup_path }}"
- name: Backup MAAS snap

Check failure on line 31 in roles/common/tasks/restore.yaml

View workflow job for this annotation

GitHub Actions / build

parser-error

failed at splitting arguments, either an unbalanced jinja2 block or quotes: set -o pipefail && snap import-snapshot /tmp/maas_backup/{{ maas_snap_backup_path } | awk 'NR==3' | awk '{print $1}'
ansible.builtin.shell: "\
set -o pipefail && \
snap import-snapshot /tmp/maas_backup/{{ maas_snap_backup_path } | awk 'NR==3' | awk '{print $1}'"
args:
executable: /bin/bash
register: snap_id
when: (('maas_region_controller' in group_names) or ('maas_rack_controller' in group_names)) and (not maas_install_deb | bool)

Expand Down

0 comments on commit 4308373

Please sign in to comment.