forked from NVIDIA/ais-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_https_cert.yml
35 lines (34 loc) · 974 Bytes
/
generate_https_cert.yml
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
#
# Create a certificate using cert-manager for use of https
# based AIStore deployments
#
---
- name: Generate TLS certificates
hosts: controller
gather_facts: false
vars_files:
- vars/https_config.yml
pre_tasks:
- name: Validate if cluster is defined
fail:
msg: "Variable 'cluster' not found. Add the 'cluster' variable during execution. e.g. ansible-playbook -i hosts.ini generate_https_cert.yml -e cluster=ais"
when: cluster is undefined
vars:
- k8s_namespace: "{{ cluster }}"
roles:
- create_namespace
- generate_https_cert
- name: Fetch CA certificate for client
hosts: controller
gather_facts: false
vars_files:
- vars/https_config.yml
pre_tasks:
- name: Check if cacert_file is defined
set_fact:
skip_play: "{{ cacert_file is not defined }}"
tasks:
- name: Fetch certificate if cacert_file is defined
include_role:
name: fetch_ca_cert
when: not skip_play