Skip to content
Snippets Groups Projects
Commit 217d6e6e authored by Alexander Käb's avatar Alexander Käb
Browse files

fix: Use correct tmp dir path

parent 81ca36c9
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- name: Node Certificates | Fetch Sidecar CA Cert - name: Node Certificates | Fetch Sidecar CA Cert
ansible.builtin.fetch: ansible.builtin.fetch:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ tmp_cert_dir }}/" dest: "{{ tmp_cert_dir.path }}/"
flat: true flat: true
with_items: with_items:
- "{{ gl_sidecar_ca_path }}/sidecar-ca.pem" - "{{ gl_sidecar_ca_path }}/sidecar-ca.pem"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
- name: Node Certificates | Fetch Graylog Node CA Cert - name: Node Certificates | Fetch Graylog Node CA Cert
ansible.builtin.fetch: ansible.builtin.fetch:
src: "{{ gl_node_ca_path }}/graylog-ca.pem" src: "{{ gl_node_ca_path }}/graylog-ca.pem"
dest: "{{ tmp_cert_dir }}/" dest: "{{ tmp_cert_dir.path }}/"
flat: true flat: true
delegate_to: "{{ groups[use_central_ca_host | bool | ternary('ca-store', 'graylog-nodes')] | first }}" delegate_to: "{{ groups[use_central_ca_host | bool | ternary('ca-store', 'graylog-nodes')] | first }}"
become: true become: true
...@@ -33,31 +33,31 @@ ...@@ -33,31 +33,31 @@
block: block:
- name: Node Certificates | Generate private keys - name: Node Certificates | Generate private keys
community.crypto.openssl_privatekey: community.crypto.openssl_privatekey:
path: "{{ tmp_cert_dir }}/sidecar-{{ inventory_hostname }}.key" path: "{{ tmp_cert_dir.path }}/sidecar-{{ inventory_hostname }}.key"
return_content: true return_content: true
state: present state: present
- name: Node Certificates | Create CSRs - name: Node Certificates | Create CSRs
community.crypto.openssl_csr_pipe: community.crypto.openssl_csr_pipe:
privatekey_path: "{{ tmp_cert_dir }}/sidecar-{{ inventory_hostname }}.key" privatekey_path: "{{ tmp_cert_dir.path }}/sidecar-{{ inventory_hostname }}.key"
common_name: "{{ ansible_fqdn }}" # CN common_name: "{{ ansible_fqdn }}" # CN
subject_alt_name: "{{ node_cert_sans }}" subject_alt_name: "{{ node_cert_sans }}"
register: "node_csr" register: "node_csr"
- name: Node Certificates | Generate Certificates - name: Node Certificates | Generate Certificates
community.crypto.x509_certificate: community.crypto.x509_certificate:
path: "{{ tmp_cert_dir }}/sidecar-{{ inventory_hostname }}.pem" path: "{{ tmp_cert_dir.path }}/sidecar-{{ inventory_hostname }}.pem"
csr_content: "{{ node_csr.csr }}" csr_content: "{{ node_csr.csr }}"
provider: ownca provider: ownca
ownca_path: "{{ tmp_cert_dir }}/sidecar-ca.pem" ownca_path: "{{ tmp_cert_dir.path }}/sidecar-ca.pem"
ownca_privatekey_path: "{{ tmp_cert_dir }}/sidecar-ca.key" ownca_privatekey_path: "{{ tmp_cert_dir.path }}/sidecar-ca.key"
ownca_privatekey_passphrase: "{{ sidecar_ca_passphrase }}" ownca_privatekey_passphrase: "{{ sidecar_ca_passphrase }}"
ownca_not_after: "+{{ cert_valid_days }}d" ownca_not_after: "+{{ cert_valid_days }}d"
ownca_not_before: "-1d" # valid since yesterday ownca_not_before: "-1d" # valid since yesterday
- name: Node Certificates | Copy Node certificates - name: Node Certificates | Copy Node certificates
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ tmp_cert_dir }}/{{ item.file }}" src: "{{ tmp_cert_dir.path }}/{{ item.file }}"
dest: "{{ sidecar_cert_dir }}" dest: "{{ sidecar_cert_dir }}"
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
with_items: with_items:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment