retries und with_dict
This commit is contained in:
6
retries.yml
Normal file
6
retries.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
- hosts: "{{ target }}"
|
||||||
|
gather_facts: false
|
||||||
|
remote_user: pi
|
||||||
|
roles:
|
||||||
|
- retries
|
||||||
|
|
8
roles/retries/tasks/main.yml
Normal file
8
roles/retries/tasks/main.yml
Normal 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
|
11
roles/with_dict/tasks/main.yml
Normal file
11
roles/with_dict/tasks/main.yml
Normal 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 }}"
|
||||||
|
|
@@ -1,4 +1,4 @@
|
|||||||
- name: "Beispiel 1: Alle .conf Dateien in /etc auflisten"
|
- name: "Beispiel: Alle .conf Dateien in /etc auflisten"
|
||||||
debug:
|
debug:
|
||||||
msg: "Gefundene Konfigurationsdatei: {{ item }}"
|
msg: "Gefundene Konfigurationsdatei: {{ item }}"
|
||||||
with_lines:
|
with_lines:
|
||||||
|
6
with_dict.yml
Normal file
6
with_dict.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
- hosts: "{{ target }}"
|
||||||
|
gather_facts: false
|
||||||
|
remote_user: pi
|
||||||
|
roles:
|
||||||
|
- with_dict
|
||||||
|
|
Reference in New Issue
Block a user