- 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.
推薦閱讀
- Splunk 7 Essentials(Third Edition)
- Getting Started with Oracle SOA B2B Integration:A Hands-On Tutorial
- Dreamweaver 8中文版商業案例精粹
- Zabbix Network Monitoring(Second Edition)
- 21天學通ASP.NET
- 最簡數據挖掘
- Moodle Course Design Best Practices
- 信息物理系統(CPS)測試與評價技術
- 經典Java EE企業應用實戰
- Ansible 2 Cloud Automation Cookbook
- Linux系統下C程序開發詳解
- 工業機器人集成應用
- 電氣控制及Micro800 PLC程序設計
- 菜鳥起飛電腦組裝·維護與故障排查
- 西門子S7-1200/1500 PLC從入門到精通