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

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


playbooks

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
playbooks [2020/01/17 12:34]
kirill
playbooks [2020/01/17 15:36] (текущий)
Строка 1: Строка 1:
 +Playbook-ping
 +---
 - name: Test Connections to my servers  - name: Test Connections to my servers 
   hosts: all    hosts: all 
Строка 8: Строка 10:
   - name: Ping my servers    - name: Ping my servers 
     ping:     ping:
 +
 +
 +
 +
 +Playbook установка httpd 
 +
 +---
 +- name: install default apache webserver 
 +  hosts : all 
 +  become: yes 
 +
 +
 +
 +  tasks:
 +  - name: install apache webserver
 +    yum: name=httpd state=latest
 +  
 +
 +  - 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 
 + 
 +
 +  - name: copy content 
 +    copy: src={{ source_file }} dest={{dest_file}}
 +    notify: restart apache
 +
 +  - name: start and enable httpd 
 +    service: name=httpd state=started enabled=yes 
 +
 +
 +
 +  handlers:
 +  - name : restart apache
 +    service: name=httpd state=restarted 
 +
 +
 +
 +
 +    
 +
playbooks.1579264459.txt.gz · Последнее изменение: 2020/01/17 15:34 (внешнее изменение)

DokuWiki Appliance - Powered by TurnKey Linux