xoxys.pve/tasks/tls.yml

33 lines
1.1 KiB
YAML
Raw Normal View History

2018-08-18 14:37:48 +00:00
---
- block:
2019-01-09 21:54:28 +00:00
- name: Create pki folder structure
file:
path: "{{ item }}"
state: directory
recurse: True
2019-08-28 08:36:26 +00:00
loop:
2019-01-09 21:54:28 +00:00
- /etc/pki/tls/certs
- /etc/pki/tls/private
2018-08-18 14:37:48 +00:00
2019-02-04 19:32:36 +00:00
- name: Copy certs and private key
2019-01-09 21:54:28 +00:00
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
2019-02-04 19:32:36 +00:00
loop:
2019-01-09 21:54:28 +00:00
- { 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 }}"
2019-02-04 19:32:36 +00:00
register: __pve_tls_copy
2018-08-18 14:37:48 +00:00
2019-01-09 21:54:28 +00:00
- name: Copy cert/key to pve filesystem
command: "/bin/cp -rf {{ item[0].dest }} /etc/pve/nodes/{{ item[1] }}/{{ item[0].dest | basename }}"
changed_when: item[0].changed
2019-08-28 08:36:26 +00:00
loop: "{{ __pve_tls_copy.results | product(pve_nodes) | list }}"
2019-01-09 21:54:28 +00:00
loop_control:
label: "/etc/pve/nodes/{{ item[1] }}/{{ item[0].dest | basename }}"
notify: __pveproxy_restart
2018-08-18 14:37:48 +00:00
become: True
become_user: root