Commit d10b7d30 authored by Mattia Rizzolo's avatar Mattia Rizzolo

ssl: saner common setup

* give a home to ssl-keys users
* set the home in a variable (default /etc/ssl)
* use the ssl-cert group (already existing in all debians)
* get rid of that cron.sh script
* put the certs in {{ ssl_home }}/localcerts
Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent d3a36a00
--- ---
letsencrypt_email: false letsencrypt_email: false
ssl_home: /etc/ssl
...@@ -3,65 +3,41 @@ ...@@ -3,65 +3,41 @@
- name: Create the ssl-keys user - name: Create the ssl-keys user
user: user:
name: ssl-keys name: ssl-keys
state: present comment: User handling this server SSL keys
createhome: yes
createhome: no home: "{{ ssl_home }}"
groups: ssl-keys-read shell: /bin/false
generate_ssh_key: no
group: ssl-cert
system: yes system: yes
- name: Make sure of ssl_home permissions
- name: Create the /etc/ssl-keys directory
file: file:
path: /etc/ssl-keys path: "{{ ssl_home }}"
state: directory state: directory
mode: 0755
mode: 0550
owner: root owner: root
group: ssl-keys-read group: ssl-cert
- name: Create the ssl_home/hooks directory
- name: Create the /etc/ssl-keys/hooks directory
file: file:
path: /etc/ssl-keys/hooks path: "{{ ssl_home }}/hooks"
state: directory state: directory
mode: 0755
mode: 0550
owner: root owner: root
group: ssl-keys group: ssl-keys
- name: Create the ssl_home/localcerts directory
- name: Create the /etc/ssl-keys/certs directory
file: file:
path: /etc/ssl-keys/certs path: "{{ ssl_home }}/localcerts"
state: directory state: directory
mode: 0740
# This directory has the setgid bit to assign the ssl-read-keys group to
# newly-created files
mode: 02750
owner: ssl-keys owner: ssl-keys
group: ssl-keys-read group: ssl-cert
- name: Ensure the /etc/ssl-keys/domains file exists
command: touch /etc/ssl-keys/domains
args:
creates: /etc/ssl-keys/domains
- name: Ensure the ssl_home/domains file exists
- name: Set permissions on the /etc/ssl-keys/domains file
file: file:
path: /etc/ssl-keys/domains dest: "{{ ssl_home }}/domains"
force: no
mode: 0440
owner: root
group: ssl-keys
- name: Upload the cron.sh script
template:
src: cron.sh
dest: /etc/ssl-keys/cron.sh
mode: 0750
owner: root owner: root
group: ssl-keys group: ssl-cert
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment