merge haproxy roles

This commit is contained in:
Jérémy Lecour 2017-07-13 09:47:29 +02:00
parent f78e93e0ff
commit ec9e8d3d8b
11 changed files with 30 additions and 71 deletions

View File

@ -1,28 +0,0 @@
---
driver:
name: docker
privileged: true
use_sudo: false
provisioner:
name: ansible_playbook
hosts: test-kitchen
roles_path: ../
ansible_verbose: true
require_ansible_source: false
require_chef_for_busser: false
idempotency_test: true
platforms:
- name: debian
driver_config:
image: evolix/ansible:2.2.1
suites:
- name: default
provisioner:
name: ansible_playbook
playbook: ./tests/test.yml
transport:
max_ssh_sessions: 6

View File

@ -1,5 +0,0 @@
# 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/`.

View File

@ -1,4 +0,0 @@
---
- name: apt update
apt:
update_cache: yes

View File

@ -1,19 +0,0 @@
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.

View File

@ -1,10 +0,0 @@
---
- 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

View File

@ -1,4 +0,0 @@
---
- hosts: test-kitchen
roles:
- role: haproxy-backports-preferences

View File

@ -8,7 +8,7 @@ Everything is in the `tasks/main.yml` file.
## Available variables
There is no variable.
* `haproxy_jessie_backports` : on Debian Jessie, we can prefer v1.7 from backports (default: `False`)
## Configuration templates

View File

@ -0,0 +1,3 @@
---
haproxy_jessie_backports: False

View File

@ -5,6 +5,10 @@
state: installed
tags:
- haproxy
- packages
- include: jessie_backports.yml
when: ansible_distribution_release == "jessie" and haproxy_jessie_backports
- name: Install HAProxy package
apt:
@ -12,6 +16,7 @@
state: installed
tags:
- haproxy
- packages
- name: Copy HAProxy configuration
template:
@ -26,3 +31,4 @@
notify: reload haproxy
tags:
- haproxy
- config

View File

@ -0,0 +1,20 @@
---
- name: Prefer HAProxy package from jessie-backports
copy:
src: haproxy_apt_preferences
dest: /etc/apt/preferences.d/999-haproxy
force: yes
mode: "0640"
register: haproxy_apt_preferences
tags:
- haproxy
- packages
- name: update apt
apt:
update_cache: yes
when: haproxy_apt_preferences | changed
tags:
- haproxy
- packages