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 ### Added
- can specify the haproxy repository
- add resolvers configuration - add resolvers configuration
- add debian11 support - add debian11 support
- add IPs lists - add IPs lists

View file

@ -14,6 +14,7 @@ Install and configure haproxy
## Role variables ## Role variables
- `haproxy_apt_release` - set the apt release to use (default: `ansible_distribution_release`)
- `haproxy_global` - hash with the global configuration - `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_username: admin
haproxy_stats_password: secret haproxy_stats_password: secret
haproxy_global: {} haproxy_global: {}
haproxy_default_global: haproxy_default_global:
log-send-hostname: true log-send-hostname: true

View file

@ -66,6 +66,10 @@
- google.fr google.com:443 ssl verify none check resolvers dns init-addr none - google.fr google.com:443 ssl verify none check resolvers dns init-addr none
pre_tasks: 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 - name: update apt cache
ansible.builtin.apt: ansible.builtin.apt:
update_cache: true update_cache: true

View file

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

View file

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