--- - name: duplicity | check vars are defined assert: that: - duplicity_archive_dir is defined - duplicity_s3_path is defined - duplicity_s3_passphrase is defined - duplicity_s3_access_key is defined - duplicity_s3_secret_key is defined tags: ['backup_duplicity'] - name: duplicity | install packages apt: name: - duplicity state: present tags: ['backup_duplicity'] - name: duplicity | check for dedicated GPG key shell: | gpg --list-options show-only-fpr-mbox --list-secret-keys -a "{{ duplicity_gpg_real_name }}" | awk '{print $1}' register: duplicity_get_key tags: ['backup_duplicity'] - set_fact: duplicity_gpg_key: "{{ duplicity_get_key.stdout }}" when: duplicity_get_key.stdout != '' tags: ['backup_duplicity'] - name: duplicity | generate dedicated GPG key shell: | gpg --batch --gen-key <