Skip to content
Snippets Groups Projects
Verified Commit 00cd8b17 authored by Nicolas Lenz's avatar Nicolas Lenz :snowflake:
Browse files

wip

parent 86af9297
No related branches found
No related tags found
No related merge requests found
Pipeline #199214 passed
---
- name: "Generate certpaths file for {{ item.name }}"
notify: reload haproxy
notify: Reload haproxy
ansible.builtin.template:
src: certpaths.j2
dest: "/etc/haproxy/{{ item.name }}.certpaths"
......
......@@ -104,6 +104,20 @@
## ASSEMBLE CONFIG - HTTP-ERRORS
- name: Create directory for the error files
ansible.builtin.file:
path: "{{ haproxy_config_dir }}/error"
state: directory
owner: root
group: root
mode: "0755"
- name: Copy error pages
ansible.builtin.copy:
src: "{{ inventory_hostname }}/error/"
dest: "{{ haproxy_config_dir }}/error"
mode: "0644"
- name: 'Create directory for the http-errors'
ansible.builtin.file:
path: "{{ haproxy_config_dir }}/http-errors.d"
......@@ -123,12 +137,12 @@
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
when: (item.path | basename) not in (haproxy_http-errors | json_query('[*].name') | map('regex_replace', '(^.*$)', '\\1.cfg') | list)
when: (item.path | basename) not in (haproxy_http_errors | json_query('[*].name') | map('regex_replace', '(^.*$)', '\\1.cfg') | list)
loop: "{{ directory_contents.files }}"
- name: 'Build up the http-errors'
ansible.builtin.template:
src: "backend.cfg"
src: "http-errors.cfg"
dest: "{{ haproxy_config_dir }}/http-errors.d/{{ item.name }}.cfg"
owner: root
group: root
......@@ -289,4 +303,4 @@
group: root
mode: "0644"
backup: true
notify: reload haproxy
notify: Reload haproxy
......@@ -9,6 +9,6 @@
register: result
changed_when: "result.stdout"
when: not cert.stat.exists
notify: restart haproxy
notify: Restart haproxy
tags:
- skip_ansible_lint
......@@ -114,6 +114,6 @@ frontend {{ item.name }} {%if item.ip is defined %}{{ item.ip }}{% endif %}{%if
{% endfor -%}
{% endif -%}
{%- if item.errorfiles -%}
errorfiles {% item.errorfiles %}
{%- if item.errorfiles is defined -%}
errorfiles {{ item.errorfiles }}
{% endif %}
......@@ -5,3 +5,5 @@ http-errors {{ item.name }}
{% if item.errorfiles is defined %}
{%- for errorfile in item.errorfiles -%}
errorfile {{ errorfile.status }} {{ errorfile.file }}
{% endfor -%}
{% endif -%}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment