set tls path static

This commit is contained in:
Robert Kaussow 2018-08-14 23:04:27 +02:00
parent 0770f128ec
commit 0c9e2ce70a
2 changed files with 4 additions and 15 deletions

View File

@ -48,10 +48,8 @@ nginx_open_ports:
- 443
nginx_tls_enabled: False
nginx_tls_certs_dir: /etc/pki/tls/certs
nginx_tls_key_dir: /etc/pki/tls/private
nginx_tls_cert_file: "{{ nginx_tls_certs_dir }}/mycert.pem"
nginx_tls_key_file: "{{ nginx_tls_key_dir }}/mykey.pem"
nginx_tls_cert_file: "mycert.pem"
nginx_tls_key_file: "mykey.pem"
nginx_tls_source_use_content: False
nginx_tls_source_use_files: True
nginx_tls_cert_source: mycert.pem

View File

@ -1,21 +1,12 @@
- block:
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
mode: 750
with_items:
- "{{ nginx_tls_certs_dir }}"
- "{{ nginx_tls_key_dir }}"
- name: Copy certs and private key (content)
copy:
content: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- { src: "{{ nginx_tls_key_source }}", dest: '{{ nginx_tls_key_file }}', mode: '0600' }
- { src: "{{ nginx_tls_cert_source }}", dest: '{{ nginx_tls_cert_file }}', mode: '0750' }
- { src: "{{ nginx_tls_key_source }}", dest: '/etc/pki/tls/private/{{ nginx_tls_key_file }}', mode: '0600' }
- { src: "{{ nginx_tls_cert_source }}", dest: '/etc/pki/tls/certs/{{ nginx_tls_cert_file }}', mode: '0750' }
loop_control:
label: "{{ item.dest }}"
notify: __nginx_reload