- Mastering OpenStack(Second Edition)
- Omar Khedher Chandan Dutta Chowdhury
- 99字
- 2021-07-02 23:52:47
Playbooks
Playbooks are the main configuration files in Ansible. They describe the complete system deployment plan. Playbooks are composed of a series of tasks and are executed from top to bottom. The tasks themselves refer to group of hosts that must be deployed with roles. Ansible playbooks are written in YAML.
The following is an example of a simple Ansible playbook:
---
- hosts: webservers
vars:
http_port: 8080
remote_user: root
tasks:
- name: ensure apache is at the latest version
yum: name=httpd state=latest
- name: write the apache config file
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
notify:
- restart apache
handlers:
- name: restart apache
service: name=httpd state=restarted
推薦閱讀
- Word 2003、Excel 2003、PowerPoint 2003上機指導(dǎo)與練習(xí)
- ABB工業(yè)機器人編程全集
- 三菱FX3U/5U PLC從入門到精通
- 計算機圖形學(xué)
- Windows環(huán)境下32位匯編語言程序設(shè)計
- Windows 7寶典
- Troubleshooting OpenVPN
- 單片機C語言應(yīng)用100例
- DevOps Bootcamp
- LMMS:A Complete Guide to Dance Music Production Beginner's Guide
- 手機游戲策劃設(shè)計
- Artificial Intelligence By Example
- Web璀璨:Silverlight應(yīng)用技術(shù)完全指南
- 計算機應(yīng)用基礎(chǔ)實訓(xùn)(職業(yè)模塊)
- Natural Language Processing and Computational Linguistics