Change to default('localhost').
On Fri, Feb 21, 2014 at 12:56 PM, anatoly techtonik <[email protected]>wrote:
> I try to set default value for hosts field in playbook with Jinja2 filter,
> but it doesn't work:
>
> ---
>> - hosts: "{{ host | default(localhost) }}"
>> tasks:
>> - name: show OS version info
>> debug: msg="{{ansible_distribution}} {{ansible_distribution_version}}"
>
>
> # ansible-playbook -i hosts dist.yml
>
> PLAY [{{host | default(localhost)}}]
> ******************************************
> skipping: no hosts matched
>
>
> But when I execute it with command line parameter, it works ok:
>
> # ansible-playbook -i hosts dist.yml --extra-vars 'host=localhost'
>
> PLAY [localhost]
> **************************************************************
> ...
>
>
> ???
>
> --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
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].
For more options, visit https://groups.google.com/groups/opt_out.