Kapitel 02: Playbooks und YAML

This commit is contained in:
Sven Velt 2024-09-16 13:54:35 +02:00
parent 19dd461843
commit fd0429286d
5 changed files with 41 additions and 0 deletions

13
02/minimal.yml Normal file
View file

@ -0,0 +1,13 @@
---
- hosts: localhost
tasks:
- name: "Aufruf von 'id'"
ansible.builtin.command: id
- name: Kopieren einer Datei
ansible.builtin.copy: src=test.txt dest=/tmp/test.txt backup=yes
- name: 'Ausgabe von "/etc/issue"'
ansible.builtin.command: cat /etc/issue

5
02/ping.yml Normal file
View file

@ -0,0 +1,5 @@
---
- hosts: localhost
tasks:
- ping:

6
02/ping_sauber.yml Normal file
View file

@ -0,0 +1,6 @@
---
- name: Pinge localhost
hosts: localhost
tasks:
- name: Führe Ping aus
ansible.builtin.ping:

1
02/test.txt Normal file
View file

@ -0,0 +1 @@
Ich war hier

16
02/zwei_plays.yml Normal file
View file

@ -0,0 +1,16 @@
---
- hosts: localhost
tasks:
- name: "Aufruf von 'id'"
ansible.builtin.command: id
- name: Kopieren einer Datei
ansible.builtin.copy: src=test.txt dest=/tmp/test.txt backup=yes
- hosts: localhost
tasks:
- name: 'Ausgabe von "/etc/issue"'
ansible.builtin.command: cat /etc/issue