官术网_书友最值得收藏!

Variables

Most playbooks and roles will make use of variables; these variables can be overridden in several ways. The simplest way is to create files in the host_vars and groups_vars folders, these allow you to override variables either based on the host or group membership, respectively. For this, perform the following steps:

  1. Create a directory /etc/ansible/group_vars.
  2. Create a file in group_vars named mons. Add the following in mons:
       a_variable: "foo"
  1. Create a file in group_vars named osds. Add the following in osds:
       a_variable: "bar"

Variables follow a precedence order; you can also create an all file, which will apply to all groups. However, a variable of the same name that is in a more specific matching group will override it. The Ceph Ansible modules make use of this to allow you to have a set of default variables and then also allow you to specify different values for the specific roles.

主站蜘蛛池模板: 宁强县| 哈巴河县| 资兴市| 新密市| 普洱| 柳河县| 青阳县| 蕉岭县| 大竹县| 娱乐| 靖宇县| 龙游县| 抚松县| 嘉义县| 游戏| 桐乡市| 延吉市| 武夷山市| 东至县| 霍林郭勒市| 微山县| 侯马市| 屏东市| 吴川市| 黎川县| 凤山市| 延安市| 信宜市| 西充县| 玉环县| 梁河县| 汝阳县| 高清| 台山市| 玛多县| 东丰县| 化州市| 石嘴山市| 萍乡市| 荔浦县| 习水县|