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.
 
 
 
 

48 lines
1.2 KiB

---
{% set ssl_dir = salt.file.dirname(
salt.pillar.get("docker:config:tlscacert") or
salt.pillar.get("docker:config:tlscert") or
salt.pillar.get("docker:config:tlskey")
) %}
{% set cert_file = salt.pillar.get("docker:config:tlscert") %}
{% set ca_file = salt.pillar.get("docker:config:tlscacert") %}
{% set key_file = salt.pillar.get("docker:config:tlskey") %}
{% set cert_data = salt.pillar.get("docker:tls:cert") %}
{% set ca_data = salt.pillar.get("docker:tls:ca") %}
{% set key_data = salt.pillar.get("docker:tls:key") %}
{{ ssl_dir }}:
file.directory:
- user: root
- group: docker
- dir_mode: 0750
- file_mode: 0660
{{ cert_file }}:
file.managed:
- user: root
- group: docker
- mode: 0660
- onlyif: "test -f {{ cert_file }}"
{% if cert_data %} - contents_pillar: "docker:tls:cert"
{% endif %}
{{ key_file }}:
file.managed:
- user: root
- group: docker
- mode: 0660
- onlyif: "test -f {{ key_file }}"
{% if key_data %} - content_pillar: "docker:tls:key"
{% endif %}
{{ ca_file }}:
file.managed:
- user: root
- group: docker
- mode: 0660
- onlyif: "test -f {{ ca_file }}"
{% if ca_data %} - content_pillar: "docker:tls:ca"
{% endif %}