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

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.

主站蜘蛛池模板: 鹤岗市| 墨脱县| 弋阳县| 拜城县| 宁强县| 广德县| 阿城市| 彩票| 雅安市| 调兵山市| 嘉义县| 福泉市| 克山县| 扶绥县| 辽中县| 都兰县| 十堰市| 辽阳县| 黄梅县| 安塞县| 公安县| 资阳市| 金沙县| 禄丰县| 辛集市| 句容市| 瑞丽市| 陇川县| 曲水县| 弥渡县| 宾阳县| 澳门| 侯马市| 泸溪县| 潜江市| 溆浦县| 兴义市| 樟树市| 云林县| 会泽县| 湘潭市|