官术网_书友最值得收藏!

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
主站蜘蛛池模板: 兴文县| 海城市| 信阳市| 建湖县| 宁阳县| 安陆市| 柳州市| 大邑县| 永福县| 义乌市| 襄樊市| 台安县| 泸水县| 鄂州市| 北京市| 南雄市| 沈阳市| 平塘县| 云霄县| 裕民县| 花莲县| 色达县| 乌拉特中旗| 鄂托克旗| 南投县| 临朐县| 英德市| 辛集市| 嘉荫县| 隆回县| 玉田县| 宜兴市| 南昌县| 张家界市| 闻喜县| 深州市| 甘孜县| 宁化县| 都安| 曲阜市| 广昌县|