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

后端 未结 10 2282
谎友^
谎友^ 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:44

    https://github.com/f500/ansible-dumpall
    FYI: this github project shows you how to list 90% of variables across all hosts. I find it more globally useful than single host commands. The README includes instructions for building a simple inventory report. It's even more valuable to run this at the end of a playbook to see all the Facts. To also debug Task behaviour use register:

    The result is missing a few items: - included YAML file variables - extra-vars - a number of the Ansible internal vars described here: Ansible Behavioural Params

提交回复
热议问题