add requirements && create config file

This commit is contained in:
Ludovic Cartier
2025-10-22 15:34:42 +02:00
parent d6df0110a4
commit 156c60c8fa
3 changed files with 20 additions and 0 deletions

View File

@@ -10,6 +10,14 @@
- '/etc/haproxy/ssl/certs' - '/etc/haproxy/ssl/certs'
- '/etc/haproxy/ssl/self' - '/etc/haproxy/ssl/self'
- name: haproxy | create ACL file
file:
path: /etc/haproxy/without_ssl.txt
state: touch
owner: root
group: root
mode: '0644'
- name: haproxy | create default self-signed certificate - name: haproxy | create default self-signed certificate
shell: | shell: |
openssl req -newkey rsa:2048 -nodes -sha256 -x509 -subj "{{ haproxy_ssl_self_signed_subj }}/CN={{ item }}" -days {{ haproxy_ssl_self_signed_days }} -keyout "{{ item }}.key" -out "{{ item }}.crt" -extensions v3_ca openssl req -newkey rsa:2048 -nodes -sha256 -x509 -subj "{{ haproxy_ssl_self_signed_subj }}/CN={{ item }}" -days {{ haproxy_ssl_self_signed_days }} -keyout "{{ item }}.key" -out "{{ item }}.crt" -extensions v3_ca

View File

@@ -1,4 +1,7 @@
--- ---
- name: haproxy | install requirements
include_tasks: requirements.yml
- name: haproxy | install from backports - name: haproxy | install from backports
include_tasks: install_from_backports.yml include_tasks: install_from_backports.yml
when: not haproxy_use_debian_repo | bool when: not haproxy_use_debian_repo | bool

9
tasks/requirements.yml Normal file
View File

@@ -0,0 +1,9 @@
---
- name: haproxy | install requirements
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- apt-transport-https
- gpg