diff --git a/retries.yml b/retries.yml new file mode 100644 index 0000000..31ea4d0 --- /dev/null +++ b/retries.yml @@ -0,0 +1,6 @@ +- hosts: "{{ target }}" + gather_facts: false + remote_user: pi + roles: + - retries + diff --git a/roles/retries/tasks/main.yml b/roles/retries/tasks/main.yml new file mode 100644 index 0000000..99dbc32 --- /dev/null +++ b/roles/retries/tasks/main.yml @@ -0,0 +1,8 @@ +- name: Warte bis Container läuft + docker_container_info: + name: homeassistant + register: container_info + until: container_info.container.State.Status == "running" + retries: 20 + delay: 3 + # Wartet bis Container vollständig gestartet ist diff --git a/roles/with_dict/tasks/main.yml b/roles/with_dict/tasks/main.yml new file mode 100644 index 0000000..8c4332f --- /dev/null +++ b/roles/with_dict/tasks/main.yml @@ -0,0 +1,11 @@ +- name: Benutzer mit bestimmten Shells anlegen + vars: + users: + alice: /bin/bash + bob: /bin/zsh + carol: /bin/sh + + debug: + msg: "Lege neuen User an Name: {{ item.key }} Shell: {{ item.value }}" + with_dict: "{{ users }}" + diff --git a/roles/with_lines/tasks/main.yml b/roles/with_lines/tasks/main.yml index 7dfa5d6..7ef9e4d 100644 --- a/roles/with_lines/tasks/main.yml +++ b/roles/with_lines/tasks/main.yml @@ -1,4 +1,4 @@ -- name: "Beispiel 1: Alle .conf Dateien in /etc auflisten" +- name: "Beispiel: Alle .conf Dateien in /etc auflisten" debug: msg: "Gefundene Konfigurationsdatei: {{ item }}" with_lines: diff --git a/with_dict.yml b/with_dict.yml new file mode 100644 index 0000000..4ee8ff2 --- /dev/null +++ b/with_dict.yml @@ -0,0 +1,6 @@ +- hosts: "{{ target }}" + gather_facts: false + remote_user: pi + roles: + - with_dict +