- 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
推薦閱讀
- Oracle SOA Governance 11g Implementation
- Visual FoxPro 6.0數據庫與程序設計
- iClone 4.31 3D Animation Beginner's Guide
- 具比例時滯遞歸神經網絡的穩定性及其仿真與應用
- Ruby on Rails敏捷開發最佳實踐
- Blender 3D Printing by Example
- 菜鳥起飛系統安裝與重裝
- Excel 2007常見技法與行業應用實例精講
- Dreamweaver CS6精彩網頁制作與網站建設
- 網絡存儲·數據備份與還原
- 21天學通Linux嵌入式開發
- Mastering Predictive Analytics with scikit:learn and TensorFlow
- 傳感器原理與工程應用
- Cortex-M3嵌入式處理器原理與應用
- 智能控制技術及其應用