Add epel repository for snap install method

Remove the old cerbot package
This commit is contained in:
Guilherme Balzana 2021-02-25 14:58:02 +00:00
parent 00927c9aff
commit a6a9b7cf95
4 changed files with 14 additions and 3 deletions

View File

@ -45,4 +45,3 @@ certbot_dir: /opt/certbot
# no-self-upgrade # no-self-upgrade
# pre-hook = systemctl stop httpd # pre-hook = systemctl stop httpd
# post-hook = systemctl stop httpd # post-hook = systemctl stop httpd

View File

@ -14,7 +14,7 @@
- name: Add renew options to cli.ini file - name: Add renew options to cli.ini file
copy: copy:
path: /etc/letsencrypt/cli.ini path: /etc/letsencrypt/cli.ini
content: {{ certbot_cli_options }} content: "{{ certbot_cli_options }}"
when: certbot_cli_options is defined when: certbot_cli_options is defined
- name: Generate new certificate if one doesn't exist. - name: Generate new certificate if one doesn't exist.

View File

@ -1,4 +1,10 @@
--- ---
- name: Ensure EPEL repository.
package:
name: epel-release
state: present
when: ansible_os_family == "RedHat"
- name: Ensure snapd is installed. - name: Ensure snapd is installed.
package: package:
name: snapd name: snapd
@ -7,7 +13,7 @@
- name: Ensure snapd is enabled. - name: Ensure snapd is enabled.
systemd: systemd:
name: snapd.socket name: snapd
enabled: true enabled: true
- name: Enable classic snap support. - name: Enable classic snap support.
@ -22,6 +28,11 @@
failed_when: false failed_when: false
when: snapd_install is changed when: snapd_install is changed
- name: Remove old certbot packages.
package:
name: "{{ certbot_package }}"
state: absent
- name: Install certbot via snap. - name: Install certbot via snap.
snap: snap:
name: certbot name: certbot

View File

@ -6,3 +6,4 @@
minute: "{{ certbot_auto_renew_minute }}" minute: "{{ certbot_auto_renew_minute }}"
hour: "{{ certbot_auto_renew_hour }}" hour: "{{ certbot_auto_renew_hour }}"
user: "{{ certbot_auto_renew_user }}" user: "{{ certbot_auto_renew_user }}"
when: certbot_install_method == 'package' or certbot_install_method == 'source'