Add fablib support for installing certbot on debian 7 wheezy

This commit is contained in:
Lance Edgar 2016-10-17 18:35:49 -05:00
parent 07447821fb
commit 8010847e23
2 changed files with 12 additions and 4 deletions

View file

@ -26,7 +26,8 @@ Fabric library for Let's Encrypt certbot
from __future__ import unicode_literals, absolute_import from __future__ import unicode_literals, absolute_import
from fabric.api import sudo, abort from fabric.api import sudo, cd, abort
from fabric.contrib.files import exists
from rattail.fablib import apt, get_debian_version from rattail.fablib import apt, get_debian_version
@ -37,12 +38,19 @@ def install():
""" """
version = get_debian_version() version = get_debian_version()
# debian 7 wheezy
if 7 <= version < 8:
if not exists('/usr/local/src/certbot'):
with cd('/usr/local/src'):
sudo('git clone https://github.com/certbot/certbot')
sudo('ln --symbolic --force /usr/local/src/certbot/certbot-auto /usr/local/bin/certbot')
# debian 8 jessie # debian 8 jessie
if 8 <= version < 9: elif 8 <= version < 9:
apt.add_source('deb http://ftp.debian.org/debian jessie-backports main') apt.add_source('deb http://ftp.debian.org/debian jessie-backports main')
apt.install('python-certbot-apache', target_release='jessie-backports') apt.install('python-certbot-apache', target_release='jessie-backports')
# previous / unsupported..? # other..? will have to investigate when this comes up
else: else:
abort("don't know how to install certbot on debian version {}".format(version)) abort("don't know how to install certbot on debian version {}".format(version))

View file

@ -164,7 +164,7 @@ class Deployer(object):
if not exists(final_path): if not exists(final_path):
mkdir(paths, mode='0700') mkdir(paths, mode='0700')
with cd(final_path): with cd(final_path):
self.deploy('{}/private_key.json'.format(localdir), 'private_key.json') self.deploy('{}/private_key.json'.format(localdir), 'private_key.json', mode='0600')
self.deploy('{}/meta.json'.format(localdir), 'meta.json') self.deploy('{}/meta.json'.format(localdir), 'meta.json')
self.deploy('{}/regr.json'.format(localdir), 'regr.json') self.deploy('{}/regr.json'.format(localdir), 'regr.json')