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

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
主站蜘蛛池模板: 鄂尔多斯市| 长乐市| 商南县| 寿阳县| 沾益县| 五家渠市| 合江县| 定兴县| 铜梁县| 兴安盟| 临澧县| 奈曼旗| 龙游县| 卓尼县| 南召县| 察隅县| 岢岚县| 奉贤区| 通州区| 汶上县| 徐水县| 丰县| 耒阳市| 乌审旗| 丰原市| 赤壁市| 开江县| 万安县| 澄江县| 新龙县| 青铜峡市| 靖边县| 甘泉县| 体育| 乾安县| 荣成市| 堆龙德庆县| 哈巴河县| 和龙市| 孟连| 玛纳斯县|