mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-10-30 09:51:10 +01:00
lala
This commit is contained in:
14
playbooks/00_stop_containers_rpi5.yml
Executable file
14
playbooks/00_stop_containers_rpi5.yml
Executable 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 }}"
|
||||
Reference in New Issue
Block a user