xoxys.pve/tasks/tls.yml
Robert Kaussow 91b31d065d
All checks were successful
continuous-integration/drone/push Build is passing
refactor tls tasks
2019-02-04 20:32:36 +01:00

36 lines
1.1 KiB
YAML

---
- block:
- name: Create pki folder structure
file:
path: "{{ item }}"
state: directory
recurse: True
with_items:
- /etc/pki/tls/certs
- /etc/pki/tls/private
- name: Copy certs and private key
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
loop:
- { src: "{{ pve_tls_cert_source }}", dest: "/etc/pki/tls/certs/pveproxy-ssl.pem", mode: "0750" }
- { src: "{{ pve_tls_key_source }}", dest: "/etc/pki/tls/private/pveproxy-ssl.key", mode: "0600" }
loop_control:
label: "{{ item.dest }}"
register: __pve_tls_copy
- name: Copy cert/key to pve filesystem
command: "/bin/cp -rf {{ item[0].dest }} /etc/pve/nodes/{{ item[1] }}/{{ item[0].dest | basename }}"
when: item[0].changed
changed_when: item[0].changed
with_nested:
- "{{ __pve_tls_copy.results }}"
- "{{ pve_nodes }}"
loop_control:
label: "/etc/pve/nodes/{{ item[1] }}/{{ item[0].dest | basename }}"
notify: __pveproxy_restart
become: True
become_user: root