This commit is contained in:
jaydee 2025-01-31 00:07:32 +01:00
parent 74def16ccd
commit 76aa74ff2f
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,8 @@
- hosts: rpi5.home.lan
name: Start containers rpi5
become: true
tasks:
- name: Start containers
ansible.builtin.shell: "docker start {{ item }}"
register: containers
with_items: ["HomeAssistant","webhub-web-1","heimdall","pihole","mosquitto-mosquitto-1","mailu3-redis-1","mailu3-webmail-1","mailu3-resolver-1","mailu3-antispam-1","mailu3-webdav-1","mailu3-smtp-1","mailu3-oletools-1","mailu3-front-1","mailu3-fetchmail-1","mailu3-imap-1","matter-server","piper-en","openwakeword","whisper-en","auth-worker-1","auth-server-1","auth-authentik_ldap-1","auth-redis-1","auth-postgresql-1","nginx-app-1"]

View File

@ -0,0 +1,14 @@
- hosts: rpi5.home.lan
name: Stop rpi5
become: true
tasks:
- name: Get running packages
ansible.builtin.shell: "docker ps|awk '{print $NF}'"
register: containers
- debug:
msg: "{{ containers.stdout_lines }}"
- name: Stop containers
ansible.builtin.shell: "docker stop {{ item }}"
register: containers
when: item != "NAMES" and item != "watchtower-watchtower-1"
with_items: "{{ containers.stdout_lines }}"