-
Notifications
You must be signed in to change notification settings - Fork 5
/
file_filters.yml
49 lines (41 loc) · 1.13 KB
/
file_filters.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
# Test filter_plugins/file_filters
- name: file_filters
hosts: localhost
gather_facts: false
vars:
test_string: "test string"
test_file1: "test_file1.txt"
test_file2: "test_file2.txt"
list1_files:
- test_file1.txt
- test_file2.txt
list2_files:
- test_file3.txt
- test_file2.txt
tasks:
- name: "No.1 String is in file"
debug:
msg: "{{ test_string }} found in {{ test_file1 }}"
when: test_file1|file_search(test_string)
tags: t1
- name: "No.1 String is in file"
debug:
msg: "{{ test_file1|file_search(test_string) }}"
tags: t1a
- name: "No.2 String is NOT in file"
debug:
msg: "{{ test_string }} found in {{ test_file2 }}"
when: test_file2|file_search(test_string)
tags: t2
- name: "No.3 String is in list of files"
debug:
msg: "{{ test_string }} found"
when: list1_files|file_list_search(test_string)
tags: t3
- name: "No.4 String is NOT in list of files"
debug:
msg: "{{ test_string }} found"
when: list2_files|file_list_search(test_string)
tags: t4
...