Skip to content

Suggestion regarding main.yml file #21

@rlopez133

Description

@rlopez133

Suggestion so totally up to you, but one thing I like to do is use the main.yml file to just call other yml files. This allows you to organize the files and modularize the different set of tasks based upon what they are doing.

For example,

$ cat main.yml

---
- include_tasks: 10_validation.yml
- include_tasks: 20_subs.yml
.
.
.
$ cat 10_validation.yml

---
- name: Check ansible version
  ansible.builtin.fail:
    msg: Use Ansible version 2.9 or greater to run this playbook
  when: ansible_version.full is version('2.9.0', '<')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions