diff --git a/README.md b/README.md index 5bfc460..3c1c271 100644 --- a/README.md +++ b/README.md @@ -12,5 +12,4 @@ All variables are in the defaults folder, however the most importants are: - acme_sh_email: "example@example.com" # mail address with acme install ## todo -- Set and register the default CA -- Issue cert on domains \ No newline at end of file +- Issue cert on domains diff --git a/tasks/install_acmesh.yml b/tasks/install_acmesh.yml index 9647cf1..4d30e77 100644 --- a/tasks/install_acmesh.yml +++ b/tasks/install_acmesh.yml @@ -15,3 +15,21 @@ --config-home {{ acme_sh_config_home | quote }} -m {{ acme_sh_email | quote }} creates: "{{ acme_sh_home }}" + +- name: Set CA + ansible.builtin.command: + chdir: "{{ acme_sh_home }}" + cmd: | + /bin/sh acme.sh + --config-home {{ acme_sh_config_home | quote }} + --set-default-ca + --server {{ acme_sh_default_ca_server | quote }} + +- name: Register CA + ansible.builtin.command: + chdir: "{{ acme_sh_home }}" + cmd: | + /bin/sh acme.sh + --config-home {{ acme_sh_config_home | quote }} + --register-account + \ No newline at end of file diff --git a/tasks/issue_cert.yml b/tasks/issue_cert.yml new file mode 100644 index 0000000..f62be41 --- /dev/null +++ b/tasks/issue_cert.yml @@ -0,0 +1,9 @@ +- name: Register CA + ansible.builtin.command: + chdir: "{{ acme_sh_home }}" + cmd: | + /bin/sh acme.sh + --config-home {{ acme_sh_config_home | quote }} + --set-default-ca + --server {{ acme_sh_default_ca_server | quote }} +