ansible-role-haproxy/tasks/haproxy-service.yml

47 lines
1.5 KiB
YAML

---
- name: Get the haproxy repo key
apt_key: url={{ haproxy_repo_key }} state=present
when: haproxy_latest_release
tags: haproxy
- name: Define the haproxy repository
apt_repository: repo='{{ haproxy_ubuntu_latest_repo }}' state=present update_cache=yes
when:
- haproxy_latest_release
- ansible_distribution == "Ubuntu"
tags: haproxy
- name: Define the haproxy repository
apt_repository: repo='{{ haproxy_debian_latest_repo }}' state=present update_cache=yes
when:
- haproxy_latest_release
- ansible_distribution == "Debian"
tags: haproxy
- name: Install the haproxy package
apt: name=haproxy state=present default_release={{ ansible_lsb.codename }}-backports update_cache=yes cache_valid_time=3600
when: not haproxy_latest_release
register: install_haproxy
tags: haproxy
- name: Install the haproxy package
apt: name=haproxy state=latest default_release={{ ansible_lsb.codename }}-backports-{{ haproxy_version }} update_cache=yes cache_valid_time=3600
when:
- haproxy_latest_release
- ansible_distribution == "Debian"
register: install_haproxy
tags: haproxy
- name: Install the haproxy package
apt: name=haproxy state=latest update_cache=yes cache_valid_time=3600
when:
- haproxy_latest_release
- ansible_distribution == "Ubuntu"
register: install_haproxy
tags: haproxy
- name: Install some additional packages
apt: name={{ haproxy_additional_pkgs }} state=latest update_cache=yes cache_valid_time=3600
when: haproxy_install_additional_pkgs