Ansible hasn't used a dollar sign for variable replacement in a long time
Try
{{ hosts }}
On Thu, Dec 4, 2014 at 2:10 AM, Wolfgang Ziegler // fago <[email protected]>
wrote:
> I figured, the variabel replacement still works fine - but for some reason
> the host groups are not forwarded to the included playbook anymore. E.g.,
> in root playbook the host is in group "mygroup", but when the included
> playbook runs for "mygroup" the host is not matched any more. The output is
> like this:
>
> PLAY ["mygroup"]
> **************************************************************
> skipping: no hosts matched
>
> 2014-12-04 10:40 GMT+01:00 Wolfgang Ziegler <[email protected]>:
>
>> Hi!
>>
>> I'm using the pattern outlined at
>> https://github.com/ansible/ansible/pull/1956 to include playbooks for a
>> limitted group of hosts. In short:
>>
>> ---
>> # configure-webservers.yaml
>> - name: configure the webservers
>> hosts: webservers:&$hosts tasks: ...
>>
>> ---
>> # Configure staging server
>> - include: configure-webservers.yaml hosts=staging
>>
>>
>>
>>
>> However, this stopped working when upgrading to ansible 1.8.1. Is this a
>> bug, or is passing variables to playbook includes like that not supported
>> any more?
>>
>> If it's not supported any more, any other suggestions on how to do this?
>>
>> My use case is a rather general provising playbook - including multiple
>> roles and possibly some custom tasks - which I want to be able to
>> dynamically apply to some hosts from a playbook run. It shouldn't apply to
>> "all" hosts though.
>>
>> Best regards,
>> Wolfgang
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/ansible-project/c8bdwPtR640/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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/03e0501f-ade6-4a4d-ae3a-59cc9eba118c%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/03e0501f-ade6-4a4d-ae3a-59cc9eba118c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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/CAL0uX3SK3kNtTAnaocPFQ7moBDUEhat6NbZ66w2Pr3_3SN9EBw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAL0uX3SK3kNtTAnaocPFQ7moBDUEhat6NbZ66w2Pr3_3SN9EBw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> 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%2BnsWgzAcomRm%2BKQSDbjyx8XoWU%3Dz2_zgFrKODLYoOK47S0UgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.