|
40 | 40 | # would translate to tar -C /home/user/.ansible/collections \ |
41 | 41 | # ansible_collections/fedora/linux_system_roles/plugins/modules |
42 | 42 | - name: Find parent directory and path of modules |
43 | | - shell: | |
44 | | - set -euxo pipefail |
45 | | - for dir in {{ modules_search_path | join(" ") }}; do |
46 | | - if [ -f "$dir/network_connections.py" ]; then |
47 | | - readlink -f "$(dirname "$dir")" |
48 | | - basename "$dir" |
49 | | - exit 0 |
50 | | - fi |
51 | | - done |
52 | | - for dir in {{ collection_paths | join(" ") }}; do |
53 | | - if [ ! -d "$dir" ]; then continue; fi |
54 | | - cd "$dir" |
55 | | - for subdir in ansible_collections/*/*/plugins/modules; do |
56 | | - if [ -f "$subdir/network_connections.py" ]; then |
57 | | - echo "$dir" |
58 | | - echo "$subdir" |
| 43 | + shell: |
| 44 | + executable: /bin/bash # ensure pipefail setting |
| 45 | + cmd: | |
| 46 | + set -euxo pipefail |
| 47 | + for dir in {{ modules_search_path | join(" ") }}; do |
| 48 | + if [ -f "$dir/network_connections.py" ]; then |
| 49 | + readlink -f "$(dirname "$dir")" |
| 50 | + basename "$dir" |
59 | 51 | exit 0 |
60 | 52 | fi |
61 | 53 | done |
62 | | - done |
63 | | - echo network_connections.py not found |
64 | | - exit 1 |
| 54 | + for dir in {{ collection_paths | join(" ") }}; do |
| 55 | + if [ ! -d "$dir" ]; then continue; fi |
| 56 | + cd "$dir" |
| 57 | + for subdir in ansible_collections/*/*/plugins/modules; do |
| 58 | + if [ -f "$subdir/network_connections.py" ]; then |
| 59 | + echo "$dir" |
| 60 | + echo "$subdir" |
| 61 | + exit 0 |
| 62 | + fi |
| 63 | + done |
| 64 | + done |
| 65 | + echo network_connections.py not found |
| 66 | + exit 1 |
65 | 67 | delegate_to: localhost |
66 | 68 | register: modules_parent_and_dir |
67 | 69 | changed_when: false |
68 | 70 |
|
69 | 71 | - name: Find parent directory and path of module_utils |
70 | | - shell: | |
71 | | - set -euxo pipefail |
72 | | - for dir in {{ module_utils_search_path | join(" ") }}; do |
73 | | - if [ -d "$dir/network_lsr" ]; then |
74 | | - readlink -f "$(dirname "$dir")" |
75 | | - basename "$dir" |
76 | | - exit 0 |
77 | | - fi |
78 | | - done |
79 | | - for dir in {{ collection_paths | join(" ") }}; do |
80 | | - if [ ! -d "$dir" ]; then continue; fi |
81 | | - cd "$dir" |
82 | | - for subdir in ansible_collections/*/*/plugins/module_utils; do |
83 | | - if [ -d "$subdir/network_lsr" ]; then |
84 | | - echo "$dir" |
85 | | - echo "$subdir" |
| 72 | + shell: |
| 73 | + executable: /bin/bash # ensure pipefail setting |
| 74 | + cmd: | |
| 75 | + set -euxo pipefail |
| 76 | + for dir in {{ module_utils_search_path | join(" ") }}; do |
| 77 | + if [ -d "$dir/network_lsr" ]; then |
| 78 | + readlink -f "$(dirname "$dir")" |
| 79 | + basename "$dir" |
86 | 80 | exit 0 |
87 | 81 | fi |
88 | 82 | done |
89 | | - done |
90 | | - echo network_lsr not found |
91 | | - exit 1 |
| 83 | + for dir in {{ collection_paths | join(" ") }}; do |
| 84 | + if [ ! -d "$dir" ]; then continue; fi |
| 85 | + cd "$dir" |
| 86 | + for subdir in ansible_collections/*/*/plugins/module_utils; do |
| 87 | + if [ -d "$subdir/network_lsr" ]; then |
| 88 | + echo "$dir" |
| 89 | + echo "$subdir" |
| 90 | + exit 0 |
| 91 | + fi |
| 92 | + done |
| 93 | + done |
| 94 | + echo network_lsr not found |
| 95 | + exit 1 |
92 | 96 | delegate_to: localhost |
93 | 97 | register: module_utils_parent_and_dir |
94 | 98 | changed_when: false |
0 commit comments