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

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
主站蜘蛛池模板: 贡嘎县| 寿宁县| 如东县| 横山县| 河间市| 密山市| 土默特右旗| 德钦县| 沾益县| 临城县| 庆城县| 东阿县| 集安市| 嘉义县| 嘉鱼县| 绵竹市| 普陀区| 永新县| 宁强县| 胶州市| 鄂尔多斯市| 昌吉市| 闻喜县| 牡丹江市| 丰顺县| 雅安市| 岳西县| 麟游县| 宽城| 阿克陶县| 仲巴县| 西乌珠穆沁旗| 教育| 玉林市| 平泉县| 南乐县| 公主岭市| 双牌县| 张家口市| 扶风县| 剑河县|