There are some ansible config values that can control where the
ControlPath file is created and the remote temporary path but overall
it may be easier to use the shell module on localhost for this
- hosts: all
vars:
- new_username: badger
gather_facts: no
tasks:
- name: Auto generate user home directory
command: ssh {{ new_username }}@{{ inventory_hostname }} /usr//bin/whoami
delegate_to: localhost
Note that the above playbook assumes that your inventory_hostnames are
all resolvable to real hostnames. If that's not the case you may need
to make some modifications (for instance, create a group in the
inventory that contains the resolvable hostnames of the machines
you're interested in and use that group in the hosts: field)
-Toshio
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to
ansible...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/228dc9ac-d213-4afb-a3c1-6fffec6b06a9%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.