Generally I consider it an important part of play documentation though some
of these defaults can be set in ansible.cfg.

You can also set variables like "ansible_ssh_user" and "ansible_sudo"
(boolean) in variables.



On Tue, Sep 16, 2014 at 1:30 PM, Hilco Wijbenga <[email protected]>
wrote:

> Hi all,
>
> I have a "user-vars.yml" file that contains a user and password. I
> also want to set "sudo: True" and "remote_user: root". Right now I
> repeat all that per hosts entry:
>
> ---
> - hosts: all
>   vars:
>     include_vars: user-vars.yml
>   sudo: True
>   remote_user: root
>   roles:
>     - role-1
>     - role-2
> - hosts: devbox
>   vars:
>     include_vars: user-vars.yml
>   sudo: True
>   remote_user: root
>   roles:
>     - role-3
>     - role-4
>
> I tried putting the "vars", "sudo", and "remote_user" entries at a
> higher level but then Ansible complains it wants a "hosts" entry. Is
> there a way to avoid repeating this information?
>
> Cheers,
> Hilco
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAE1pOi04OVom-5C6kBWDVC%2Bfq3PmSA8UT2xQMf_Wk9LxK4mKug%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyc9uUkFF-udgT0pNpX30D338pNwTgQ1%3D0A-HYZk89DcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to