File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
docs/docsite/rst/playbook_guide Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -179,16 +179,16 @@ You can reference simple variables in conditionals to avoid repeating certain te
179
179
- name : Example playbook
180
180
hosts : myHosts
181
181
vars :
182
- log_path : /home/ansible/logfolder/
183
- log_file : log.log
182
+ log_path : /home/ansible/logfolder/
183
+ log_file : log.log
184
184
185
- tasks :
185
+ tasks :
186
186
- name : Create empty log file
187
- ansible.builtin.shell : mkdir {{ log_path }} || touch {{log_path }}{{ log_file }}
188
- register : tmp
189
- changed_when :
190
- - tmp.rc == 0
191
- - ' tmp.stderr != "mkdir: cannot create directory ‘" ~ log_path ~ "’: File exists"'
187
+ ansible.builtin.shell : mkdir {{ log_path }} || touch {{log_path }}{{ log_file }}
188
+ register : tmp
189
+ changed_when :
190
+ - tmp.rc == 0
191
+ - ' tmp.stderr != "mkdir: cannot create directory ‘" ~ log_path ~ "’: File exists"'
192
192
193
193
.. note ::
194
194
Notice the missing double curly braces ``{{ }} `` around the ``log_path `` variable in the ``changed_when `` statement.
You can’t perform that action at this time.
0 commit comments