- Mastering Ceph
- Nick Fisk
- 154字
- 2021-07-09 19:55:14
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:
- Create a directory /etc/ansible/group_vars.
- Create a file in group_vars named mons. Add the following in mons:
a_variable: "foo"
- 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.
推薦閱讀
- Ansible Quick Start Guide
- 并行數(shù)據(jù)挖掘及性能優(yōu)化:關(guān)聯(lián)規(guī)則與數(shù)據(jù)相關(guān)性分析
- 物聯(lián)網(wǎng)與云計算
- 大數(shù)據(jù)處理平臺
- 自動控制理論(非自動化專業(yè))
- 運動控制器與交流伺服系統(tǒng)的調(diào)試和應(yīng)用
- 內(nèi)模控制及其應(yīng)用
- Linux系統(tǒng)下C程序開發(fā)詳解
- Web璀璨:Silverlight應(yīng)用技術(shù)完全指南
- Visual Basic項目開發(fā)案例精粹
- 中老年人學(xué)電腦與上網(wǎng)
- 精通ROS機器人編程(原書第2版)
- Microsoft System Center Data Protection Manager Cookbook
- Hands-On Agile Software Development with JIRA
- Java Deep Learning Projects