Fix linting issues on Docker role

This commit is contained in:
Kris Lamoureux 2023-10-22 13:48:20 -04:00
parent 7f91b24adb
commit 5633468f41
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
3 changed files with 10 additions and 7 deletions

View File

@ -4,7 +4,7 @@
listen: compose_systemd listen: compose_systemd
- name: Find which services had a docker-compose.yml updated - name: Find which services had a docker-compose.yml updated
set_fact: ansible.builtin.set_fact:
compose_restart_list: "{{ (compose_restart_list | default([])) + [item.item.name] }}" compose_restart_list: "{{ (compose_restart_list | default([])) + [item.item.name] }}"
loop: "{{ compose_update.results }}" loop: "{{ compose_update.results }}"
loop_control: loop_control:
@ -13,7 +13,7 @@
listen: compose_restart listen: compose_restart
- name: Find which services had their .env updated - name: Find which services had their .env updated
set_fact: ansible.builtin.set_fact:
compose_restart_list: "{{ (compose_restart_list | default([])) + [item.item.name] }}" compose_restart_list: "{{ (compose_restart_list | default([])) + [item.item.name] }}"
loop: "{{ compose_env_update.results }}" loop: "{{ compose_env_update.results }}"
loop_control: loop_control:
@ -29,20 +29,20 @@
listen: restart_mariadb # hijack handler for early restart listen: restart_mariadb # hijack handler for early restart
- name: Set MariaDB as restarted - name: Set MariaDB as restarted
set_fact: ansible.builtin.set_fact:
mariadb_restarted: true mariadb_restarted: true
when: not mariadb_restarted when: not mariadb_restarted
listen: restart_mariadb listen: restart_mariadb
- name: Restart {{ docker_compose_service }} services - name: Restart compose services
ansible.builtin.systemd: ansible.builtin.systemd:
state: restarted state: restarted
name: "{{ docker_compose_service }}@{{ item }}" name: "{{ docker_compose_service }}@{{ item }}"
loop: "{{ compose_restart_list | unique }}" loop: "{{ compose_restart_list | default([]) | unique }}"
when: compose_restart_list is defined when: compose_restart_list is defined
listen: compose_restart listen: compose_restart
- name: Start {{ docker_compose_service }} services and enable on boot - name: Start compose services and enable on boot
ansible.builtin.service: ansible.builtin.service:
name: "{{ docker_compose_service }}@{{ item.name }}" name: "{{ docker_compose_service }}@{{ item.name }}"
state: started state: started

View File

@ -3,6 +3,9 @@
url: "{{ docker_apt_keyring_url }}" url: "{{ docker_apt_keyring_url }}"
dest: "{{ docker_apt_keyring }}" dest: "{{ docker_apt_keyring }}"
checksum: "sha256:{{ docker_apt_keyring_hash }}" checksum: "sha256:{{ docker_apt_keyring_hash }}"
mode: "644"
owner: root
group: root
when: docker_official when: docker_official
- name: Remove official Docker APT key - name: Remove official Docker APT key