On Sat, 29 Feb 2020 00:48:45 -0800 (PST) Dave York <[email protected]> wrote:
> - hosts: localhost
> connection: local
> gather_facts: yes
>
> tasks:
> - name: Generate a temporary random password for template/os customization
> set_fact:
> randopass:
> "{{ lookup('password', '/dev/null length=24 chars=ascii_letters') }}"
Instead of "hosts: localhost" run the play with "hosts: staging" and limit
the fork to "run_once: true". For example
- hosts: staging
tasks:
- name: Generate a temporary random password for template/os customization
set_fact:
randopass: ...
run_once: true
This way the variable "randopass" will be defined in the "hostvars" of all
hosts in the group staging.
HTH,
-vlado
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/20200229102810.61bc4986%40gmail.com.
pgpVz7T3SmbiT.pgp
Description: OpenPGP digital signature
