-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinclude.yml
More file actions
81 lines (46 loc) · 1.1 KB
/
Copy pathinclude.yml
File metadata and controls
81 lines (46 loc) · 1.1 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
- name: testing includes
hosts: all
sudo: yes
tasks:
- include: apache.yml
- include: content.yml
- include: create_folder.yml
- include: content.yml
- include: nginx.yml
...
#apache.yml
---
- name: install apache2
apt: name=apache2 update_cache=yes state=latest
- name: displaying message
debug: msg="you are awesome!!"
...
#create_folder.yml
---
- name: creating folder
file: path=/home/ubuntu/folder1 state=directory
...
#content.yml
---
- name: list contents of directory in host
command: ls /home/ubuntu
register: contents
- name: check dir is empty
debug: msg="Directory is empty"
when: contents.stdout == ""
- name: check dir has contents
debug: msg="Directory is not empty"
when: contents.stdout != ""
...
#nginx.yml
---
- name: installing nginx
hosts: all
sudo: yes
tasks:
- name: install nginx
apt: name=nginx update_cache=yes state=latest
- name: displaying message
debug: msg="yayy!! nginx installed"
...