parent
6f2b4a8d66
commit
6e8b300a5e
@ -0,0 +1,14 @@ |
|||||||
|
--- |
||||||
|
- hosts: localhost |
||||||
|
tasks: |
||||||
|
- command: "grep {{ username }} /etc/passwd" |
||||||
|
register: result |
||||||
|
ignore_errors: True |
||||||
|
|
||||||
|
- debug: |
||||||
|
msg: '{{ username }} exists' |
||||||
|
when: result is success |
||||||
|
|
||||||
|
- debug: |
||||||
|
msg: '{{ username }} does not exist' |
||||||
|
when: result is failed |
||||||
@ -0,0 +1,9 @@ |
|||||||
|
--- |
||||||
|
- hosts: localhost |
||||||
|
tasks: |
||||||
|
- include: loop_include_sub.yml |
||||||
|
loop: |
||||||
|
- A |
||||||
|
- B |
||||||
|
loop_control: |
||||||
|
loop_var: outer |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
--- |
||||||
|
- debug: "msg='{{ my_idx }} Innen: {{ item }}, Außen: {{ outer }}'" |
||||||
|
loop: |
||||||
|
- 1 |
||||||
|
- 2 |
||||||
|
loop_control: |
||||||
|
index_var: my_idx |
||||||
|
label: "Testytest" |
||||||
Loading…
Reference in new issue