On 26.03.19 13:01, 'Uffi Schnuffi' via Ansible Project wrote:
> This is no longer working with the new `import_playbook` module.
>
> Is there a recommended way to achieve this (i.e. limiting hosts for an
> imported playbook?). I have not found a way as of yet.
---
- import_playbook: test.yaml
vars:
myhosts: plonk
---
- name: Test playbook
hosts: all:&{{ myhosts }}
tasks:
- name: test var
debug:
msg: "GOOOOOOO"
works for me.
See:
https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.7.html#include-tasks-import-tasks-inline-variables
Sebastian
>>> <javascript:>>
>>>> wrote:
>>>>
>>>>> I think you can try this
>>>>>
>>>>>
>>>
https://groups.google.com/forum/#!msg/ansible-project/qfoeqytbRE4/SI58rlzeEwMJ
>>>>>
>>>>> If you ever need some exception (all in this group except XX) you can
>>>>> use
>>>>> hosts: group1:!except_this_group
>>>>>
>>>>>
>>>>> On Thursday, January 31, 2013 11:26:22 PM UTC-5, Lorin Hochstein wrote:
>>>>>>
>>>>>> When including a playbook in another playbook, is there any way to
>>>>>> limit
>>>>>> the hosts in the child playbook?
>>>>>>
>>>>>> For example, if I had an existing playbook (e.g.,
>>>>>> "configure-widget.yaml") that had its hosts set to "webservers", and I
>>>>>> wanted to write a playbook that only applied to the staging web
>>> server,
>>>>>> is
>>>>>> there any way to do something like:
>>>>>>
>>>>>> - include: configure-widget.yaml limit-hosts=staging
>>>>>>
>>>>>>
>>>>>> Lorin
>>>>>>
>>>>> --
>>>>> 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 <javascript:>.
>>>>> For more options, visit
https://groups.google.com/groups/opt_out.
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Lorin Hochstein
>>>> Lead Architect - Cloud Services
>>>> Nimbis Services, Inc.
>>>>
www.nimbisservices.com
>>>>
>>>> --
>>>> 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 <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
ansible-proje...@googlegroups.com <javascript:>.
Sebastian Meyer
Linux Consultant & Trainer
Tel.:
+49-172-2057471
Mail:
me...@b1-systems.de
B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg /
http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537