feat: add alpine support
This commit is contained in:
parent
4f048ce7a7
commit
78b6e081cb
3 changed files with 49 additions and 14 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# restart haproxy
|
# restart haproxy
|
||||||
- name: "restart haproxy"
|
- name: "restart haproxy"
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.service:
|
||||||
name: "haproxy"
|
name: "haproxy"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,17 @@
|
||||||
|
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: "siempie"
|
author: "siempie"
|
||||||
description: "install and configure HAProxy load balancer"
|
description: "install and configure HAProxy load balancer on Debian and Alpine systems"
|
||||||
license: "MIT"
|
license: "MIT"
|
||||||
role_name: "haproxy"
|
role_name: "haproxy"
|
||||||
|
platforms:
|
||||||
|
- name: "Debian"
|
||||||
|
versions:
|
||||||
|
- "all"
|
||||||
|
- name: "Ubuntu"
|
||||||
|
versions:
|
||||||
|
- "all"
|
||||||
|
- name: "Alpine"
|
||||||
|
versions:
|
||||||
|
- "all"
|
||||||
dependencies: []
|
dependencies: []
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,41 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
# install haproxy
|
# install on debian
|
||||||
- name: "install - haproxy"
|
- name: "install on debian"
|
||||||
ansible.builtin.apt:
|
|
||||||
name: "haproxy"
|
|
||||||
state: "latest"
|
|
||||||
cache_valid_time: "120"
|
|
||||||
when: 'ansible_os_family == "Debian"'
|
when: 'ansible_os_family == "Debian"'
|
||||||
|
block:
|
||||||
|
|
||||||
# start haproxy service
|
# install haproxy
|
||||||
- name: "service - start haproxy"
|
- name: "install - haproxy"
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.apt:
|
||||||
name: "haproxy"
|
name: "haproxy"
|
||||||
state: "started"
|
state: "latest"
|
||||||
enabled: true
|
cache_valid_time: "120"
|
||||||
|
|
||||||
|
# start haproxy service
|
||||||
|
- name: "service - start haproxy"
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: "haproxy"
|
||||||
|
state: "started"
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
|
||||||
|
# install on alpine
|
||||||
|
- name: "install on alpine"
|
||||||
|
when: 'ansible_os_family == "Alpine"'
|
||||||
|
block:
|
||||||
|
|
||||||
|
# install haproxy
|
||||||
|
- name: "install - haproxy"
|
||||||
|
community.general.apk:
|
||||||
|
name: "haproxy"
|
||||||
|
state: "latest"
|
||||||
|
update_cache: true
|
||||||
|
when: 'ansible_os_family == "Alpine"'
|
||||||
|
|
||||||
|
# start haproxy service
|
||||||
|
- name: "service - start haproxy"
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: "haproxy"
|
||||||
|
state: "started"
|
||||||
|
enabled: true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue