haproxy: use APT preferences to install haproxy from backports
This commit is contained in:
parent
597ae12dca
commit
fd5324db84
5
haproxy-backports-preferences/README.md
Normal file
5
haproxy-backports-preferences/README.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# haproxy-backports-preferences
|
||||||
|
|
||||||
|
Configure APT to prefer haproxy package from jessie-backports.
|
||||||
|
|
||||||
|
There is no variable, just a files copied to `/etc/apt/preferences.d/`.
|
3
haproxy-backports-preferences/files/haproxy_preferences
Normal file
3
haproxy-backports-preferences/files/haproxy_preferences
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Package: haproxy
|
||||||
|
Pin: release a=jessie-backports
|
||||||
|
Pin-Priority: 999
|
4
haproxy-backports-preferences/handlers/main.yml
Normal file
4
haproxy-backports-preferences/handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
- name: apt update
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
19
haproxy-backports-preferences/meta/main.yml
Normal file
19
haproxy-backports-preferences/meta/main.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
galaxy_info:
|
||||||
|
author: Evolix
|
||||||
|
description: Configure APT to prefer haproxy package from jessie-backports
|
||||||
|
|
||||||
|
issue_tracker_url: https://forge.evolix.org/projects/ansible-roles/issues
|
||||||
|
|
||||||
|
license: GPLv2
|
||||||
|
|
||||||
|
min_ansible_version: 2.2
|
||||||
|
|
||||||
|
platforms:
|
||||||
|
- name: Debian
|
||||||
|
versions:
|
||||||
|
- jessie
|
||||||
|
|
||||||
|
dependencies: []
|
||||||
|
# List your role dependencies here, one per line.
|
||||||
|
# Be sure to remove the '[]' above if you add dependencies
|
||||||
|
# to this list.
|
10
haproxy-backports-preferences/tasks/main.yml
Normal file
10
haproxy-backports-preferences/tasks/main.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: Prefer HAProxy package from jessie-backports
|
||||||
|
copy:
|
||||||
|
src: haproxy_preferences
|
||||||
|
dest: /etc/apt/preferences.d/999-haproxy
|
||||||
|
force: yes
|
||||||
|
mode: "0640"
|
||||||
|
notify: apt update
|
||||||
|
|
||||||
|
- meta: flush_handlers
|
|
@ -8,10 +8,7 @@ Everything is in the `tasks/main.yml` file.
|
||||||
|
|
||||||
## Available variables
|
## Available variables
|
||||||
|
|
||||||
* `general_package_release`: which Debian release to use generally (default: `stable`).
|
There is no variable.
|
||||||
* `haproxy_package_release`: which Debian release to use for HAProxy (default: `general_package_release`).
|
|
||||||
|
|
||||||
The full list of variables (with default values) can be found in `defaults/main.yml`.
|
|
||||||
|
|
||||||
## Configuration templates
|
## Configuration templates
|
||||||
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
general_package_release: stable
|
|
|
@ -8,9 +8,7 @@
|
||||||
- name: Install HAProxy package
|
- name: Install HAProxy package
|
||||||
apt:
|
apt:
|
||||||
name: haproxy
|
name: haproxy
|
||||||
default_release: "{{ haproxy_package_release or general_package_release | mandatory }}"
|
state: installed
|
||||||
update_cache: True
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Copy HAProxy configuration
|
- name: Copy HAProxy configuration
|
||||||
template:
|
template:
|
||||||
|
|
Loading…
Reference in a new issue