- 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
推薦閱讀
- 大學(xué)計算機基礎(chǔ):基礎(chǔ)理論篇
- 智能傳感器技術(shù)與應(yīng)用
- 高性能混合信號ARM:ADuC7xxx原理與應(yīng)用開發(fā)
- 計算機圖形圖像處理:Photoshop CS3
- Zabbix Network Monitoring(Second Edition)
- 工業(yè)機器人工程應(yīng)用虛擬仿真教程:MotoSim EG-VRC
- Photoshop CS3圖像處理融會貫通
- Ruby on Rails敏捷開發(fā)最佳實踐
- INSTANT Drools Starter
- Storm應(yīng)用實踐:實時事務(wù)處理之策略
- 激光選區(qū)熔化3D打印技術(shù)
- 工業(yè)機器人實操進階手冊
- AMK伺服控制系統(tǒng)原理及應(yīng)用
- Deep Learning Essentials
- Apache Spark Quick Start Guide