Fixes #20387. Install the dataplane api executable

This commit is contained in:
Andrea Dell'Amico 2021-02-09 17:58:05 +01:00
parent 17223bed9c
commit b1b2ecb3ae
3 changed files with 28 additions and 0 deletions

View File

@ -8,6 +8,10 @@ haproxy_pkg_state: present
haproxy_enabled: True haproxy_enabled: True
haproxy_loglevel: info haproxy_loglevel: info
haproxy_k_bind_non_local_ip: True haproxy_k_bind_non_local_ip: True
haproxy_install_dataplane_api: True
haproxy_dataplane_api_version: '2.2.0'
haproxy_dataplane_api_download_url: 'https://github.com/haproxytech/dataplaneapi/releases/download/v{{ haproxy_dataplane_api_version }}/dataplaneapi_{{ haproxy_dataplane_api_version }}_Linux_x86_64.tar.gz'
haproxy_docker_container: False haproxy_docker_container: False
haproxy_docker_version: '{{ haproxy_version }}.6' haproxy_docker_version: '{{ haproxy_version }}.6'
haproxy_docker_image: 'haproxytech/haproxy-debian:{{ haproxy_docker_version }}' haproxy_docker_image: 'haproxytech/haproxy-debian:{{ haproxy_docker_version }}'

View File

@ -0,0 +1,20 @@
---
- name: Manage the dataplaneapi executable
block:
- name: Create the dataplaneapi dest directory
file:
dest: '/opt/haproxy-api'
state: directory
- name: Download and unpack the dataplaneapi executable
unarchive:
remote_src: yes
src: '{{ haproxy_dataplane_api_download_url }}'
dest: '/opt/haproxy-api'
mode: '0755'
owner: root
group: root
args:
creates: '/opt/haproxy-api/build/dataplaneapi'
tags: [ 'haproxy', 'haproxy_dataplane', 'haproxy_dataplaneapi' ]

View File

@ -2,6 +2,10 @@
- import_tasks: haproxy-sysctl.yml - import_tasks: haproxy-sysctl.yml
- import_tasks: haproxy-service.yml - import_tasks: haproxy-service.yml
when: not haproxy_docker_container when: not haproxy_docker_container
- import_tasks: haproxy-dataplaneapi.yml
when:
- not haproxy_docker_container
- haproxy_install_dataplane_api
- import_tasks: haproxy-letsencrypt-acme-sh.yml - import_tasks: haproxy-letsencrypt-acme-sh.yml
when: when:
- haproxy_letsencrypt_managed - haproxy_letsencrypt_managed