summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/keys.yml
blob: 2096c75d24e62d627a37ebee4eaed829787e9332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- name: Try to locate pubkey file
  set_fact: "kaas_{{ pod.key }}_pubkey={{ lookup('file', item) }}"
  with_first_found:
    - paths:
        - "{{ kaas_project_path }}/keys/"
      files:
        -  "{{ pod.key }}.crt"
        -  "{{ pod.key }}.pub"
        -  "{{ pod.value.service.host | default('default') }}.crt"
        -  "{{ pod.value.service.host | default('default') }}.pub"
      skip: true

- name: Try to locate privkey file
  set_fact: "kaas_{{ pod.key }}_privkey={{ lookup('file', item) }}"
  with_first_found:
    - paths:
        - "{{ kaas_project_path }}/keys/"
      files:
        - "{{ pod.key }}.key"
        - "{{ pod.key }}.pem"
        - "{{ pod.value.service.host | default('default') }}.key"
        - "{{ pod.value.service.host | default('default') }}.pem"
      skip: true

- name: Try to locate CA file
  set_fact: "kaas_{{ pod.key }}_ca={{ lookup('file', item) }}"
  with_first_found:
    - paths:
        - "{{ kaas_project_path }}/keys/"
      files:
        - "{{ pod.key }}.ca"
        - "{{ pod.value.service.host | default('default') }}.ca"
        - ca-bundle.pem
        - ca.pem
        - ca.crt
      skip: true