feat: can install other haproxy release

This commit is contained in:
Adrien Waksberg 2021-08-15 17:41:47 +02:00 committed by Adrien Waksberg
parent 26cb8de38e
commit 757d6157ee
6 changed files with 15 additions and 3 deletions

View file

@ -7,6 +7,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
### Added
- can specify the haproxy repository
- add resolvers configuration
- add debian11 support
- add IPs lists

View file

@ -14,6 +14,7 @@ Install and configure haproxy
## Role variables
- `haproxy_apt_release` - set the apt release to use (default: `ansible_distribution_release`)
- `haproxy_global` - hash with the global configuration
```

View file

@ -1,7 +1,7 @@
---
haproxy_apt_release: '{{ ansible_distribution_release }}'
haproxy_stats_username: admin
haproxy_stats_password: secret
haproxy_global: {}
haproxy_default_global:
log-send-hostname: true

View file

@ -66,6 +66,10 @@
- google.fr google.com:443 ssl verify none check resolvers dns init-addr none
pre_tasks:
- name: add backports repository
ansible.builtin.apt_repository:
repo: 'deb http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main'
- name: update apt cache
ansible.builtin.apt:
update_cache: true

View file

@ -18,6 +18,11 @@ platforms:
command: /bin/systemd
capabilities:
- SYS_ADMIN
provisioner:
inventory:
host_vars:
debian10:
haproxy_apt_release: '{{ ansible_distribution_release }}-backports'
lint: |
set -e
yamllint .

View file

@ -1,8 +1,9 @@
---
- name: install Haproxy
ansible.builtin.package:
- name: install package
ansible.builtin.apt:
name:
- haproxy
default_release: '{{ haproxy_apt_release }}'
retries: 2
register: result
until: result is succeeded