- name: Test Connections to my servers
hosts: all become: yes
tasks: - name: Ping my servers ping:
Playbook установка httpd
- name: install default apache webserver
hosts : all become: yes
tasks: - name: install apache webserver yum: name=httpd state=latest
service: name=httpd state=started enabled=yes
Playbook - установка httpd с хендлерами
- name : install apache and upload web page
hosts: all become: yes
vars: source_file: ./mysite/index.html dest_file : /var/www/html
tasks: - name: Install Apache yum: name=httpd state=latest
copy: src={{ source_file }} dest={{dest_file}} notify: restart apache
service: name=httpd state=started enabled=yes
handlers: - name : restart apache service: name=httpd state=restarted