Kapisi/roles/SSL/tasks/main.yml

57 lines
1.1 KiB
YAML
Raw Normal View History

2020-10-08 16:33:19 -05:00
---
- name: SSL packages
become: yes
package:
name:
2020-10-08 16:33:19 -05:00
- certbot
- openssl
2022-01-25 23:54:43 -06:00
- name: Services
become: yes
register: services
copy:
src: "{{ item }}"
dest: /usr/lib/systemd/system
owner: root
group: root
mode: 0644
loop:
2022-01-25 23:54:43 -06:00
- "certbot.service"
- "certbot.timer"
- name: Enable timer
when: services.changed
become: yes
2022-01-25 23:54:43 -06:00
systemd:
daemon_reload: yes
name: certbot.timer
enabled: yes
state: started
2022-01-25 23:54:43 -06:00
- name: Create letsencrypt folder
become: yes
file:
path: /var/lib/letsencrypt
owner: root
group: http
mode: 2755
- name: Remove old TLSA script
become: yes
file:
path: /usr/local/sbin/tlsa-generation.bash
state: absent
- name: Copy record generator script
2022-01-25 23:54:43 -06:00
become: yes
template:
src: record-generation.bash.j2
dest: /usr/local/sbin/record-generation.bash
2022-01-25 23:54:43 -06:00
owner: root
group: root
mode: 0700
- debug:
msg: 'Run `sudo /usr/local/sbin/record-generation.bash` to generate a zonefile for import into a DNS provider.'