Re: [ansible-project] How do I include another playbook in current playbook?

2020-02-11 Thread Xinhuan Zheng
Hello Alicia, This is great. I got the idea. Thanks for your help! - Xinhuan On Thursday, January 23, 2020 at 12:33:57 PM UTC-5, alicia wrote: > > You cannot import a playbook anywhere inside a play - importing a playbook > is a play of its own. > > If you want to run the imported playbook fir

Re: [ansible-project] How do I include another playbook in current playbook?

2020-01-23 Thread alicia
You cannot import a playbook anywhere inside a play - importing a playbook is a play of its own. If you want to run the imported playbook first, try: - name: this play runs ‘another.yml' on the hosts it defines import_playbook: another.yml - name: this play runs two roles on all hosts in the

Re: [ansible-project] How do I include another playbook in current playbook?

2020-01-22 Thread Xinhuan Zheng
> Take a look again at the example in > https://docs.ansible.com/ansible/latest/modules/import_playbook_module.html. > > To me it does not know where > > > roles: > - role: testrole1 > tags: testrole1 > > belongs. Should it be > > - hosts: mywebservers > gather_facts:

Re: [ansible-project] How do I include another playbook in current playbook?

2020-01-22 Thread Mauricio Tavares
On Wed, Jan 22, 2020 at 3:47 PM Xinhuan Zheng wrote: > > Hello, > > I created a playbook which needs to call another playbook. This is my current > playbook: > > --- > # file: current_playbook.yml > > - hosts: mywebservers > gather_facts: yes > > #- import_playbook: another.yml > > roles: >

[ansible-project] How do I include another playbook in current playbook?

2020-01-22 Thread Xinhuan Zheng
Hello, I created a playbook which needs to call another playbook. This is my current playbook: --- # file: current_playbook.yml - hosts: mywebservers gather_facts: yes #- import_playbook: another.yml roles: - role: testrole1 tags: testrole1 post_tasks: - name: Install con