I have a playbook which has a task to runs a shell command to add a hostname and an associated random password to a secured vault. The task runs this for each host in the host file and ends up with a record for each host in the vault.
I can then run a second task to pull in, for each host, the associated info (like: id, hostname, password) 3rd task, I want to apply the password to the username of each host in my hosts file. What I don't understand is where do I store the list of random passwords that were created. Can I build a list from a task? The first command is a shell command which return success of failure. The second can call for each host (from the host inventory file) the info, hostname and password. It's like I'm looking for an additional option on the second task where I can add the hostname and password to a list. That would give me what I need for the final task to update all the passwords with a user: task and with_items. Any tips appreciated, Chris - name: "import hostname to group" shell: "/usr/local/bin/lpass import" args: stdin: "{{ lpass_fields }}\n{{ lpass_group }},{{ inventory_hostname }},{{ inventory_hostname }},'https://www.myweb.com',root,{{ lookup('password', '/dev/null chars=ascii_letters,digits length=13') }}" delegate_to: localhost register: reg_group -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/699e5b6d-5b4b-438d-ad2e-aa590e5106d4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.