summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorPaul Tötterman <ptman@users.noreply.github.com>2020-07-03 13:08:01 +0300
committerGitHub <noreply@github.com>2020-07-03 10:08:01 +0000
commit0350f4bbebd0e9afd952611b377941bca269fb3c (patch)
tree8aac1a45eb9100adbb1a4c30c09cf77e65fead18 /ansible
parent3f87b55a526d3e59f5c14527dbe172a23d4a3854 (diff)
Fix ansible for Ubuntu 20.04 Focal (#856)
* Fix ansible for Ubuntu 20.04 Focal * Use proper version comparison * Changes based on feedback
Diffstat (limited to 'ansible')
-rw-r--r--ansible/lemmy.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/ansible/lemmy.yml b/ansible/lemmy.yml
index 5c8a5f91..a73f7293 100644
--- a/ansible/lemmy.yml
+++ b/ansible/lemmy.yml
@@ -11,6 +11,7 @@
when: lemmy_base_dir is not defined
- name: install python for Ansible
+ # python2-minimal instead of python-minimal for ubuntu 20.04 and up
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal python-setuptools)
args:
executable: /bin/bash
@@ -27,7 +28,18 @@
- 'docker-compose'
- 'docker.io'
- 'certbot'
+
+ - name: install certbot-nginx on ubuntu < 20
+ apt:
+ pkg:
- 'python-certbot-nginx'
+ when: ansible_distribution == 'Ubuntu' and ansible_distribution_version|version_compare('20.04', '<')
+
+ - name: install certbot-nginx on ubuntu > 20
+ apt:
+ pkg:
+ - 'python3-certbot-nginx'
+ when: ansible_distribution == 'Ubuntu' and ansible_distribution_version|version_compare('20.04', '>=')
- name: request initial letsencrypt certificate
command: certbot certonly --nginx --agree-tos -d '{{ domain }}' -m '{{ letsencrypt_contact_email }}'