how to Import multiple Playbooks into one single playbook

31 views
Skip to first unread message

mahesh g o

unread,
Apr 3, 2020, 10:05:49 AM4/3/20
to Ansible Project
I have 8 playbooks. how do i import all 8 playbooks in 1 playbook.

below is the one of the playbook: which created 4 SVM's with fcp protocol , I have 7 more playbooks which each creates 4 svm's with different protocol. I want it to run one after the another.

Playbook 1 which creates 4 svm's with fcp protocol
- hosts: localhost
  gather_facts: false
  vars_files:
    - /etc/ansible/group_vars/host_vars
  tasks:
    - name: Create SVM
      na_ontap_svm:
        state: present
        name: "systemic_fcp_{{item}}"
        root_volume: "systemic_fcp_aggr8svm{{item}}_root"
        root_volume_aggregate: sti49_vsim_ucs100f_aggr1
        allowed_protocols: fcp
        root_volume_security_style: mixed
        hostname: "{{ aiqumip }}"
        username: "{{ aiqumusername }}"
        password: "{{ aiqumpassword }}"
        https: false
      with_sequence: start=1 end=4

Stefan Hornburg (Racke)

unread,
Apr 3, 2020, 10:09:51 AM4/3/20
to ansible...@googlegroups.com
On 4/3/20 4:05 PM, mahesh g o wrote:
> I have 8 playbooks. how do i import all 8 playbooks in 1 playbook.
>
> below is the one of the playbook: which created 4 SVM's with fcp protocol , I have 7 more playbooks which each creates 4
> svm's with different protocol. I want it to run one after the another.

So what are the differences between the protocols in all your playbooks? It isn't really useful when you post just one
playbook as example.

Regards
Racke

>
> Playbook 1 which creates 4 svm's with fcp protocol
> - hosts: localhost
>   gather_facts: false
>   vars_files:
>     - /etc/ansible/group_vars/host_vars
>   tasks:
>     - name: Create SVM
>       na_ontap_svm:
>         state: present
>         name: "systemic_fcp_{{item}}"
>         root_volume: "systemic_fcp_aggr8svm{{item}}_root"
>         root_volume_aggregate: sti49_vsim_ucs100f_aggr1
>         allowed_protocols: fcp
>         root_volume_security_style: mixed
>         hostname: "{{ aiqumip }}"
>         username: "{{ aiqumusername }}"
>         password: "{{ aiqumpassword }}"
>         https: false
>       with_sequence: start=1 end=4
>
> --
> 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 <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/7191e615-7b58-4826-9056-898c6bc125f5%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/7191e615-7b58-4826-9056-898c6bc125f5%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc

mahesh g o

unread,
Apr 3, 2020, 10:26:08 AM4/3/20
to Ansible Project
Hi,

we will be  creating volumes on vservers, so that we can access those volumes based on vserver protocols.

The first playbook i shared is fcp protocol and this is iscsi protocol, similarly i have 6 more protocols. for which i have created playbooks.

currently i am running  all 8 playbooks one after the another.

My requirement is : can I one master playbook where i can import all 8 playbooks. instead of 8 playbooks running individually.

i want have 1 playbook which imports all 8 playbooks.


name: vserver create with iscsi protocl
         na_ontap_svm:
        state: present
        name: "systemic_iscsi_{{item}}"
        root_volume: "systemic_iscsi_aggr8svm{{item}}_root"
        root_volume_aggregate: sti49_vsim_ucs100e_aggr1
        allowed_protocols: iscsi
Reply all
Reply to author
Forward
0 new messages