Ansible Role - Certbot (for Let's Encrypt)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-role-certbot/tasks/install-with-snap.yml

37 lines
800 B

---
- name: Ensure snapd is installed.
2 months ago
ansible.builtin.package:
name: snapd
state: present
2 months ago
notify:
- Update snap after install
- name: Ensure snapd is enabled.
2 months ago
ansible.builtin.systemd:
name: snapd.socket
enabled: true
state: started
- name: Enable classic snap support.
2 months ago
ansible.builtin.file:
src: /var/lib/snapd/snap
dest: /snap
state: link
when: ansible_os_family != "Debian"
- name: Install certbot via snap.
2 months ago
community.general.snap:
name: certbot
classic: true
- name: Symlink certbot into place.
2 months ago
ansible.builtin.file:
src: /snap/bin/certbot
dest: /usr/bin/certbot
state: link
ignore_errors: "{{ ansible_check_mode }}"
- name: Set Certbot script variable.
2 months ago
ansible.builtin.set_fact:
certbot_script: /usr/bin/certbot