Skip to content

Commit

Permalink
fix(defaults): install certbot with no plugins
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The formula was installing the Apache plugin by default
which is not reasonable. Also, as `letsencrypt:pkgs` is a list,
_adding_ another entry in the list was not replacing this default, causing
undesired packages to be installed.

The new default is an empty list of packages, defaulting to `certbot` in
the code.
  • Loading branch information
javierbertoli committed Jun 25, 2021
1 parent 261081a commit 70dafdd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
1 change: 0 additions & 1 deletion docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ If `use_package` is `False` it installs and configures the letsencrypt cli from
** WARNING **
If you set `use_package` to `True`, it will:

* Default to Python3's certbot package (where possible), with Apache as the default Webserver to manage.
* Delete all certbot's crons if they exist from a previous git-based installation (as the package uses a
systemd's timer unit to renew all the certs)
* Delete git-based installation's scripts (usually installed under /usr/local/bin) if they still exist declared in
Expand Down
5 changes: 3 additions & 2 deletions letsencrypt/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
---
letsencrypt:
use_package: true
pkgs: []
git_pkg: git
pkgs:
- python3-certbot-apache
service: certbot.timer
# Only used for the pkg install method (use_package: true), internal var
_cli_path: /usr/bin/certbot
# Only used for the pkg install method (use_package: true), internal var
_default_pkg: certbot
# Only used for the git install method (use_package: false)
cli_install_dir: /opt/letsencrypt
# Only used for the git install method (use_package: false). If you want to
Expand Down
3 changes: 2 additions & 1 deletion letsencrypt/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ letsencrypt_external_repo:
letsencrypt-client:
{%- if letsencrypt.use_package %}
{%- set pkgs = letsencrypt.pkgs or [letsencrypt._default_pkg] %}
pkg.installed:
- pkgs: {{ letsencrypt.pkgs | json }}
- pkgs: {{ pkgs | json }}
{%- else %}
pkg.installed:
- name: {{ letsencrypt.git_pkg }}
Expand Down
9 changes: 1 addition & 8 deletions letsencrypt/osfingermap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,4 @@
# you will need to provide at least an empty dict in this file, e.g.
# osfingermap: {}
---
# os: CentOS
CentOS Linux-7:
pkgs:
- python2-certbot-apache
# os: OEL
Oracle Linux Server-7:
pkgs:
- python2-certbot-apache
osfingermap: {}
5 changes: 1 addition & 4 deletions letsencrypt/osmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@
# you will need to provide at least an empty dict in this file, e.g.
# osmap: {}
---
# os_family: RedHat
Amazon:
pkgs:
- python2-certbot-apache
osmap: {}
6 changes: 5 additions & 1 deletion pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ letsencrypt:
# A list of package/s to install. To find the correct name for the variant
# you want to use, check https://certbot.eff.org/all-instructions
# Usually, you'll need a single one, but you can also add other plugins here.
# It defaults to installing the `certbot` package, but you can add other
# plugins for authentication/install
pkgs:
- python-certbot-apache
- python3-certbot-apache
# - python3-certbot-nginx
# - python3-dns-route53
# Only used for the git install method (use_package: false)
cli_install_dir: /opt/letsencrypt
# Only used for the git install method (use_package: false). If you want to
Expand Down

0 comments on commit 70dafdd

Please sign in to comment.