diff --git a/README.md b/README.md index f10aaa6..878ffc6 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,10 @@ webroot, nginx or Apache but nothing is set in stone. # needs to already exist, this role will not create it. acme_sh_become_user: "root" +# acme.sh package dependencies. The default values are for Debian / Ubuntu. +# For CentOS and Fedora you can replace "cron" with "crond". +acme_sh_dependencies: ["cron", "git", "wget"] + # The acme.sh repo to clone. acme_sh_git_url: "https://github.com/Neilpang/acme.sh" @@ -275,9 +279,6 @@ acme_sh_domains: # extra_issue_renew_hook: "" # # Optionally remove and disable the certificate. # remove: True - -# How long should the apt-cache last in seconds? -acme_sh_apt_cache_time: 86400 ``` ## Example usage diff --git a/defaults/main.yml b/defaults/main.yml index 174a6de..b530805 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,6 +2,8 @@ acme_sh_become_user: "root" +acme_sh_dependencies: ["cron", "git", "wget"] + acme_sh_git_url: "https://github.com/Neilpang/acme.sh" acme_sh_git_version: "master" acme_sh_git_update: False @@ -42,5 +44,3 @@ acme_sh_default_issue_renew_hook: "" acme_sh_default_remove: False acme_sh_domains: [] - -acme_sh_apt_cache_time: 86400 diff --git a/tasks/main.yml b/tasks/main.yml index e161884..ed42f37 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,11 +1,10 @@ --- - name: Install dependencies - apt: + package: name: "{{ item }}" - update_cache: True - cache_valid_time: "{{ acme_sh_apt_cache_time }}" - loop: ["cron", "git", "wget"] + state: "present" + loop: "{{ acme_sh_dependencies }}" when: not acme_sh_uninstall - name: Create git clone path diff --git a/tests/test.yml b/tests/test.yml index a6b4f42..500b11f 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -14,6 +14,11 @@ name: "{{ acme_sh_become_user }}" shell: "/bin/bash" + - name: Run the equivalent of "apt-get update" + apt: + update_cache: true + changed_when: false + post_tasks: - name: Ensure acme.sh was cloned command: test -d /usr/local/src/acme.sh