diff --git a/rattail_fabric/certbot.py b/rattail_fabric/certbot.py index 0c1d26a..fdf14dd 100644 --- a/rattail_fabric/certbot.py +++ b/rattail_fabric/certbot.py @@ -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: