Kapitel 10: Block
This commit is contained in:
parent
8f40ae0047
commit
a77844606a
17
10/block.yml
Normal file
17
10/block.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- debug: msg='OK'
|
||||||
|
- shell: /bin/false
|
||||||
|
- debug: msg='Niemals'
|
||||||
|
rescue:
|
||||||
|
- debug: msg='Im Fehlerfall'
|
||||||
|
- shell: /bin/false
|
||||||
|
- debug: msg='Niemals'
|
||||||
|
always:
|
||||||
|
- debug: msg='echo Immer'
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
- debug: 'msg="Nach dem Block"'
|
||||||
|
|
17
10/block_01_kein_Problem.yml
Normal file
17
10/block_01_kein_Problem.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- debug: msg='Block 1'
|
||||||
|
- command: /bin/true
|
||||||
|
- debug: msg='Block 2'
|
||||||
|
rescue:
|
||||||
|
- debug: msg='Rescue 1'
|
||||||
|
- command: /bin/true
|
||||||
|
- debug: msg='Rescue 2'
|
||||||
|
always:
|
||||||
|
- debug: msg='Always'
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
- debug: 'msg="Nach dem Block"'
|
||||||
|
|
17
10/block_02_Fehler_Block.yml
Normal file
17
10/block_02_Fehler_Block.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- debug: msg='Block 1'
|
||||||
|
- command: /bin/false
|
||||||
|
- debug: msg='Block 2'
|
||||||
|
rescue:
|
||||||
|
- debug: msg='Rescue 1'
|
||||||
|
- command: /bin/true
|
||||||
|
- debug: msg='Rescue 2'
|
||||||
|
always:
|
||||||
|
- debug: msg='Always'
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
- debug: 'msg="Nach dem Block"'
|
||||||
|
|
17
10/block_03_Fehler_Block_und_Rescue.yml
Normal file
17
10/block_03_Fehler_Block_und_Rescue.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- debug: msg='Block 1'
|
||||||
|
- command: /bin/false
|
||||||
|
- debug: msg='Block 2'
|
||||||
|
rescue:
|
||||||
|
- debug: msg='Rescue 1'
|
||||||
|
- command: /bin/false
|
||||||
|
- debug: msg='Rescue 2'
|
||||||
|
always:
|
||||||
|
- debug: msg='Always'
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
- debug: 'msg="Nach dem Block"'
|
||||||
|
|
17
10/block_04_Fehler_nur_Rescue.yml
Normal file
17
10/block_04_Fehler_nur_Rescue.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- debug: msg='Block 1'
|
||||||
|
- command: /bin/true
|
||||||
|
- debug: msg='Block 2'
|
||||||
|
rescue:
|
||||||
|
- debug: msg='Rescue 1'
|
||||||
|
- command: /bin/false
|
||||||
|
- debug: msg='Rescue 2'
|
||||||
|
always:
|
||||||
|
- debug: msg='Always'
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
- debug: 'msg="Nach dem Block"'
|
||||||
|
|
19
10/block_09_Fehler_Block_und_Always.yml
Normal file
19
10/block_09_Fehler_Block_und_Always.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- debug: msg='Block 1'
|
||||||
|
- command: /bin/false
|
||||||
|
- debug: msg='Block 2'
|
||||||
|
rescue:
|
||||||
|
- debug: msg='Rescue 1'
|
||||||
|
- command: /bin/true
|
||||||
|
- debug: msg='Rescue 2'
|
||||||
|
always:
|
||||||
|
- debug: msg='Always 1'
|
||||||
|
- command: /bin/false
|
||||||
|
- debug: msg='Always 2'
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
- debug: 'msg="Nach dem Block"'
|
||||||
|
|
Loading…
Reference in a new issue