retries und with_dict

This commit is contained in:
2025-07-26 08:52:35 +02:00
parent 64d62dcc91
commit 99a9fbc8ae
5 changed files with 32 additions and 1 deletions

6
retries.yml Normal file
View File

@@ -0,0 +1,6 @@
- hosts: "{{ target }}"
gather_facts: false
remote_user: pi
roles:
- retries

View File

@@ -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

View File

@@ -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 }}"

View File

@@ -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:

6
with_dict.yml Normal file
View File

@@ -0,0 +1,6 @@
- hosts: "{{ target }}"
gather_facts: false
remote_user: pi
roles:
- with_dict