Browse Source

Salt PKI fixes

tags/0.4
Ales Komarek 8 years ago
parent
commit
ffbaaed24d
7 changed files with 30 additions and 5 deletions
  1. +4
    -0
      salt/files/_acl.conf
  2. +6
    -0
      salt/files/_peer.conf
  3. +0
    -0
      salt/files/_pki.conf
  4. +15
    -1
      salt/master/service.sls
  5. +2
    -2
      salt/minion/ca.sls
  6. +1
    -1
      salt/minion/cert.sls
  7. +2
    -1
      tests/pillar/minion_pki_cert.sls

+ 4
- 0
salt/files/_acl.conf View File


peer:
.*:
- x509.sign_remote_certificate

+ 6
- 0
salt/files/_peer.conf View File

{% from "salt/map.jinja" import master with context %}

peer:
{%- for peer_name,peer_rules in master.peer.items() %}
{{ peer_name }}: {{ peer_rules }}
{%- endfor %}

salt/files/_signing_policies.conf → salt/files/_pki.conf View File


+ 15
- 1
salt/master/service.sls View File

- 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 %}

+ 2
- 2
salt/minion/ca.sls View File

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

+ 1
- 1
salt/minion/cert.sls View File



/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 }}

+ 2
- 1
tests/pillar/minion_pki_cert.sls View File

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

Loading…
Cancel
Save