add certs deployment

This commit is contained in:
Robert Kaussow 2018-08-04 22:23:06 +02:00
parent c2a6b9facf
commit ac2dca1a73
4 changed files with 43 additions and 0 deletions

5
defaults/main.yml Normal file
View File

@ -0,0 +1,5 @@
---
ucs_tls_certs_dir: /etc/pki/tls/certs
ucs_tls_key_dir: /etc/pki/tls/private
ucs_tls_cert_path: /etc/pki/tls/certs/mycert.pem
ucs_tls_key_path: /etc/pki/tls/private/mykey.pem

15
meta/main.yml Normal file
View File

@ -0,0 +1,15 @@
---
galaxy_info:
author: xoxys
description: Role to configure a univention corporate server
license: MIT
min_ansible_version: 2.4
platforms:
- name: EL
versions:
- 7
galaxy_tags:
- univention
- ucs
- domain
dependencies:

2
tasks/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
- include_tasks: tls.yml

21
tasks/tls.yml Normal file
View File

@ -0,0 +1,21 @@
---
- block:
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
mode: 700
with_items:
- "{{ ucs_tls_certs_dir }}"
- "{{ ucs_tls_key_dir }}"
- name: Copy certs and private key
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{item.mode }}"
with_items:
- { src: "{{ ucs_tls_key_path }}", dest: "{{ ucs_tls_certs_dir/ucs.pem }}", mode: '0600' }
- { src: "{{ ucs_tls_cert_path }}", dest: "{{ ucs_tls_key_dir/unifi.pem }}", mode: '0750' }
become: True
become_user: root