Ansible - read inventory hosts and variables to group_vars/all file

前端 未结 7 1799
醉酒成梦
醉酒成梦 2020-12-23 11:47

I have a dummy doubt that keeps me stuck for a long time. I have a very banal inventory file with hosts and variables:

[lb]
10.112.84.122

[tomcat]
10.112.84         


        
7条回答
  •  礼貌的吻别
    2020-12-23 12:26

    If you want to refer one host define under /etc/ansible/host in a task or role, the bellow link might help:

    https://www.middlewareinventory.com/blog/ansible-get-ip-address/

提交回复
热议问题