码迷,mamicode.com
首页 > 其他好文 > 详细

ansible变量

时间:2018-05-19 01:18:24      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:tor   version   ups   span   contex   files   var   stat   ati   

变量的加载优先级如下:    
The order of precedence is: - play->roles->get_default_vars (if there is a play context) - group_vars_files[host] (if there is a host context) - host_vars_files[host] (if there is a host context) - host->get_vars (if there is a host context) - fact_cache[host] (if there is a host context) - play vars (if there is a play context) - play vars_files (if there‘s no host context, ignore file names that cannot be templated) - task->get_vars (if there is a task context) - vars_cache[host] (if there is a host context) - extra vars

 

hostvars:

STATIC_VARS = [
    ‘ansible_version‘,
    ‘ansible_play_hosts‘,
    ‘inventory_hostname‘,
    ‘inventory_hostname_short‘,
    ‘inventory_file‘,
    ‘inventory_dir‘,
    ‘groups‘,
    ‘group_names‘,
    ‘omit‘,
    ‘playbook_dir‘,
    ‘play_hosts‘,
    ‘role_names‘,
    ‘ungrouped‘,
]

 

ansible变量

标签:tor   version   ups   span   contex   files   var   stat   ati   

原文地址:https://www.cnblogs.com/wangl-blog/p/9058571.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!