Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
d0532d4
add new single function playbooks
crosmuller May 1, 2025
51484b0
Merge branch 'main' into feature/new_playbooks
crosmuller May 1, 2025
13e41a0
remove includes
crosmuller May 1, 2025
f90371b
remove includes
crosmuller May 1, 2025
6f3f3ff
remove includes
crosmuller May 1, 2025
38ed914
add an example
crosmuller May 1, 2025
0e688c6
linter
crosmuller May 1, 2025
c81aaa6
linter
crosmuller May 1, 2025
5a614d7
run manage_test_entity register also in check mode
crosmuller May 1, 2025
f1d5c56
false not true
crosmuller May 1, 2025
029fbb0
split docker config and container deployment
crosmuller May 1, 2025
c792ba6
read secrets in a separte block works, not sure why
crosmuller May 1, 2025
a837511
add todo item
crosmuller May 1, 2025
4b266c5
read secrets in a separte block works, not sure why
crosmuller May 1, 2025
89bd2b8
add comment
crosmuller May 1, 2025
4739437
add dashboard
crosmuller May 1, 2025
1ffca90
add dashboard
crosmuller May 1, 2025
bea9376
disable everything for now
crosmuller May 2, 2025
5d66e0f
add all dockerapps1 apps
crosmuller May 2, 2025
2675b50
add all dockerapps2 apps
crosmuller May 2, 2025
6f864f7
add all stepupapp apps
crosmuller May 2, 2025
69ebeef
fix conflicts
crosmuller May 14, 2025
910209c
add test playbook
crosmuller May 14, 2025
359f84f
fix syntax
crosmuller May 14, 2025
0367c84
more items
crosmuller May 14, 2025
213713c
more items
crosmuller May 14, 2025
48f9c40
fix cmd
crosmuller May 14, 2025
7cb94a9
fix cmd
crosmuller May 14, 2025
373177b
fix cmd
crosmuller May 14, 2025
4a1aaad
continue on error
crosmuller May 14, 2025
0b69ad7
continue on error
crosmuller May 14, 2025
1372ad2
remove continue_on_error
crosmuller May 14, 2025
48b0b57
change container names
crosmuller May 14, 2025
8b86c22
just stop on an error there should not be errors anyway
crosmuller May 14, 2025
4d9df16
vault is not necessary
crosmuller May 14, 2025
9788de5
use existing example environment template
crosmuller May 16, 2025
49e6de5
alphabetize test playbook
crosmuller May 21, 2025
0a50928
alphabetize deploy playbook
crosmuller May 21, 2025
c54d435
Merge branch 'main' into feature/new_playbooks
crosmuller May 21, 2025
2d06c0d
add laodbalancer plays
crosmuller May 21, 2025
ebba09e
fix typo
crosmuller May 21, 2025
d09707a
fix false positive
crosmuller May 21, 2025
d50f9dc
testje
crosmuller May 22, 2025
37fad76
debug
crosmuller May 22, 2025
c93853a
debug
crosmuller May 22, 2025
9b00aa2
working for one url
May 22, 2025
acdb6c2
This results in some readable output
crosmuller May 22, 2025
5e98f6b
use internal health
May 22, 2025
4eafc4a
add utrecht and unrestricted
May 22, 2025
f5b8a36
add utrecht and unrestricted
May 22, 2025
e62efa1
commit working for amsterdam version
May 22, 2025
56b9073
fix sni variable issue and do not summarize results but fix health ur…
crosmuller May 23, 2025
1ef021c
fix typo
crosmuller May 23, 2025
baa6bff
ipv6 generates error 99, fix it later
May 23, 2025
16ff76c
fix merge conflicts
crosmuller May 30, 2025
1076161
Merge branch 'main' into feature/new_loadbalancer_playbook
crosmuller Jun 2, 2025
9f6e1db
add health url from env settings
crosmuller Jun 27, 2025
8a32b75
debug
crosmuller Jun 27, 2025
c2da419
debug
crosmuller Jun 27, 2025
0765853
debug
crosmuller Jun 27, 2025
4d853b5
debug
crosmuller Jun 27, 2025
cb1fe83
adding comment
crosmuller Jun 27, 2025
bcc3cdd
simplify script
crosmuller Jun 30, 2025
3521d53
simplify script
crosmuller Jun 30, 2025
f9c3ba3
Merge branch 'main' into feature/new_loadbalancer_playbook
crosmuller Jun 30, 2025
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
36 changes: 0 additions & 36 deletions config_base_playbook.yml

