You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

45 lines
1.2 KiB

---
{% set config_dir = pillar.get("letsencrypt:config_dir:path", "/etc/letsencrypt") %}
certbot certificates group:
group.present:
- name: certificates
- system: true
certbot live certificates readable by certificates group:
file.directory:
- name: "{{ config_dir }}/live/"
- group: certificates
- recurse:
- group
- mode
- dir_mode: 0770
- file_mode: 0644
- follow_symlinks: true
certbot archive certificates readable by certificates group:
file.directory:
- name: "{{ config_dir }}/archive/"
- group: certificates
- recurse:
- group
- mode
- dir_mode: 0770
- file_mode: 0644
- follow_symlinks: true
# Unpack letsencrypt:credentials to credential files inside of {{ config_dir }}/config
{% for name, credentials in salt.pillar.get("letsencrypt:credentials", {}).items() -%}
{{ name }} credentials for letsencrypt client:
file.managed:
- name: {{ config_dir }}/config/{{ name }}.ini
- makedirs: true
- mode: 0640
- require_in:
- file: "{{ config_dir }}/cli.ini"
- contents: |
{%- for cred_name, cred_value in credentials.items() %}
{{ cred_name }} = "{{ cred_value }}"
{%- endfor -%}
{%- endfor -%}