Task include tests implemented, nginx restart, etc.

This commit is contained in:
2025-07-09 11:41:17 +02:00
parent 46cf65f296
commit a026681553
3 changed files with 123 additions and 3 deletions

View File

@@ -2,12 +2,30 @@
include_role:
name: srv-web-composer
- name: "copy nginx domain configuration to {{ configuration_destination }}"
- name: "Copy nginx config to {{ configuration_destination }}"
template:
src: "{{ vhost_template_src }}"
src: "{{ vhost_template_src }}"
dest: "{{ configuration_destination }}"
register: nginx_conf
notify: restart nginx
- name: "Check if {{ domains | get_domain(application_id) }} is reachable (only if config unchanged)"
uri:
url: "{{ domains | get_url(application_id, web_protocol) }}"
register: site_check
failed_when: false
changed_when: false
when: not nginx_conf.changed
- name: Restart nginx if site is down
command:
cmd: "true"
notify: restart nginx
when:
- not nginx_conf.changed
- site_check.status is defined
- not site_check.status in [200,301,302]
- name: "set oauth2_proxy_application_id (Needed due to lazzy loading issue)"
set_fact:
oauth2_proxy_application_id: "{{ application_id }}"

View File

@@ -11,5 +11,5 @@
http_port: "{{ ports.localhost.http[application_id] }}"
- name: "configure pgadmin servers"
include_tasks: config/main.yml
include_tasks: configuration.yml
when: applications[application_id].server_mode | bool