Merge and deploy letsencrypt certs with salt

Easy way merge two files on the fly. Storage can be any from list of salt supported.

{%- if global_config['domains'] is defined %}
{%- for domain in global_config['domains'] %}

/etc/haproxy/crt/{{ domain }}.pem:
  file.managed:
    - contents: |
        {{ salt['cp.get_file_str']('salt://letsencrypt/live/' + domain + '/fullchain.pem') | indent(8) }}
        {{ salt['cp.get_file_str']('salt://letsencrypt/live/' + domain + '/privkey.pem') | indent(8) }}

{%- endfor %}
{%- endif %}

Comments

Popular posts from this blog