From 0622f8ab87d66b2a87f48a9ea4dffbf51f1b3e2c Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Fri, 10 Sep 2021 16:02:24 +0200 Subject: [PATCH] Some changes on acme.sh install process - Remove useless git directory - Force use letsencrypt as default CA --- tasks/install/acme.yml | 8 ++++++++ tasks/install/main.yml | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tasks/install/acme.yml b/tasks/install/acme.yml index b30d8a5..8a26684 100644 --- a/tasks/install/acme.yml +++ b/tasks/install/acme.yml @@ -24,4 +24,12 @@ chdir: "{{ nginx_acmesh_git_dir }}" creates: "{{ nginx_acmesh_dir }}" + - name: COMMAND | Force acme.sh to use letsencrypt (instead of zerossl) + ansible.builtin.command: '{{ nginx_acmesh_dir }}/acme.sh --set-default-ca --server letsencrypt --home "{{ nginx_acmesh_dir }}"' + when: not acme.stat.exists + +- name: FILE | Remove temp acme.sh dir + ansible.builtin.file: + path: '{{ nginx_acmesh_git_dir }}' + state: absent diff --git a/tasks/install/main.yml b/tasks/install/main.yml index 1d25321..4c3c3fd 100644 --- a/tasks/install/main.yml +++ b/tasks/install/main.yml @@ -4,4 +4,5 @@ ansible.builtin.include_tasks: "{{ ansible_distribution }}.yml" - name: IMPORT_TASKS | acme - ansible.builtin.include_tasks: "acme.yml" + ansible.builtin.import_tasks: "acme.yml" + when: nginx_acmesh