1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 {%- set orig_cert_dir = salt['pillar.get']('extra_custom_certs_dir', '/srv/salt/certs') %}
6 {%- set dest_cert_dir = '/etc/nginx/ssl' %}
7 {%- set certs = salt['pillar.get']('extra_custom_certs', []) %}
10 extra_custom_certs_file_directory_certs_dir:
12 - name: /etc/nginx/ssl
16 {%- for cert in certs %}
17 {%- set cert_file = 'arvados-' ~ cert ~ '.pem' %}
18 {#- set csr_file = 'arvados-' ~ cert ~ '.csr' #}
19 {%- set key_file = 'arvados-' ~ cert ~ '.key' %}
20 {% for c in [cert_file, key_file] %}
21 extra_custom_certs_file_copy_{{ c }}:
23 - name: {{ dest_cert_dir }}/{{ c }}
24 - source: {{ orig_cert_dir }}/{{ c }}
28 - unless: cmp {{ dest_cert_dir }}/{{ c }} {{ orig_cert_dir }}/{{ c }}
30 - file: extra_custom_certs_file_directory_certs_dir