Files
ansible/roles/stunnel4/tasks/configure.yml
T
2026-09-20 22:14:56 +00:00

37 lines
962 B
YAML

---
- name: ensure /var/run/stunnel exists
ansible.builtin.file:
path: /var/run/stunnel
owner: stunnel4
group: stunnel4
state: directory
mode: "0755"
- name: ensure /var/log/stunnel exists
ansible.builtin.file:
path: /var/log/stunnel
state: directory
owner: stunnel4
group: stunnel4
mode: "0755"
- name: deploy stunnel config
ansible.builtin.copy:
src: "{{ item }}"
dest: "/etc/stunnel/{{ item | basename }}"
owner: root
group: root
mode: '0644'
loop: "{{ query('fileglob', role_path + '/files/' + inventory_hostname + '/*.conf') }}"
notify: restart stunnel4
- name: render stunnel config
ansible.builtin.template:
src: "{{ item }}"
dest: "/etc/stunnel/{{ item | basename | regex_replace('\\.j2$', '') }}"
owner: root
group: root
mode: '0644'
loop: "{{ query('fileglob', role_path + '/templates/' + inventory_hostname + '/*.conf.j2') }}"
notify: restart stunnel4