Переписал всё, сейчас вроде как отрабатывает без ошибок
This commit is contained in:
parent
436adfbc4f
commit
26f2ea374d
49 changed files with 1404 additions and 169 deletions
41
roles/geerlingguy.certbot/tasks/install-with-snap.yml
Normal file
41
roles/geerlingguy.certbot/tasks/install-with-snap.yml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
- name: Ensure snapd is installed.
|
||||
package:
|
||||
name: snapd
|
||||
state: present
|
||||
register: snapd_install
|
||||
|
||||
- name: Ensure snapd is enabled.
|
||||
systemd:
|
||||
name: snapd.socket
|
||||
enabled: true
|
||||
state: started
|
||||
|
||||
- name: Enable classic snap support.
|
||||
file:
|
||||
src: /var/lib/snapd/snap
|
||||
dest: /snap
|
||||
state: link
|
||||
when: ansible_os_family != "Debian"
|
||||
|
||||
- name: Update snap after install.
|
||||
shell: snap install core; snap refresh core
|
||||
changed_when: true
|
||||
failed_when: false
|
||||
when: snapd_install is changed
|
||||
|
||||
- name: Install certbot via snap.
|
||||
snap:
|
||||
name: certbot
|
||||
classic: true
|
||||
|
||||
- name: Symlink certbot into place.
|
||||
file:
|
||||
src: /snap/bin/certbot
|
||||
dest: /usr/bin/certbot
|
||||
state: link
|
||||
ignore_errors: "{{ ansible_check_mode }}"
|
||||
|
||||
- name: Set Certbot script variable.
|
||||
set_fact:
|
||||
certbot_script: /usr/bin/certbot
|
||||
Loading…
Add table
Add a link
Reference in a new issue