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

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.

主站蜘蛛池模板: 阿拉尔市| 观塘区| 盈江县| 申扎县| 石家庄市| 新巴尔虎右旗| 武城县| 汶上县| 旌德县| 故城县| 肥东县| 巴彦县| 自贡市| 余姚市| 高雄县| 龙里县| 闽清县| 广安市| 岳西县| 蒙自县| 霍山县| 桐梓县| 连山| 苍山县| 色达县| 信宜市| 宕昌县| 温州市| 内乡县| 喜德县| 从江县| 贡觉县| 垫江县| 谷城县| 远安县| 灌阳县| 石首市| 阳信县| 泗洪县| 商都县| 平果县|