mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-20 16:03:06 +01:00
restart docker if ca changes. cleanup dirs at key/crt location
This commit is contained in:
@@ -18,8 +18,9 @@ trusttheca:
|
|||||||
file.managed:
|
file.managed:
|
||||||
- name: /etc/pki/tls/certs/intca.crt
|
- name: /etc/pki/tls/certs/intca.crt
|
||||||
- source: salt://ca/files/ca.crt
|
- source: salt://ca/files/ca.crt
|
||||||
- listen_in:
|
- watch_in:
|
||||||
- service: docker_running
|
- service: docker_running
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
{% if GLOBALS.os_family == 'Debian' %}
|
{% if GLOBALS.os_family == 'Debian' %}
|
||||||
symlinkca:
|
symlinkca:
|
||||||
|
|||||||
@@ -8,19 +8,38 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'ca/map.jinja' import CA %}
|
{% from 'ca/map.jinja' import CA %}
|
||||||
|
|
||||||
|
include:
|
||||||
|
- ca
|
||||||
|
|
||||||
|
# Delete directory if it exists at the key path
|
||||||
|
registry_key_cleanup:
|
||||||
|
file.absent:
|
||||||
|
- name: /etc/pki/registry.key
|
||||||
|
- onlyif:
|
||||||
|
- test -d /etc/pki/registry.key
|
||||||
|
|
||||||
registry_key:
|
registry_key:
|
||||||
x509.private_key_managed:
|
x509.private_key_managed:
|
||||||
- name: /etc/pki/registry.key
|
- name: /etc/pki/registry.key
|
||||||
- keysize: 4096
|
- keysize: 4096
|
||||||
- backup: True
|
- backup: True
|
||||||
- new: True
|
- new: True
|
||||||
|
- require:
|
||||||
|
- file: registry_key_cleanup
|
||||||
{% if salt['file.file_exists']('/etc/pki/registry.key') -%}
|
{% if salt['file.file_exists']('/etc/pki/registry.key') -%}
|
||||||
- prereq:
|
- prereq:
|
||||||
- x509: /etc/pki/registry.crt
|
- x509: /etc/pki/registry.crt
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 15
|
||||||
interval: 30
|
interval: 10
|
||||||
|
|
||||||
|
# Delete directory if it exists at the crt path
|
||||||
|
registry_crt_cleanup:
|
||||||
|
file.absent:
|
||||||
|
- name: /etc/pki/registry.crt
|
||||||
|
- onlyif:
|
||||||
|
- test -d /etc/pki/registry.crt
|
||||||
|
|
||||||
# Create a cert for the docker registry
|
# Create a cert for the docker registry
|
||||||
registry_crt:
|
registry_crt:
|
||||||
@@ -34,10 +53,13 @@ registry_crt:
|
|||||||
- days_remaining: 7
|
- days_remaining: 7
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- backup: True
|
- backup: True
|
||||||
|
- require:
|
||||||
|
- file: registry_crt_cleanup
|
||||||
- timeout: 30
|
- timeout: 30
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 15
|
||||||
interval: 30
|
interval: 10
|
||||||
|
|
||||||
|
|
||||||
regkeyperms:
|
regkeyperms:
|
||||||
file.managed:
|
file.managed:
|
||||||
|
|||||||
Reference in New Issue
Block a user