add haproxy repo, custom config files & readme
This commit is contained in:
@@ -22,7 +22,19 @@
|
||||
notify:
|
||||
- haproxy restart
|
||||
|
||||
- name: haproxy | copy configuration file
|
||||
- name: haproxy | copy custom configuration file
|
||||
copy:
|
||||
src: "{{ haproxy_custom_configuration_file }}"
|
||||
dest: '/etc/haproxy/haproxy.cfg'
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0440'
|
||||
validate: 'haproxy -f %s -c {% if haproxy_accept_warnings %}-q{% endif %}'
|
||||
when: haproxy_custom_configuration_file is defined
|
||||
notify:
|
||||
- haproxy reload
|
||||
|
||||
- name: haproxy | copy default configuration file
|
||||
template:
|
||||
src: haproxy.cfg.j2
|
||||
dest: '/etc/haproxy/haproxy.cfg'
|
||||
@@ -30,5 +42,6 @@
|
||||
group: root
|
||||
mode: '0440'
|
||||
validate: 'haproxy -f %s -c {% if haproxy_accept_warnings %}-q{% endif %}'
|
||||
when: haproxy_custom_configuration_file is not defined
|
||||
notify:
|
||||
- haproxy reload
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
- name: haproxy | installation
|
||||
apt:
|
||||
name: haproxy
|
||||
state: present
|
||||
default_release: "{{ ansible_distribution_release }}-backports"
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
---
|
||||
- name: haproxy | add backports repository
|
||||
- name: haproxy | add Debian backports repository
|
||||
apt_repository:
|
||||
repo: deb http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main
|
||||
state: present
|
||||
filename: "{{ ansible_distribution_release }}-backports"
|
||||
|
||||
- name: haproxy | update apt cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
cache_valid_time: 86400
|
||||
|
||||
- name: haproxy | installation
|
||||
apt:
|
||||
name: haproxy
|
||||
state: present
|
||||
default_release: "{{ ansible_distribution_release }}-backports"
|
||||
20
tasks/install_from_haproxy.yml
Normal file
20
tasks/install_from_haproxy.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: haproxy | add HAProxy Debian repository key
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ haproxy_debian_repo_key_url }}"
|
||||
dest: /etc/apt/keyrings/haproxy-archive-keyring.gpg
|
||||
mode: '0644'
|
||||
|
||||
- name: haproxy | add HAProxy Debian repository
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "deb [signed-by=/etc/apt/keyrings/haproxy-archive-keyring.gpg] {{ haproxy_debian_repo_url }} {{ haproxy_debian_repo_distribution }}-backports-{{ haproxy_version }} {{ haproxy_debian_repo_component }}"
|
||||
state: present
|
||||
filename: 'haproxy'
|
||||
update_cache: yes
|
||||
|
||||
- name: haproxy | install HAProxy from HAProxy Debian repo
|
||||
ansible.builtin.apt:
|
||||
name: haproxy
|
||||
state: present
|
||||
update_cache: yes
|
||||
default_release: "{{ haproxy_debian_repo_distribution }}-backports-{{ haproxy_version }}"
|
||||
@@ -1,10 +1,11 @@
|
||||
---
|
||||
- name: haproxy | requirements
|
||||
include_tasks: requirements.yml
|
||||
- name: haproxy | install from backports
|
||||
include_tasks: install_from_backports.yml
|
||||
when: not haproxy_use_debian_repo | bool
|
||||
|
||||
- name: haproxy | installation
|
||||
include_tasks: install.yml
|
||||
- name: haproxy | install from HAProxy repo
|
||||
include_tasks: install_from_haproxy.yml
|
||||
when: haproxy_use_debian_repo | bool
|
||||
|
||||
- name: haproxy | configuration
|
||||
include_tasks: configure.yml
|
||||
|
||||
|
||||
Reference in New Issue
Block a user