Where can I get a list of Ansible pre-defined variables?

后端 未结 10 2283
谎友^
谎友^ 2020-12-04 05:15

I see that Ansible provide some pre-defined variables that we can use in playbooks and template files. For example, the host ip address is ansible_eth0.ipv4.address. Googlei

10条回答
  •  醉梦人生
    2020-12-04 05:36

    Some variables are not available on every host, e.g. ansible_domain and domain. If the situation needs to be debugged, I login to the server and issue:

    user@server:~$ ansible -m setup localhost | grep domain
     [WARNING]: provided hosts list is empty, only localhost is available
        "ansible_domain": "prd.example.com",
    

提交回复
热议问题