Add nginx mode for installing certbot

This commit is contained in:
Lance Edgar 2018-03-15 03:46:47 -05:00
parent 4af428db78
commit dff44209d8

View file

@ -32,7 +32,7 @@ from fabric.contrib.files import exists
from rattail_fabric import apt, get_debian_version
def install(source=False):
def install(source=False, service='apache'):
"""
Install the Let's Encrypt certbot utility
"""
@ -59,7 +59,12 @@ def install(source=False):
# debian 9 stretch, or later
elif version >= 9:
apt.install('python-certbot-apache')
if service == 'apache':
apt.install('python-certbot-apache')
elif service == 'nginx':
apt.install('python-certbot-nginx')
else:
raise NotImplementedError("unknown web service: {}".format(service))
# other..? will have to investigate when this comes up
else: