Changeset - fff74c6cc6f9
[Not reviewed]
0 1 0
Branko Majic (branko) - 5 years ago 2018-10-21 17:48:04
branko@majic.rs
MAR-132: Fix the handler that recreates the GnuPG keyring for duplicity:

- In Debian Stretch it can happen that a file (the GnuPG Unix socket)
dissappears in middle of removing the directory, causing
failures. Switch to using the "rm" command instead.
1 file changed with 12 insertions and 9 deletions:
0 comments (0 inline, 0 general)
roles/backup_client/handlers/main.yml
Show inline comments
 
---
 

	
 
- name: Clean-up GnuPG keyring for import of new keys
 
  file:
 
    path: "/etc/duply/main/gnupg"
 
    state: "{{ item }}"
 
    owner: root
 
    group: root
 
    mode: 0700
 
  with_items:
 
    - absent
 
    - directory
 
  block:
 
    # Can't use file module, since one of the files (GnuPG socket)
 
    # seems to disappear in middle of operation).
 
    - command: "rm -rf /etc/duply/mian/gnupg"
 
      args:
 
        warn: false
 
    - file:
 
        path: "/etc/duply/main/gnupg"
 
        state: directory
 
        owner: root
 
        group: root
 
        mode: 0700
 

	
 
- name: Import private keys
 
  command: "{{ gnupg_binary }} --homedir /etc/duply/main/gnupg --import /etc/duply/main/private_keys.asc"
0 comments (0 inline, 0 general)