diff --git a/roles/debian-base/tasks/bacula.yml b/roles/debian-base/tasks/bacula.yml index de9a3b4..3958dbd 100644 --- a/roles/debian-base/tasks/bacula.yml +++ b/roles/debian-base/tasks/bacula.yml @@ -7,15 +7,18 @@ src: /etc/bacula/common_default_passwords register: file_content - name: Going to text plane + no_log: true set_fact: file_content_decoded: "{{ file_content.content | b64decode }}" - name: Extracting passwords + no_log: true set_fact: passwords: "{{ file_content_decoded.splitlines() | select('match', '^[^#]') | map('regex_replace', '^([^=]+)=(.+)$', '\\1:\\2') | list }}" - name: Initialize password dictionary set_fact: bacula_passwords: {} - name: Convert lines to individual variables generating a new dict + no_log: true set_fact: bacula_passwords: "{{ bacula_passwords | combine({item.split(':')[0].lower(): item.split(':')[1] | regex_replace('\\n$', '') }) }}" loop: "{{ passwords }}"