From fd0429286d822e88117bdf62561504a876234113 Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Mon, 16 Sep 2024 13:54:35 +0200 Subject: [PATCH] Kapitel 02: Playbooks und YAML --- 02/minimal.yml | 13 +++++++++++++ 02/ping.yml | 5 +++++ 02/ping_sauber.yml | 6 ++++++ 02/test.txt | 1 + 02/zwei_plays.yml | 16 ++++++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 02/minimal.yml create mode 100644 02/ping.yml create mode 100644 02/ping_sauber.yml create mode 100644 02/test.txt create mode 100644 02/zwei_plays.yml diff --git a/02/minimal.yml b/02/minimal.yml new file mode 100644 index 0000000..08192f3 --- /dev/null +++ b/02/minimal.yml @@ -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 + diff --git a/02/ping.yml b/02/ping.yml new file mode 100644 index 0000000..59fd21c --- /dev/null +++ b/02/ping.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + tasks: + - ping: + diff --git a/02/ping_sauber.yml b/02/ping_sauber.yml new file mode 100644 index 0000000..c2d0071 --- /dev/null +++ b/02/ping_sauber.yml @@ -0,0 +1,6 @@ +--- +- name: Pinge localhost + hosts: localhost + tasks: + - name: Führe Ping aus + ansible.builtin.ping: diff --git a/02/test.txt b/02/test.txt new file mode 100644 index 0000000..634f662 --- /dev/null +++ b/02/test.txt @@ -0,0 +1 @@ +Ich war hier diff --git a/02/zwei_plays.yml b/02/zwei_plays.yml new file mode 100644 index 0000000..b643a8b --- /dev/null +++ b/02/zwei_plays.yml @@ -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 +