Install system wide certificates from pillars.
`cert`-state will install the certificates as trust anchors.
@@ -7,3 +7,29 @@ include:
pillar['ssl']['crt_file'],
pillar['ssl']['key_file'],
o = pillar['certificate_information']['subject_properties']['O']) }}
+
+#######################################
+# additional system wide certificates #
+#######################################
+
+# Install additional certificates that were setup in Velum by the user as
+# system-wide certificates
+
+{% set system_certs = salt.caasp_pillar.get('system_certificates', []) %}
+{% for cert in system_certs %}
+ {% set name, cert = cert['name'], cert['cert'] %}
+
+/etc/pki/trust/anchors/{{ name }}.crt:
+ file.managed:
+ - makedirs: True
+ - user: root
+ - group: root
+ - mode: 644
+ - contents: |
+ {{ cert | indent(8) }}
+ cmd.run:
+ - name: update-ca-certificates
+ - onchanges:
+ - file: /etc/pki/trust/anchors/{{ name }}.crt
+
+{% endfor %}
