How to include vars file in a vars file with ansible?

后端 未结 3 1345
梦毁少年i
梦毁少年i 2021-02-03 17:49

Is it possible to include a vars file in Ansible into another vars file dynamically?

I.e. I have vars file:

---
definitions:
- { product: web_v2, suite:         


        
3条回答
  •  被撕碎了的回忆
    2021-02-03 18:17

    You can put your servers in the default_step group and those vars will apply to it:

    # inventory file
    [default_step]
    prod2
    web_v2
    

    Then just move your default_step.yml file to group_vars/default_step.yml.

提交回复
热议问题