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
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
> 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:
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:
>
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