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

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
主站蜘蛛池模板: 永春县| 兖州市| 金平| 偃师市| 灵寿县| 辽源市| 丹东市| 屯留县| 敖汉旗| 大宁县| 扶绥县| 彭州市| 芦山县| 怀化市| 于都县| 凤台县| 娱乐| 青铜峡市| 封开县| 巨鹿县| 健康| 利津县| 策勒县| 凤庆县| 南城县| 安福县| 台北市| 宿州市| 沙田区| 神池县| 昭觉县| 西藏| 七台河市| 聂拉木县| 定州市| 云和县| 潢川县| 河间市| 霍山县| 电白县| 山阴县|