mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-16 22:42:24 +00:00
Use ansible_facts variable
Without this change the "Import variables specific to distribution" tasks fail with "Could not find file on the Ansible Controller..." on environments with inject facts disabled. This changes the tests to run with ansible with inject_facts_as_vars = false and fixes other roles and playbooks.
This commit is contained in:
@@ -57,18 +57,18 @@
|
||||
register: result
|
||||
failed_when: result.vault.data != 'Hello World.' or result.changed
|
||||
|
||||
- name: Retrieve data from standard vault into file {{ ansible_env.HOME }}/data.txt.
|
||||
- name: Retrieve data from standard vault into file {{ ansible_facts['env'].HOME }}/data.txt.
|
||||
ipavault:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
name: stdvault
|
||||
out: "{{ ansible_env.HOME }}/data.txt"
|
||||
out: "{{ ansible_facts['env'].HOME }}/data.txt"
|
||||
state: retrieved
|
||||
register: result
|
||||
failed_when: result.changed or result.failed or (result.vault.data | default(false))
|
||||
|
||||
- name: Verify retrieved data.
|
||||
slurp:
|
||||
src: "{{ ansible_env.HOME }}/data.txt"
|
||||
src: "{{ ansible_facts['env'].HOME }}/data.txt"
|
||||
register: slurpfile
|
||||
failed_when: slurpfile['content'] | b64decode != 'Hello World.'
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
name: stdvault
|
||||
vault_type: standard
|
||||
in: "{{ ansible_env.HOME }}/in.txt"
|
||||
in: "{{ ansible_facts['env'].HOME }}/in.txt"
|
||||
register: result
|
||||
failed_when: not result.changed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user