A
A
Anton2018-11-08 16:23:56
Ansible
Anton, 2018-11-08 16:23:56

Is it possible to include another ansible-playbook in ansible-playbook?

For example, there is an ansible-playbook that installs software (for example, installs only ELK), can you add another plabybook to this playbook (for example, in which general settings are stored, admins are created)?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Puma Thailand, 2018-11-08
@opium

There are import and include

M
mureevms, 2018-11-08
@mureevms

---
- include: playbook1.yml

- name: Install Common software
  hosts: "{{ host }}"
  gather_facts: True
  user: "{{ user }}"
  become: true
  roles:
    - role: role1
    - role: role2

- include: playbook2.yml

M
Margot_ire, 2018-11-19
@Margot_ire

Use roles for these purposes. Then it will be easier to maintain the playbook. You create two roles, you will register them in the playbook. If necessary, you can use the roles in other playbooks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question