From 9913b65d090ca3a3f045295afd82355c15632f9a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 28 Oct 2019 12:59:35 +0100 Subject: [PATCH] Install git and socat on CentOS too. --- .../tasks/{old_acmetool_deb.yml => acmetool_deb.yml} | 7 +++++++ .../tasks/{old_acmetool_rh.yml => acmetool_rh.yml} | 7 +++++++ .../roles/letsencrypt-acme-sh-client/tasks/main.yml | 11 ++--------- 3 files changed, 16 insertions(+), 9 deletions(-) rename library/roles/letsencrypt-acme-sh-client/tasks/{old_acmetool_deb.yml => acmetool_deb.yml} (60%) rename library/roles/letsencrypt-acme-sh-client/tasks/{old_acmetool_rh.yml => acmetool_rh.yml} (51%) diff --git a/library/roles/letsencrypt-acme-sh-client/tasks/old_acmetool_deb.yml b/library/roles/letsencrypt-acme-sh-client/tasks/acmetool_deb.yml similarity index 60% rename from library/roles/letsencrypt-acme-sh-client/tasks/old_acmetool_deb.yml rename to library/roles/letsencrypt-acme-sh-client/tasks/acmetool_deb.yml index a188d827..a064d57f 100644 --- a/library/roles/letsencrypt-acme-sh-client/tasks/old_acmetool_deb.yml +++ b/library/roles/letsencrypt-acme-sh-client/tasks/acmetool_deb.yml @@ -9,4 +9,11 @@ - name: Remove the old letsencrypt acmetool repo on debian apt_repository: repo={{ letsencrypt_acme_debian_repo }} state=absent update_cache=yes + - name: Install the socat utility, needed when using the http protocols to request the certificates + apt: pkg=socat state=present cache_valid_time=1800 + + - name: Install the git client if we are installing using git + apt: pkg=git state=present cache_valid_time=1800 + when: letsencrypt_acme_sh_git_install + tags: [ 'letsencrypt', 'letsencrypt_acme_sh' ] diff --git a/library/roles/letsencrypt-acme-sh-client/tasks/old_acmetool_rh.yml b/library/roles/letsencrypt-acme-sh-client/tasks/acmetool_rh.yml similarity index 51% rename from library/roles/letsencrypt-acme-sh-client/tasks/old_acmetool_rh.yml rename to library/roles/letsencrypt-acme-sh-client/tasks/acmetool_rh.yml index 36173c5d..a51b060e 100644 --- a/library/roles/letsencrypt-acme-sh-client/tasks/old_acmetool_rh.yml +++ b/library/roles/letsencrypt-acme-sh-client/tasks/acmetool_rh.yml @@ -5,4 +5,11 @@ - name: Remove the acmetool repo file file: dest=/etc/yum.repos.d/hlandau-acmetool-epel-7.repo state=absent + - name: Install the socat utility, needed when using the http protocols to request the certificates + yum: pkg=socat state=present + + - name: Install the git client if we are installing using git + yum: pkg=git state=present + when: letsencrypt_acme_sh_git_install + tags: [ 'letsencrypt', 'letsencrypt_acme_sh' ] diff --git a/library/roles/letsencrypt-acme-sh-client/tasks/main.yml b/library/roles/letsencrypt-acme-sh-client/tasks/main.yml index 6194ca2a..a65c34c9 100644 --- a/library/roles/letsencrypt-acme-sh-client/tasks/main.yml +++ b/library/roles/letsencrypt-acme-sh-client/tasks/main.yml @@ -1,8 +1,8 @@ --- -- import_tasks: old_acmetool_deb.yml +- import_tasks: acmetool_deb.yml when: ansible_distribution_file_variety == "Debian" -- import_tasks: old_acmetool_rh.yml +- import_tasks: acmetool_rh.yml when: ansible_distribution_file_variety == "RedHat" - block: @@ -18,13 +18,6 @@ tags: [ 'letsencrypt', 'letsencrypt_acme_sh' ] - block: - - name: Install the socat utility, needed when using the http protocols to request the certificates - apt: pkg=socat cache_valid_time=1800 - - - name: Install the git client if we are installing using git - apt: pkg=git 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' ]