---
# File: tasks/tls.yml - TLS tasks for Vault

- name: Vault SSL Certificate and Key
  copy:
    src:    "{{ item.src }}"
    dest:   "{{ item.dest }}"
    owner:  "{{ vault_user }}"
    group:  "{{ vault_group }}"
    mode:   "{{ item.mode }}"
  with_items:
    - src:  "{{ vault_tls_cert_file }}"
      dest: "{{ vault_tls_cert_file_dest }}"
      mode: "0644"
    - src:  "{{ vault_tls_key_file }}"
      dest: "{{ vault_tls_key_file_dest }}"
      mode: "0600"

---
# File: tasks/tls.yml - TLS tasks for Vault

- name: Create tls directory
  file:
    dest: "{{ item }}"
    state: directory
    owner: "{{ vault_user }}"
    group: "{{ vault_group}}"
  with_items:
    - "{{ vault_tls_config_path }}"

- name: Vault SSL Certificate and Key
  copy:
    src:    "{{ item.src }}"
    dest:   "{{ item.dest }}"
    owner:  "{{ vault_user }}"
    group:  "{{ vault_group }}"
    mode:   "{{ item.mode }}"
  with_items:
    - src:  "{{ vault_tls_cert_file }}"
      dest: "{{ vault_tls_cert_file_dest }}"
      mode: "0644"
    - src:  "{{ vault_tls_key_file }}"
      dest: "{{ vault_tls_key_file_dest }}"
      mode: "0600"

Add TLS directory if TLS is enabled
[fix] Add TLS directory if TLS is enabled