Select Git revision
install.yml
David Mehren authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
install.yml 1.47 KiB
---
- name: Add HAProxy 2.6 PPA
apt_repository:
repo: 'ppa:vbernat/haproxy-2.6'
state: present
- name: Remove HAProxy 2.5 PPA
apt_repository:
repo: 'ppa:vbernat/haproxy-2.5'
state: absent
- name: Remove HAProxy 2.4 PPA
apt_repository:
repo: 'ppa:vbernat/haproxy-2.4'
state: absent
- name: Remove HAProxy 2.3 PPA
apt_repository:
repo: 'ppa:vbernat/haproxy-2.3'
state: absent
- name: Remove HAProxy 2.2 PPA
apt_repository:
repo: 'ppa:vbernat/haproxy-2.2'
state: absent
- name: Remove HAProxy 2.1 PPA
apt_repository:
repo: 'ppa:vbernat/haproxy-2.1'
state: absent
- name: Remove HAProxy 2.0 PPA
apt_repository:
repo: 'ppa:vbernat/haproxy-2.0'
state: absent
- name: Remove HAProxy 1.8 PPA
apt_repository:
repo: 'ppa:vbernat/haproxy-1.8'
state: absent
- name: Install HAProxy
apt:
name: "haproxy=2.6.*"
state: present
update_cache: yes
- name: 'Enable haproxy unit'
systemd:
name: haproxy
enabled: yes
- name: 'Ensure chroot directory exists'
file:
name: "{{ haproxy_global.chroot }}"
state: directory
when: haproxy_global.chroot is defined and haproxy_global.chroot
- name: Create service override directory
file:
path: /etc/systemd/system/haproxy.service.d
state: directory
- name: Copy service override
copy:
dest: /etc/systemd/system/haproxy.service.d/override.conf
content: |
[Unit]
Wants=network-online.target