-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5.yml
28 lines (23 loc) · 1.38 KB
/
5.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- # YAML document with Ansible Syntax
- name: "Learn5" # Ansible task name
hosts: servers # Ansible host list
strategy: free # Fastest execution of tasks
tasks:
- name: "Install Nginx" # Ansible task name
debug:
msg: "Installing on {{ inventory_hostname }}" # Ansible debug message
- name: "Upgrade Nginx" # Ansible task name
debug:
msg: "Upgrade {{ inventory_hostname }}" # Ansible debug message
- name: "Configure Nginx" # Ansible task name
debug:
msg: "Start {{ inventory_hostname }}" # Ansible debug message
notify: restart nginx # Notify when handler runs
changed_when: True
- name: "Verify Nginx" # Ansible task name
debug:
msg: "Verify {{ inventory_hostname }}" # Ansible debug message
handlers:
- name: restart nginx # Ansible handler name
debug:
msg: "Called Restart Handler" # Ansible debug message