Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ None
- name: http
description: Front-end for all HTTP traffic
bind:
- listen: "{{ ansible_eth0['ipv4']['address'] }}:80"
- listen: "{{ ansible_facts['eth0'] ['ipv4']['address'] }}:80"
mode: http
redirect:
- string: 'scheme https code 301'
Expand All @@ -556,7 +556,7 @@ None
- name: https
description: Front-end for all HTTPS traffic
bind:
- listen: "{{ ansible_eth0['ipv4']['address'] }}:443"
- listen: "{{ ansible_facts['eth0'] ['ipv4']['address'] }}:443"
param:
- ssl
- 'crt star-example1-com.pem'
Expand All @@ -582,17 +582,17 @@ None
cond: 'if { ssl_fc }'
server:
- name: web-01
listen: "{{ ansible_lo['ipv4']['address'] }}:8001"
listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:8001"
param:
- 'maxconn 501'
- check
- name: web-02
listen: "{{ ansible_lo['ipv4']['address'] }}:8002"
listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:8002"
param:
- 'maxconn 502'
- check
- name: web-03
listen: "{{ ansible_lo['ipv4']['address'] }}:8003"
listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:8003"
param:
- 'maxconn 503'
- check
Expand All @@ -611,12 +611,12 @@ None
- fall 2
server:
- name: mqtt-1
listen: "{{ ansible_lo['ipv4']['address'] }}:1883"
listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:1883"
param:
- check

- name: mqtt-2
listen: "{{ ansible_lo['ipv4']['address'] }}:1883"
listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:1883"
param:
- check
- backup
Expand Down Expand Up @@ -665,7 +665,7 @@ None
- name: stats
description: Global statistics
bind:
- listen: "{{ ansible_eth0['ipv4']['address'] }}:1936"
- listen: "{{ ansible_facts['eth0'] ['ipv4']['address'] }}:1936"
param:
- ssl
- 'crt star-example0-com.pem'
Expand All @@ -686,7 +686,7 @@ None
- name: ssl-proxy
description: Proxy for all HTTPS traffic
bind:
- listen: "{{ ansible_eth0['ipv4']['address'] }}:443"
- listen: "{{ ansible_facts['eth0'] ['ipv4']['address'] }}:443"
param:
- ssl
- 'crt star-example1-com.pem'
Expand All @@ -700,7 +700,7 @@ None
mode: http
server:
- name: "{{ inventory_hostname }}"
listen: "{{ ansible_lo['ipv4']['address'] }}:80"
listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:80"
param:
- send-proxy
rspadd:
Expand All @@ -713,8 +713,8 @@ None
- name: http
description: Front-end for all HTTP traffic
bind:
- listen: "{{ ansible_eth0['ipv4']['address'] }}:80"
- listen: "{{ ansible_lo['ipv4']['address'] }}:80"
- listen: "{{ ansible_facts['eth0'] ['ipv4']['address'] }}:80"
- listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:80"
param:
- accept-proxy
bind_process:
Expand All @@ -740,17 +740,17 @@ None
cond: 'if { dst_port 443 }'
server:
- name: web-01
listen: "{{ ansible_lo['ipv4']['address'] }}:8001"
listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:8001"
param:
- 'maxconn 501'
- check
- name: web-02
listen: "{{ ansible_lo['ipv4']['address'] }}:8002"
listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:8002"
param:
- 'maxconn 502'
- check
- name: web-03
listen: "{{ ansible_lo['ipv4']['address'] }}:8003"
listen: "{{ ansible_facts['lo']['ipv4']['address'] }}:8003"
param:
- 'maxconn 503'
- check
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
hosts: all
become: true
pre_tasks:
- name: include (first found) variables

Check warning on line 6 in molecule/default/converge.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/../../tests/vars/_{{ ansible_distribution_release }}.yml"
- "{{ playbook_dir }}/../../tests/vars/_{{ ansible_distribution | lower }}.yml"
- "{{ playbook_dir }}/../../tests/vars/_{{ ansible_facts['distribution_release'] }}.yml"
- "{{ playbook_dir }}/../../tests/vars/_{{ ansible_facts['distribution'] | lower }}.yml"
- "{{ playbook_dir }}/../../tests/vars/_default.yml"
- name: include variables

