@Scott, thanks. Trial and error told me that way too.

On Friday, February 21, 2014 10:59:36 PM UTC+3, Scott Sturdivant wrote:
>
> Change to default('localhost').
>
>
> On Fri, Feb 21, 2014 at 12:56 PM, anatoly techtonik 
> <[email protected]<javascript:>
> > 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] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> 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.

Reply via email to