try to create pkcs12 keystore

This commit is contained in:
Robert Kaussow 2018-07-12 23:02:27 +02:00
parent 4a738a9ceb
commit ba9655c7be
3 changed files with 29 additions and 0 deletions

View File

@ -41,3 +41,8 @@ unifi_open_ports:
rules: |
-A INPUT -m state --state NEW -p tcp --dport 6789 -j ACCEPT
state: present
unifi_tls_pkcs12_path: /tmp/unifi.p12
unifi_tls_cert_path: /etc/pki/tls/certs/cert.pem
unifi_tls_key_path: /etc/pki/tls/private/key.pem
unifi_tls_lookup_user: "{{ remote_user }}"

12
tasks/certificates.yml Normal file
View File

@ -0,0 +1,12 @@
---
- block:
- name: Setup temp. openssl pkcs12 keystore
openssl_pkcs12:
path: "{{ unifi_tls_pkcs12_path }}"
friendly_name: ubnt
privatekey_path: "{{ unifi_tls_key_path }}"
cert_path: "{{ unifi_tls_cert_path }}"
state: present
delegate_to: localhost
become: True
become_user: "{{ unifi_tls_lookup_user }}"

View File

@ -39,11 +39,23 @@
path: "{{ unifi_base_dir }}/{{ unifi_version }}//UniFi/data"
state: absent
- name: Stop service while restore process
systemd:
state: stopped
enabled: yes
name: unifi
- name: Copy data folder from previews version
synchronize:
src: "{{ unifi_base_dir }}/{{ unifi_current_version }}/UniFi/data"
dest: "{{ unifi_base_dir }}/{{ unifi_version }}/UniFi"
delegate_to: "{{ inventory_hostname }}"
- name: Start service after restore process
systemd:
state: started
enabled: yes
name: unifi
become: True
become_user: "{{ unifi_user }}"
when: