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

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.

主站蜘蛛池模板: 信宜市| 南丰县| 津南区| 安岳县| 郁南县| 定州市| 竹山县| 金门县| 上蔡县| 东方市| 三门峡市| 大荔县| 荥经县| 辽源市| 子长县| 邳州市| 资溪县| 隆昌县| 府谷县| 老河口市| 广平县| 井陉县| 阳泉市| 霍州市| 海门市| 黑河市| 莒南县| 多伦县| 垦利县| 石屏县| 沁水县| 山东| 高青县| 新密市| 达孜县| 金昌市| 兴城市| 巩留县| 基隆市| 年辖:市辖区| 温州市|