tlshd: First version of role
This commit is contained in:
parent
9d6418ca71
commit
121687ad7c
3 changed files with 51 additions and 0 deletions
5
roles/tlshd/handlers/main.yml
Normal file
5
roles/tlshd/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- name: Restart tlshd
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: tlshd
|
||||||
|
state: restarted
|
30
roles/tlshd/tasks/main.yml
Normal file
30
roles/tlshd/tasks/main.yml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
---
|
||||||
|
- name: Install packages
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: ktls-utils
|
||||||
|
|
||||||
|
- name: Configure tlshd
|
||||||
|
ansible.builtin.template:
|
||||||
|
dest: /etc/tlshd.conf
|
||||||
|
src: tlshd.conf.j2
|
||||||
|
mode: "0644"
|
||||||
|
owner: root
|
||||||
|
group: "{{ ansible_wheel }}"
|
||||||
|
notify: Restart tlshd
|
||||||
|
|
||||||
|
- name: Configure tlshd private key
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: "{{ tls_private }}/tlshd.key"
|
||||||
|
src: "{{ tls_private }}/{{ inventory_hostname }}.key"
|
||||||
|
mode: "0600"
|
||||||
|
owner: root
|
||||||
|
group: "{{ ansible_wheel }}"
|
||||||
|
remote_src: true
|
||||||
|
tags: certificates
|
||||||
|
notify: Restart tlshd
|
||||||
|
|
||||||
|
- name: Enable tlshd services
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: tlshd
|
||||||
|
state: started
|
||||||
|
enabled: true
|
16
roles/tlshd/templates/tlshd.conf.j2
Normal file
16
roles/tlshd/templates/tlshd.conf.j2
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[debug]
|
||||||
|
loglevel=0
|
||||||
|
tls=0
|
||||||
|
nl=0
|
||||||
|
|
||||||
|
[authenticate]
|
||||||
|
|
||||||
|
[authenticate.client]
|
||||||
|
x509.truststore = {{ tls_certs }}/ca.crt
|
||||||
|
x509.certificate = {{ tls_certs }}/{{ inventory_hostname }}.crt
|
||||||
|
x509.private_key = {{ tls_private }}/tlshd.key
|
||||||
|
|
||||||
|
[authenticate.server]
|
||||||
|
x509.truststore = {{ tls_certs }}/ca.crt
|
||||||
|
x509.certificate = {{ tls_certs }}/{{ inventory_hostname }}.crt
|
||||||
|
x509.private_key = {{ tls_private }}/tlshd.key
|
Loading…
Add table
Reference in a new issue