Kapitel 10: Block

This commit is contained in:
Sven Velt 2024-09-19 10:09:15 +02:00
parent 8f40ae0047
commit a77844606a
6 changed files with 104 additions and 0 deletions

17
10/block.yml Normal file
View 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"'

View 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"'

View 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"'

View 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"'

View 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"'

View 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"'