File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Create a VARS section inside the playbook to define VARIABLES
2
+ # THE PALYBOOK IS RUN FROM TOP TO BOTTOM
3
+ -> So then the VARS section should be next to the top
4
+ -> KEY:VALUE
5
+
6
+ - hosts: appserver
7
+ vars:
8
+ control_server: localhost
9
+ web_root: /var/www/html/
10
+ tasks:
11
+ - name: Install Lynx on APP Servers
12
+ yum: pkg=lynx state=installed update_cache=true
13
+
14
+ # RATHER than describing variables inside the main YAML file,
15
+ # reference a VAR file where to check for VARIABLES
16
+
17
+ - hosts: appserver
18
+ vars_files:
19
+ - vars.yml
20
+ tasks:
21
+ - name: Install Lynx on APP Servers
22
+ yum: pkg=lynx state=installed update_cache=true
23
+
24
+ #CREATE the VAR File
25
+
26
+ $vi vars.yml
27
+
28
+ control_server: localhost
29
+ web_root: /var/www/html/
30
+
31
+ # We can STILL HAVE a VARS section inside the main YAML fie
You can’t perform that action at this time.
0 commit comments