Create the secret only when the configuration is changed.

This commit is contained in:
Andrea Dell'Amico 2024-04-09 14:37:10 +02:00
parent 52b516579a
commit a98e9f2971
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 9 additions and 7 deletions

View File

@ -8,3 +8,9 @@
community.docker.docker_swarm_service:
name: "{{ shinyproxy_as_docker_stack_name }}_{{ shinyproxy_as_docker_service_name }}"
state: absent
- name: Create the secret for the application.yml file
community.docker.docker_secret:
name: "{{ shinyproxy_as_docker_stack_name }}_{{ shinyproxy_as_docker_service_name }}_application_yml"
data_src: '{{ shinyproxy_as_docker_src_dir }}/application.yml'
state: present

View File

@ -37,17 +37,13 @@
owner: root
group: root
mode: "0400"
notify: Stop the shinyproxy service
notify:
- Stop the shinyproxy service
- Create the secret for the application.yml file
- name: shinyproxy_docker_stack_service | Flush the handlers to stop the shinyproxy service if needed
ansible.builtin.meta: flush_handlers
- name: shinyproxy_docker_stack_service | Create the secret for the application.yml file
community.docker.docker_secret:
name: "{{ shinyproxy_as_docker_stack_name }}_{{ shinyproxy_as_docker_service_name }}_application_yml"
data_src: '{{ shinyproxy_as_docker_src_dir }}/application.yml'
state: present
- name: shinyproxy_docker_stack_service | Start the shinyproxy stack
community.docker.docker_stack:
name: '{{ shinyproxy_as_docker_stack_name }}'