Using patterns to populate host properties in Ansible inventory file

前端 未结 2 1772
心在旅途
心在旅途 2021-01-15 06:22

I have a host file that looks like

[foo]
foox 192.168.0.1 id=1
fooy 192.168.0.1 id=2
fooz 192.168.0.1 id=3

However, I\'d like to more conci

2条回答
  •  温柔的废话
    2021-01-15 07:25

    This is best done using Ansible's Dynamic Inventory features. See Developing Dynamic Inventory Sources.

    This means writing a script that returns your hostname in a JSON format.

提交回复
热议问题