回答編集履歴
1
書き方になれておらずすいません。
answer
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
with_itemsは「existence.results」に変更
|
4
4
|
shellないのでpath、logname参照は、「item.item.path」「item.item.logname」に変更
|
5
5
|
こんなコーディングになると思います。
|
6
|
+
```
|
6
7
|
- hosts: hoge
|
7
8
|
vars:
|
8
9
|
logs:
|
@@ -28,4 +29,5 @@
|
|
28
29
|
shell: cat /dev/null > {{ item.item.path }}/{{ item.item.logname }}
|
29
30
|
when: item.stat.exists
|
30
31
|
with_items: "{{ existence.results }}"
|
31
|
-
tags: delete_logs
|
32
|
+
tags: delete_logs
|
33
|
+
```
|