Files
configpolicy/roles/haproxy/tasks/main.yml
Dustin C. Hatch 909c8e7a03 roles/haproxy: Add support for Debian hosts
Debian does not support system-wide SSL cipher suite profiles of course,
so these options need to be specified explicitly when deploying HAProxy
on Debian-based machines.
2019-03-22 09:29:56 -05:00

50 lines
1.1 KiB
YAML

- name: load distribution-specific values
include_vars: '{{ item }}'
with_first_found:
- '{{ ansible_distribution }}.yml'
- defaults.yml
- name: ensure haproxy is installed
package:
name=haproxy
state=present
tags:
- install
- name: ensure haproxy unit configuration extension directory exists
file:
path=/etc/systemd/system/haproxy.service.d
mode=0755
state=directory
- name: ensure haproxy config variable override is set
copy:
src=haproxy-config.conf
dest=/etc/systemd/system/haproxy.service.d/config.conf
mode=0644
notify:
- reload systemd
- restart haproxy
- name: ensure default haproxy configuration file is empty
copy:
src=haproxy.cfg
dest=/etc/haproxy
mode=0644
notify: restart haproxy
- name: ensure haproxy global configuration is set
template:
src=global.cfg.j2
dest=/etc/haproxy/10-global.cfg
mode=0644
notify: restart haproxy
- name: ensure haproxy defaults are set
template:
src=defaults.cfg.j2
dest=/etc/haproxy/20-defaults.cfg
mode=0644
notify: restart haproxy
- name: ensure haproxy starts at boot
service:
name=haproxy
enabled=yes