I would like to define several vaulted passwords and store them in a variable, then use it to create several users with password.
variable.yml
password:
- !vault |
$ANSIBLE_VAULT;1.1;AES256
636
- !vault |
$ANSIBLE_VAULT;1.1;AES256
637
Then I want to iterate this variable in my playbook:
- name: run script
command: "python3 script.py {{ item.location }} {{ item.password }} {{ item.phrase }}"
with_items:
- { location: "{{ location }}", secret: "{{ password }}" , passphrase: "{{ sphrase }}" }
This throws an error message:
Vault format unhexlify error: Non-hexadecimal digit found