diff --git a/CHANGELOG.md b/CHANGELOG.md index a6c2d31..386e9de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 2270949..85d2eaa 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/defaults/main.yml b/defaults/main.yml index ca27b44..affab71 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index f7e5101..931248f 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -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 diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 95ab31f..ceb43f0 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -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 . diff --git a/tasks/main.yml b/tasks/main.yml index 8047ba3..58a057b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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