This file was deleted.

File renamed without changes.
29 changes: 28 additions & 1 deletion deploy_loadbalancers_playbook.yml
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
---
---
- name: Read secrets
hosts: loadbalancer
become: true
tasks:
- name: Read vars from secrets file
ansible.builtin.include_vars: "{{ inventory_dir }}/secrets/secrets.yml"
no_log: true
tags:
- always

- name: Deploy haproxy
hosts: loadbalancer
gather_facts: true
become: true
roles:
- role: haproxy
tags: ['core', 'loadbalancer', 'lb']

- name: Deploy keepalived and bind for clustered loadbalancers
hosts: loadbalancer_ha
gather_facts: true
become: true
roles:
- role: keepalived
tags: ['core', 'loadbalancer_ha', 'keepalived']
- role: bind
tags: ['core', 'loadbalancer_ha', 'bind']
1 change: 1 addition & 0 deletions environments/template/group_vars/template.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

env: "%env%"
mariadb_host: localhost
rsyslog_host: localhost
Expand Down
13 changes: 13 additions & 0 deletions environments/template/inventory
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ dbcluster_nodes
localhost ansible_connection=local

# for refactored playbooks

[%location%:children] # create one or more groups here for your chosen location(s)
storage
mongo_servers
sysloghost
loadbalancer_ha
loadbalancer
lifecycle
dbcluster
dbcluster_nodes
stats
docker_servers

[base:children]
docker_servers

Expand Down
39 changes: 39 additions & 0 deletions inc_test_loadbalancer_tasklist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# playbook loops over:
# loadbalancers
# haproxy_applications (item)
#
# and does an url request on lodbalancer ip with vhostname as the host header

- name: Try to reach {{ item.vhost_name }} via https://{{ haproxy_sni_ip_restricted.ipv4 }}:443 # noqa: name[template] jinja template helps with debugging
when: item.restricted is defined and item.restricted
ansible.builtin.uri:
url: "https://{{ haproxy_sni_ip_restricted.ipv4 }}:443/{{ item.ha_url }}"
method: GET
status_code: [200, 302]
return_content: false
validate_certs: false
headers:
host: "{{ item.vhost_name }}"
register: result
until: result.status == 200 or result.status == 302
retries: 3
delay: 2
delegate_to: 127.0.0.1 # run check from deploy host

# Try to reach applications via loadbalancer without restricted ip v4
- name: Try to reach {{ item.vhost_name }} via https://{{ haproxy_sni_ip.ipv4 }}:443 # noqa: name[template] jinja template helps with debugging
when: item.restricted is undefined
ansible.builtin.uri:
url: "https://{{ haproxy_sni_ip.ipv4 }}:443/{{ item.ha_url }}"
method: GET
status_code: [200, 302]
return_content: false
validate_certs: false
headers:
host: "{{ item.vhost_name }}"
register: result
until: result.status == 200 or result.status == 302
retries: 3
delay: 2
delegate_to: 127.0.0.1 #run check from deploy host
1 change: 1 addition & 0 deletions roles/haproxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
url: "https://haproxy.debian.net/bernat.debian.org.gpg"
dest: "/etc/apt/trusted.gpg.d/haproxy.asc"
mode: '0644'
when: not ansible_check_mode # task reports change in check mode when there is none

- name: Add HAProxy repository to sources list
ansible.builtin.copy:
Expand Down
17 changes: 17 additions & 0 deletions test_loadbalancers_playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: Test loadbalancer
hosts: loadbalancer
gather_facts: false
become: false
tasks:

- name: Read vars from secrets file
ansible.builtin.include_vars: "{{ inventory_dir }}/secrets/secrets.yml"
no_log: true
tags:
- always

- name: Include task list in play
ansible.builtin.include_tasks:
file: inc_test_loadbalancer_tasklist.yml
with_items: "{{ haproxy_applications }}"
Loading