From 3033c2f02b488ff9a629e8d7041fedd394f59bb4 Mon Sep 17 00:00:00 2001 From: ace Date: Fri, 10 Feb 2023 14:00:34 +0300 Subject: [PATCH] pwgen: fix docker output --- roles/pwgen/tasks/htpasswd.yaml | 2 +- roles/pwgen/tasks/passwords.yaml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/pwgen/tasks/htpasswd.yaml b/roles/pwgen/tasks/htpasswd.yaml index 2c43997..23f6395 100644 --- a/roles/pwgen/tasks/htpasswd.yaml +++ b/roles/pwgen/tasks/htpasswd.yaml @@ -42,5 +42,5 @@ - name: Write htpasswd hash for {{ item.name }} lineinfile: path: "{{ inventory_dir }}/group_vars/all/passwords.yaml" - line: "{{ item.name }}_htpasswd_hash: \"{{ docker_container_output.ansible_facts.docker_container.Output.split('\n')[0].split(':')[1] }}\"" + line: "{{ item.name }}_htpasswd_hash: \"{{ docker_container_output.container.Output.split('\n')[0].split(':')[1] }}\"" when: htpasswd_hash_test_grep.stdout == '0' diff --git a/roles/pwgen/tasks/passwords.yaml b/roles/pwgen/tasks/passwords.yaml index 1a46ba3..cd6a51d 100644 --- a/roles/pwgen/tasks/passwords.yaml +++ b/roles/pwgen/tasks/passwords.yaml @@ -28,6 +28,9 @@ register: docker_container_output when: pbkdf2_sha512_hash_test_grep.stdout == '0' +- debug: + msg: "{{ docker_container_output }}" + - name: Show docker_container_output for {{ item.name }} debug: msg: "{{ docker_container_output }}" @@ -42,5 +45,5 @@ - name: Write PBKDF2-SHA512 hash for {{ item.name }} lineinfile: path: "{{ inventory_dir }}/group_vars/all/passwords.yaml" - line: "{{ item.name }}_pbkdf2_sha512_hash: \"{{ docker_container_output.ansible_facts.docker_container.Output.split('\n')[0] }}\"" + line: "{{ item.name }}_pbkdf2_sha512_hash: \"{{ docker_container_output.container.Output.split('\n')[0] }}\"" when: pbkdf2_sha512_hash_test_grep.stdout == '0'