diff --git a/letsencrypt-acme-sh-client/files/acme-sh-install b/letsencrypt-acme-sh-client/files/acme-sh-install index e006f15e..e212f7fd 100644 --- a/letsencrypt-acme-sh-client/files/acme-sh-install +++ b/letsencrypt-acme-sh-client/files/acme-sh-install @@ -6,7 +6,7 @@ else exit 1 fi -cd "$ACME_SH_HOME" +cd "$ACME_SH_GIT_DIST_DIR" ./acme.sh $ACME_SH_INSTALL_OPTS exit $? diff --git a/letsencrypt-acme-sh-client/tasks/main.yml b/letsencrypt-acme-sh-client/tasks/main.yml index 20a59905..fe90dbb3 100644 --- a/letsencrypt-acme-sh-client/tasks/main.yml +++ b/letsencrypt-acme-sh-client/tasks/main.yml @@ -1,5 +1,9 @@ --- - block: + - name: Install the git client if we are installing using git + apt: pkg=git update_cache=yes cache_valid_time=1800 + when: letsencrypt_acme_sh_git_install + - name: Create the letsencrypt acme user user: name={{ letsencrypt_acme_sh_user }} home={{ letsencrypt_acme_sh_user_home }} createhome=no shell=/usr/sbin/nologin system=yes tags: [ 'letsencrypt', 'letsencrypt_user' ] @@ -35,7 +39,7 @@ - block: - name: Download the acme.sh distribution - git: repo={{ letsencrypt_acme_sh_git_url }} dest={{ letsencrypt_acme_sh_user_home }} recursive=yes update=yes + git: repo={{ letsencrypt_acme_sh_git_url }} dest={{ letsencrypt_acme_git_dest_dir }} recursive=yes update=yes - name: Create the letsencrypt acme.sh directory tree file: dest={{ item }} state=directory mode=0755 diff --git a/letsencrypt-acme-sh-client/templates/acme_sh_request_env.j2 b/letsencrypt-acme-sh-client/templates/acme_sh_request_env.j2 index 160cd401..15ae2615 100644 --- a/letsencrypt-acme-sh-client/templates/acme_sh_request_env.j2 +++ b/letsencrypt-acme-sh-client/templates/acme_sh_request_env.j2 @@ -9,6 +9,7 @@ ACME_SH_ENV_FILE=${ACME_SH_BINDIR}/acme.sh.env ACME_SH_ISSUE_LOG_FILE={{ letsencrypt_acme_sh_base_data_dir }}/logs/cert_issue.log ACME_SH_CRON_LOG_FILE={{ letsencrypt_acme_sh_base_data_dir }}/logs/cron.log ACME_SH_INSTALL_LOG_FILE={{ letsencrypt_acme_sh_log_dir }}/cert_install.log +ACME_SH_GIT_DIST_DIR={{ letsencrypt_acme_git_dest_dir }} ACME_SH_INSTALL_CERTS={{ letsencrypt_acme_sh_explicitly_install_certs }}