Install python3-certbot-apache for debian 10

when applicable
This commit is contained in:
Lance Edgar 2019-09-09 14:19:03 -05:00
parent 039af4b394
commit 7fe63b9f19

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# Rattail -- Retail Software Framework # Rattail -- Retail Software Framework
# Copyright © 2010-2018 Lance Edgar # Copyright © 2010-2019 Lance Edgar
# #
# This file is part of Rattail. # This file is part of Rattail.
# #
@ -24,8 +24,6 @@
Fabric library for Let's Encrypt certbot Fabric library for Let's Encrypt certbot
""" """
from __future__ import unicode_literals, absolute_import
from rattail_fabric2 import apt, exists, get_debian_version from rattail_fabric2 import apt, exists, get_debian_version
@ -52,8 +50,8 @@ def install(c, source=False, service='apache'):
apt.add_source(c, 'deb http://ftp.debian.org/debian jessie-backports main') apt.add_source(c, 'deb http://ftp.debian.org/debian jessie-backports main')
apt.install(c, 'python-certbot-apache', target_release='jessie-backports') apt.install(c, 'python-certbot-apache', target_release='jessie-backports')
# debian 9 stretch, or later # debian 9 stretch
elif version >= 9: elif 9 <= version < 10:
if service == 'apache': if service == 'apache':
apt.install(c, 'python-certbot-apache') apt.install(c, 'python-certbot-apache')
elif service == 'nginx': elif service == 'nginx':
@ -61,6 +59,15 @@ def install(c, source=False, service='apache'):
else: else:
raise NotImplementedError("unknown web service: {}".format(service)) raise NotImplementedError("unknown web service: {}".format(service))
# debian 10 buster, or later
elif version >= 10:
if service == 'apache':
apt.install(c, 'python3-certbot-apache')
elif service == 'nginx':
apt.install(c, 'python3-certbot-nginx')
else:
raise NotImplementedError("unknown web service: {}".format(service))
# other..? will have to investigate when this comes up # other..? will have to investigate when this comes up
else: else:
raise NotImplementedError("don't know how to install certbot on debian version {}".format(version)) raise NotImplementedError("don't know how to install certbot on debian version {}".format(version))