- 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.
推薦閱讀
- WOW!Illustrator CS6完全自學寶典
- MicroPython Projects
- Python Algorithmic Trading Cookbook
- STM32G4入門與電機控制實戰:基于X-CUBE-MCSDK的無刷直流電機與永磁同步電機控制實現
- 大學計算機應用基礎
- Supervised Machine Learning with Python
- 菜鳥起飛系統安裝與重裝
- 自動化生產線安裝與調試(三菱FX系列)(第二版)
- SQL Server數據庫應用基礎(第2版)
- 重估:人工智能與賦能社會
- Web璀璨:Silverlight應用技術完全指南
- Hands-On DevOps
- RealFlow流體制作經典實例解析
- Serverless Design Patterns and Best Practices
- DynamoDB Applied Design Patterns