From 25196c8410d871ae233c16201ff315f3422bfd0b Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Wed, 23 Oct 2019 23:16:08 +0100 Subject: [PATCH] fix(repo): provide EPEL repo configuration for `amazon-2` --- letsencrypt/install.sls | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/letsencrypt/install.sls b/letsencrypt/install.sls index 0347285..007ca7f 100644 --- a/letsencrypt/install.sls +++ b/letsencrypt/install.sls @@ -1,23 +1,41 @@ # -*- coding: utf-8 -*- # vim: ft=sls -{% from "letsencrypt/map.jinja" import letsencrypt with context %} +{%- from "letsencrypt/map.jinja" import letsencrypt with context %} + +{#- Use empty default for `grains.osfinger`, which isn't available in all distros #} +{%- if letsencrypt.use_package and + grains.osfinger|d('') == 'Amazon Linux-2' %} +{%- set rhel_ver = '7' %} +letsencrypt_external_repo: + pkgrepo.managed: + - name: epel + - humanname: Extra Packages for Enterprise Linux {{ rhel_ver }} - $basearch + - mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-{{ rhel_ver }}&arch=$basearch + - enabled: 1 + - gpgcheck: 1 + - gpgkey: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ rhel_ver }} + - failovermethod: priority + - require_in: + - pkg: letsencrypt-client +{%- endif %} letsencrypt-client: - {% if letsencrypt.use_package %} + {%- if letsencrypt.use_package %} pkg.installed: - pkgs: {{ letsencrypt.pkgs | json }} - {% else %} + {%- else %} pkg.installed: - name: git - {% if letsencrypt.version is defined and letsencrypt.version|length %} + {%- if letsencrypt.version is defined and letsencrypt.version|length %} + # Note: `git.cloned` is unavailable in `2017.7` git.cloned: - name: https://github.com/certbot/certbot - branch: {{ letsencrypt.version }} - target: {{ letsencrypt.cli_install_dir }} - {% else %} + {%- else %} git.latest: - name: https://github.com/certbot/certbot - target: {{ letsencrypt.cli_install_dir }} - force_reset: True - {% endif %} - {% endif %} + {%- endif %} + {%- endif %}