Инструменты пользователя

Инструменты сайта


playbooks

Playbook-ping

- 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
  1. name: start and enable apache
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 
  1. name: copy content
copy: src={{ source_file }} dest={{dest_file}}
notify: restart apache
  1. name: start and enable httpd
service: name=httpd state=started enabled=yes 
handlers:
- name : restart apache
  service: name=httpd state=restarted 
playbooks.txt · Последнее изменение: 2020/01/17 15:36 (внешнее изменение)

DokuWiki Appliance - Powered by TurnKey Linux