Skip to content

Commit

Permalink
Fix voxpupuli#16 by specifying VENV_PATH when running letsencrypt.
Browse files Browse the repository at this point in the history
Issue copy-paste from
voxpupuli#16

When you install letsencrypt using the VCS method, it will create a
virtualenv, which would normally be located in
~/.local/share/letsencrypt:

Excerpt from letsencrypt-auto:
```
XDG_DATA_HOME=${XDG_DATA_HOME:-~/.local/share}
VENV_NAME="letsencrypt"
VENV_PATH=${VENV_PATH:-"$XDG_DATA_HOME/$VENV_NAME"}
```
However, puppet exec's will not set $HOME, which will stop Debian's
/bin/sh, dash, from expanding ~, so it creates a literal '~' folder.
  • Loading branch information
mheistermann committed Feb 25, 2016
1 parent 70eb3eb commit 29496d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions manifests/certonly.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@
$live_path = inline_template('/etc/letsencrypt/live/<%= @domains.first %>/cert.pem')

exec { "letsencrypt certonly ${title}":
command => $command,
path => $::path,
creates => $live_path,
require => Class['letsencrypt'],
command => $command,
path => $::path,
environment => ["VENV_PATH=${letsencrypt::venv_path}"],
creates => $live_path,
require => Class['letsencrypt'],
}

if $manage_cron {
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
class letsencrypt (
$email = undef,
$path = $letsencrypt::params::path,
$venv_path = $letsencrypt::params::venv_path,
$repo = $letsencrypt::params::repo,
$version = $letsencrypt::params::version,
$package_ensure = $letsencrypt::params::package_ensure,
Expand Down Expand Up @@ -81,6 +82,7 @@
exec { 'initialize letsencrypt':
command => "${command} -h",
path => $::path,
environment => ["VENV_PATH=${venv_path}"],
refreshonly => true,
}
}
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
$package_ensure = 'installed'
$config_file = '/etc/letsencrypt/cli.ini'
$path = '/opt/letsencrypt'
$venv_path = '/opt/letsencrypt-venv' # virtualevn path for vcs-installed letsencrypt
$repo = 'git://github.com/letsencrypt/letsencrypt.git'
$version = 'v0.4.0'
$config = {
Expand Down

0 comments on commit 29496d3

Please sign in to comment.