- Mastering Ceph
- Nick Fisk
- 189字
- 2021-07-09 19:55:15
A very simple playbook
To demonstrate how playbooks work, the following example will show a small playbook that also makes use of the variables we configured earlier:
- hosts: mon1 osd1
tasks:
- name: Echo Variables
debug: msg="I am a {{ a_variable }}"
Now run the playbook. Note the command to run a playbook that differs from running ad hoc Ansible commands:
$ ansible-playbook /etc/ansible/playbook.yml
The preceding command gives the following output:

The output shows the playbook being executed on both mon1 and osd1 as they are in groups, which are children of the parent group ceph. Also, note how the output is different between the two servers as they are picking up the variables that you set earlier in the group_vars directory.
Finally, the last couple of lines show the overall run status of the playbook run. You can now destroy your Vagrant environment again, ready for the next section:
vagrant destroy --force
This concludes the introduction to Ansible, but it is not a complete guide. It's recommended that you should explore other resources to gain a more in-depth knowledge of Ansible before using it in a production environment.
- PowerShell 3.0 Advanced Administration Handbook
- 網(wǎng)頁(yè)編程技術(shù)
- 條碼技術(shù)及應(yīng)用
- 21天學(xué)通Visual Basic
- Splunk Operational Intelligence Cookbook
- 悟透AutoCAD 2009完全自學(xué)手冊(cè)
- 基于Xilinx ISE的FPAG/CPLD設(shè)計(jì)與應(yīng)用
- 空間站多臂機(jī)器人運(yùn)動(dòng)控制研究
- RedHat Linux用戶基礎(chǔ)
- Salesforce for Beginners
- 從零開始學(xué)PHP
- Pentaho Analytics for MongoDB
- 算法設(shè)計(jì)與分析
- 大型機(jī)系統(tǒng)應(yīng)用基礎(chǔ)
- 中文版Photoshop情境實(shí)訓(xùn)教程