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

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
主站蜘蛛池模板: 璧山县| 喀什市| 商丘市| 唐山市| 马公市| 亳州市| 永善县| 怀安县| 绥棱县| 长治县| 东乡| 马关县| 花垣县| 寿宁县| 鹤壁市| 庆阳市| 临沧市| 沧州市| 茂名市| 马关县| 江城| 鄢陵县| 岫岩| 乳山市| 呈贡县| 安泽县| 丰城市| 津市市| 通渭县| 崇文区| 东辽县| 宁德市| 兴山县| 麟游县| 桐庐县| 临桂县| 湛江市| 县级市| 怀来县| 镇安县| 泸西县|