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 }}" - name: "Generate certpaths file for {{ item.name }}"
notify: reload haproxy notify: Reload haproxy
ansible.builtin.template: ansible.builtin.template:
src: certpaths.j2 src: certpaths.j2
dest: "/etc/haproxy/{{ item.name }}.certpaths" dest: "/etc/haproxy/{{ item.name }}.certpaths"
......
...@@ -104,6 +104,20 @@ ...@@ -104,6 +104,20 @@
## ASSEMBLE CONFIG - HTTP-ERRORS ## 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' - name: 'Create directory for the http-errors'
ansible.builtin.file: ansible.builtin.file:
path: "{{ haproxy_config_dir }}/http-errors.d" path: "{{ haproxy_config_dir }}/http-errors.d"
...@@ -123,12 +137,12 @@ ...@@ -123,12 +137,12 @@
ansible.builtin.file: ansible.builtin.file:
path: "{{ item.path }}" path: "{{ item.path }}"
state: absent 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 }}" loop: "{{ directory_contents.files }}"
- name: 'Build up the http-errors' - name: 'Build up the http-errors'
ansible.builtin.template: ansible.builtin.template:
src: "backend.cfg" src: "http-errors.cfg"
dest: "{{ haproxy_config_dir }}/http-errors.d/{{ item.name }}.cfg" dest: "{{ haproxy_config_dir }}/http-errors.d/{{ item.name }}.cfg"
owner: root owner: root
group: root group: root
...@@ -289,4 +303,4 @@ ...@@ -289,4 +303,4 @@
group: root group: root
mode: "0644" mode: "0644"
backup: true backup: true
notify: reload haproxy notify: Reload haproxy
...@@ -9,6 +9,6 @@ ...@@ -9,6 +9,6 @@
register: result register: result
changed_when: "result.stdout" changed_when: "result.stdout"
when: not cert.stat.exists when: not cert.stat.exists
notify: restart haproxy notify: Restart haproxy
tags: tags:
- skip_ansible_lint - skip_ansible_lint
...@@ -114,6 +114,6 @@ frontend {{ item.name }} {%if item.ip is defined %}{{ item.ip }}{% endif %}{%if ...@@ -114,6 +114,6 @@ frontend {{ item.name }} {%if item.ip is defined %}{{ item.ip }}{% endif %}{%if
{% endfor -%} {% endfor -%}
{% endif -%} {% endif -%}
{%- if item.errorfiles -%} {%- if item.errorfiles is defined -%}
errorfiles {% item.errorfiles %} errorfiles {{ item.errorfiles }}
{% endif %} {% endif %}
...@@ -5,3 +5,5 @@ http-errors {{ item.name }} ...@@ -5,3 +5,5 @@ http-errors {{ item.name }}
{% if item.errorfiles is defined %} {% if item.errorfiles is defined %}
{%- for errorfile in item.errorfiles -%} {%- for errorfile in item.errorfiles -%}
errorfile {{ errorfile.status }} {{ errorfile.file }} 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