Improve Harbor container restart after machine reboot with docker_compose_v2

main
MIchael Haehnel 2 years ago
parent 770f2bdf7f
commit c124a1313f
No known key found for this signature in database
GPG Key ID: D2FA233B52AEC75C

@ -59,26 +59,27 @@
your automation-bofh
- hosts: harbor
- name: "Harbor"
hosts: harbor
serial: 1
become: yes
become: true
tasks:
- name: "Smardigo Patchday: update pkgs"
ansible.builtin.apt:
upgrade: yes
update_cache: yes
autoremove: yes
autoclean: yes
upgrade: true
update_cache: true
autoremove: true
autoclean: true
- name: "Smardigo Patchday: find docker_compose.yml files"
ansible.builtin.find:
paths: "{{ service_base_path }}"
pattern: 'docker*.yml'
recurse: yes
recurse: true
register: docker_compose_services
- name: "Smardigo Patchday: shutdown services"
community.docker.docker_compose:
community.docker.docker_compose_v2:
project_src: "{{ item | dirname }}"
state: absent
loop: "{{ docker_compose_services.files | map(attribute='path') | select('match', '.*/' + stage + '-.*') }}"
@ -89,7 +90,7 @@
reboot_timeout: 300
- name: "Smardigo Patchday: wait_for host after reboot"
become: no
become: false
delegate_to: localhost
ansible.builtin.wait_for:
delay: 15
@ -99,7 +100,7 @@
search_regex: OpenSSH
- name: "Smardigo Patchday: start services"
community.docker.docker_compose:
community.docker.docker_compose_v2:
project_src: "{{ item | dirname }}"
state: present
loop: "{{ docker_compose_services.files | map(attribute='path') }}"

Loading…
Cancel
Save