-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7940d74
commit 179de51
Showing
6 changed files
with
44 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,150 +1,5 @@ | ||
--- | ||
|
||
- name: Converge HAProxy with basic config | ||
hosts: test-ag-haproxy-base | ||
module_defaults: | ||
ansible.builtin.setup: | ||
gather_subset: ['distribution'] | ||
gather_facts: true | ||
|
||
vars: | ||
no_prompts: true | ||
|
||
haproxy: | ||
stats: | ||
enable: true | ||
|
||
frontends: | ||
fe_web: | ||
bind: ['[::]:80 v4v6'] | ||
|
||
routes: | ||
be_test1: | ||
domains: 'app.test.ansibleguy.net' | ||
|
||
be_test2: | ||
domains: ['app1.test.ansibleguy.net', 'app2.test.ansibleguy.net'] | ||
filter_ip: ['192.168.0.0/16', '172.16.0.0/12', '10.0.0.0/8'] | ||
filter_not_ip: ['192.168.100.0/22', '10.50.0.0/16'] | ||
|
||
default_backend: 'be_fallback' | ||
|
||
backends: | ||
be_test1: | ||
sticky: true | ||
servers: | ||
- 'srv1 192.168.10.11:80' | ||
- 'srv2 192.168.10.12:80' | ||
|
||
be_test2: | ||
servers: | ||
- 'srv3 192.168.10.11:80' | ||
- 'srv4 192.168.10.12:80' | ||
|
||
be_fallback: | ||
lines: 'http-request redirect code 302 location https://github.com/ansibleguy' | ||
|
||
roles: | ||
- ansibleguy.infra_haproxy | ||
|
||
# NOTE: not testing actual certificate creation | ||
- name: Converge HAProxy with ACME config | ||
hosts: test-ag-haproxy-acme | ||
module_defaults: | ||
ansible.builtin.setup: | ||
gather_subset: ['distribution'] | ||
gather_facts: true | ||
|
||
vars: | ||
no_prompts: true | ||
|
||
haproxy: | ||
acme: | ||
enable: true | ||
email: '[email protected]' | ||
ca: 'letsencrypt-test' | ||
|
||
frontends: | ||
fe_web: | ||
bind: ['[::]:80 v4v6', '[::]:443 v4v6 ssl'] | ||
acme: | ||
enable: true | ||
|
||
routes: | ||
be_test: | ||
|
||
default_backend: 'be_fallback' | ||
|
||
backends: | ||
be_test: | ||
servers: | ||
- 'srv-1 192.168.10.11:80' | ||
- 'srv-2 192.168.10.12:80' | ||
|
||
be_fallback: | ||
lines: 'http-request redirect code 302 location https://github.com/ansibleguy' | ||
|
||
roles: | ||
- ansibleguy.infra_haproxy | ||
|
||
- name: Converge HAProxy with GeoIP config | ||
hosts: test-ag-haproxy-geoip | ||
module_defaults: | ||
ansible.builtin.setup: | ||
gather_subset: ['distribution'] | ||
gather_facts: true | ||
|
||
vars: | ||
no_prompts: true | ||
|
||
haproxy: | ||
geoip: | ||
enable: true | ||
token: "{{ geoip_key.stdout }}" | ||
|
||
frontends: | ||
fe_web: | ||
bind: ['[::]:80 v4v6'] | ||
geoip: | ||
enable: true | ||
country: true | ||
asn: true | ||
as_name: true | ||
|
||
routes: | ||
be_test1: | ||
domains: ['app1.test.ansibleguy.net'] | ||
filter_country: 'AT' | ||
filter_asn: '1337' | ||
|
||
be_test2: | ||
domains: ['app2.test.ansibleguy.net'] | ||
filter_not_country: ['CN', 'RU', 'US'] | ||
filter_not_asn: ['100000', '120000'] | ||
|
||
default_backend: 'be_fallback' | ||
|
||
backends: | ||
be_test1: | ||
servers: 'srv1 192.168.10.11:80' | ||
|
||
be_test2: | ||
servers: 'srv2 192.168.10.12:80' | ||
|
||
be_fallback: | ||
lines: 'http-request redirect code 302 location https://github.com/ansibleguy' | ||
|
||
pre_tasks: | ||
- name: Loading GeoIP Token | ||
ansible.builtin.command: "cat {{ lookup('ansible.builtin.env', 'HOME') }}/.secret/geoip.key" | ||
delegate_to: localhost | ||
become: false | ||
register: geoip_key | ||
changed_when: false | ||
check_mode: false | ||
|
||
roles: | ||
- ansibleguy.infra_haproxy | ||
|
||
- name: Converge HAProxy with WAF config | ||
hosts: test-ag-haproxy-waf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters