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

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

    I know this question has been answered already, but I feel like there are a whole other set of pre-defined variables not covered by the ansible_* facts. This documentation page covers the directives (variables that modify Ansible's behavior), which I was looking for when I came across this page.

    This includes some common and some specific use-case directives:

    • become: Controls privilege escalation (sudo)
    • delegate_to: run task on another host (like running on localhost)
    • serial: allows you to run a play across a specific number/percentage of hosts before moving onto next set

提交回复
热议问题