Skip to content

Commit

Permalink
Fix paths for multiple certs
Browse files Browse the repository at this point in the history
  • Loading branch information
vakwetu committed May 9, 2024
1 parent c0c790d commit aadaa6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions roles/edpm_install_certs/tasks/copy_certs_and_keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
block:
- name: Set paths
ansible.builtin.set_fact:
cert_src_path: "/var/lib/openstack/certs/{{ service }}"
cacert_dest_path: "/var/lib/openstack/certs/{{ service }}"
cert_dest_path: "/var/lib/openstack/certs/{{ service }}"
key_dest_path: "/var/lib/openstack/certs/{{ service }}"
cert_src_path: "{{ service_cert_path }}"
cacert_dest_path: "{{ service_cert_path }}"
cert_dest_path: "{{ service_cert_path }}"
key_dest_path: "{{ service_cert_path }}"

- name: Ensure that the destination directories exist
ansible.builtin.file:
Expand Down
9 changes: 5 additions & 4 deletions roles/edpm_install_certs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
- name: Find certs and keys
ansible.builtin.find:
paths: /var/lib/openstack/certs
recurse: false
depth: 3
recurse: true
file_type: directory
register: found_certs_services
register: found_cert_paths
delegate_to: localhost

- name: Copy certs and keys to the correct location
ansible.builtin.include_tasks: copy_certs_and_keys.yaml
loop:
"{{ found_certs_services['files'] | map(attribute='path') | map('basename') | list }}"
"{{ found_cert_paths['files'] | selectattr('path', 'match', '/var/lib/openstack/certs/.+/.+') | map(attribute='path') |list }}"
loop_control:
loop_var: service
loop_var: service_cert_path

- name: Find cacerts
ansible.builtin.find:
Expand Down

0 comments on commit aadaa6a

Please sign in to comment.