Check warning on line 12 in molecule/default/converge.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml"
2 changes: 1 addition & 1 deletion templates/etc/haproxy/acl.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# {{ ansible_managed }}
{{ ansible_managed | comment }}

{% for content in item.content | default([]) %}
{{ content }}
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/haproxy/haproxy.cfg.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# {{ ansible_managed }}
{{ ansible_managed | comment }}

global
{% include 'global.cfg.j2' %}
Expand Down
4 changes: 2 additions & 2 deletions templates/usr/local/bin/haproxy-letsencrypt-ocsp-deploy.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# {{ ansible_managed }}
{{ ansible_managed | comment }}
#
# set -x;
set -e;
Expand Down Expand Up @@ -37,7 +37,7 @@ done

find "{{ haproxy_global_crt_base }}" -mindepth 1 -name "*.ocsp" -mtime +0 -delete;

{% if ansible_service_mgr == 'systemd' %}
{% if ansible_facts['service_mgr'] == 'systemd' %}
systemctl reload haproxy;
{% else %}
service haproxy reload;
Expand Down
2 changes: 1 addition & 1 deletion templates/usr/local/bin/haproxy-letsencrypt-ssl-deploy.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# {{ ansible_managed }}
{{ ansible_managed | comment }}
#
# set -x;
set -e;
Expand Down
4 changes: 2 additions & 2 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
- name: include (first found) variables
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/_{{ ansible_distribution_release }}.yml"
- "{{ playbook_dir }}/vars/_{{ ansible_distribution | lower }}.yml"
- "{{ playbook_dir }}/vars/_{{ ansible_facts['distribution_release'] }}.yml"
- "{{ playbook_dir }}/vars/_{{ ansible_facts['distribution'] | lower }}.yml"
- "{{ playbook_dir }}/vars/_default.yml"
- name: include variables
ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml"
Expand Down
4 changes: 2 additions & 2 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
- name: include (first found) variables
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/_{{ ansible_distribution_release }}.yml"
- "{{ playbook_dir }}/vars/_{{ ansible_distribution | lower }}.yml"
- "{{ playbook_dir }}/vars/_{{ ansible_facts['distribution_release'] }}.yml"
- "{{ playbook_dir }}/vars/_{{ ansible_facts['distribution'] | lower }}.yml"
- "{{ playbook_dir }}/vars/_default.yml"
- name: include variables
ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml"
Expand Down
6 changes: 3 additions & 3 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ haproxy_keyring_id: 3D653970FBAB0A890E4E4E9A0F14D8B0CF4EFE96
haproxy_keyring_dst: /usr/share/keyrings/haproxy.gpg
haproxy_repositories:
- type: "deb [signed-by={{ haproxy_keyring_dst }}]"
url: "https://ppa.launchpadcontent.net/vbernat/haproxy-{{ haproxy_version }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }}"
url: "https://ppa.launchpadcontent.net/vbernat/haproxy-{{ haproxy_version }}/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] }}"
component: main
_haproxy_version_sources_list_d: "{{ (haproxy_version | string).split('.') | join('_') }}"
haproxy_repository_files_absent:
- "/etc/apt/sources.list.d/ppa_vbernat_haproxy_{{ _haproxy_version_sources_list_d }}_{{ ansible_distribution_release }}.list"
- "/etc/apt/sources.list.d/ppa_vbernat_haproxy_{{ _haproxy_version_sources_list_d }}_{{ ansible_distribution_release }}.list.save"
- "/etc/apt/sources.list.d/ppa_vbernat_haproxy_{{ _haproxy_version_sources_list_d }}_{{ ansible_facts['distribution_release'] }}.list"
- "/etc/apt/sources.list.d/ppa_vbernat_haproxy_{{ _haproxy_version_sources_list_d }}_{{ ansible_facts['distribution_release'] }}.list.save"

haproxy_dependencies_pre:
- software-properties-common
Expand Down
Loading