peer: | |||||
.*: | |||||
- x509.sign_remote_certificate |
{% from "salt/map.jinja" import master with context %} | |||||
peer: | |||||
{%- for peer_name,peer_rules in master.peer.items() %} | |||||
{{ peer_name }}: {{ peer_rules }} | |||||
{%- endfor %} |
- watch_in: | - watch_in: | ||||
- service: salt_master_service | - service: salt_master_service | ||||
{%- if master.peer is defined %} | |||||
/etc/salt/master.d/_peer.conf: | |||||
file.managed: | |||||
- source: salt://salt/files/_peer.conf | |||||
- user: root | |||||
- template: jinja | |||||
- require: | |||||
- pkg: salt_master_packages | |||||
- watch_in: | |||||
- service: salt_master_service | |||||
{%- endif %} | |||||
salt_master_service: | salt_master_service: | ||||
service.running: | service.running: | ||||
- name: {{ master.service }} | - name: {{ master.service }} | ||||
- mode: 755 | - mode: 755 | ||||
- makedirs: true | - makedirs: true | ||||
{%- endif %} | |||||
{%- endif %} |
include: | include: | ||||
- salt.minion.service | - salt.minion.service | ||||
/etc/salt/minion.d/_signing_policies.conf: | |||||
/etc/salt/minion.d/_pki.conf: | |||||
file.managed: | file.managed: | ||||
- source: salt://salt/files/_signing_policies.conf | |||||
- source: salt://salt/files/_pki.conf | |||||
- template: jinja | - template: jinja | ||||
- require: | - require: | ||||
- pkg: salt_minion_packages | - pkg: salt_minion_packages |
/etc/pki/cert/{{ cert.authority }}/{{ cert.common_name }}.crt: | /etc/pki/cert/{{ cert.authority }}/{{ cert.common_name }}.crt: | ||||
x509.certificate_managed: | x509.certificate_managed: | ||||
- ca_server: wst01.newt.cz | |||||
- ca_server: {{ cert.host }} | |||||
- signing_policy: {{ cert.authority }} | - signing_policy: {{ cert.authority }} | ||||
- public_key: /etc/pki/cert/{{ cert.authority }}/{{ cert.common_name }}.key | - public_key: /etc/pki/cert/{{ cert.authority }}/{{ cert.common_name }}.key | ||||
- CN: {{ cert.common_name }} | - CN: {{ cert.common_name }} |
enabled: true | enabled: true | ||||
cert: | cert: | ||||
test_service: | test_service: | ||||
host: minion.with.ca | |||||
authority: Company CA | authority: Company CA | ||||
common_name: test.service.domain.tld | |||||
common_name: test.service.domain.tld |