markdown Ansible变量优先级(顺序,层次结构)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Ansible变量优先级(顺序,层次结构)相关的知识,希望对你有一定的参考价值。

# Ansible variable precedence

Source: http://docs.ansible.com/ansible/latest/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable

### From least to most important

- role defaults
- inventory file or script group vars
- inventory group_vars/all
- playbook group_vars/all
- inventory group_vars/*
- playbook group_vars/*
- inventory file or script host vars
- inventory host_vars/*
- playbook host_vars/*
- host facts
- play vars
- play vars_prompt
- play vars_files
- role vars (defined in role/vars/main.yml)
- block vars (only for tasks in block)
- task vars (only for the task)
- role (and include_role) params
- include params
- include_vars
- set_facts / registered vars
- extra vars (always win precedence)

以上是关于markdown Ansible变量优先级(顺序,层次结构)的主要内容,如果未能解决你的问题,请参考以下文章

Ansible相关文件和常用模块

Ansible PlayBook的中清单变量优先级分析及清单变量如何分离总结

Ansible 中变量及加密

ansible内置主机变量与魔法变量

ansible 流程控制

ansible 流程控制