ansible-role-orientdb/tasks/orientdb_letsencrypt.yml

29 lines
1.1 KiB
YAML

---
- name: orientdb_letsencrypt | Manage the Letsencrypt certificates
tags: ['orientdb', 'letsencrypt', 'orientdb_letsencrypt']
when: orientdb_letsencrypt_ssl_enabled
block:
- name: orientdb_letsencrypt | Create the acme hooks directory if it does not yet exist
ansible.builtin.file:
dest: "{{ letsencrypt_acme_services_scripts_dir }}"
state: directory
owner: root
group: root
mode: "0755"
- name: orientdb_letsencrypt | Install a letsencrypt hook to update the orientdb certificate
ansible.builtin.template:
src: orientdb-letsencrypt-acme.sh.j2
dest: "{{ letsencrypt_acme_services_scripts_dir }}/orientdb"
owner: root
group: root
mode: "4555"
- name: orientdb_letsencrypt | Remove the hook if letsencrypt is not used
tags: ['orientdb', 'letsencrypt', 'orientdb_letsencrypt']
when: not orientdb_letsencrypt_ssl_enabled
block:
- name: orientdb_letsencrypt | Install a letsencrypt hook to update the orientdb certificate
ansible.builtin.file:
dest: "{{ letsencrypt_acme_services_scripts_dir }}/orientdb"
state: absent