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

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
主站蜘蛛池模板: 宝坻区| 中超| 星子县| 信宜市| 商城县| 阳西县| 宁远县| 电白县| 洪洞县| 洞头县| 油尖旺区| 英超| 当阳市| 柯坪县| 浦城县| 肥乡县| 大足县| 镶黄旗| 县级市| 曲水县| 纳雍县| 廊坊市| 垫江县| 阿瓦提县| 和龙市| 大足县| 聂荣县| 攀枝花市| 宣城市| 丰城市| 大冶市| 岳阳县| 沙坪坝区| 岑溪市| 容城县| 临猗县| 闽侯县| 克山县| 铁岭市| 樟树市| 浑源县|