-
Notifications
You must be signed in to change notification settings - Fork 8
/
create_acme.yml
48 lines (39 loc) · 1.44 KB
/
create_acme.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
36
37
38
39
40
41
42
43
44
45
46
47
48
---
# This playbook creates a cert-manager ACME Issuer for a namespace.
#
# It assumes that cert-manager is already installed on the K8S cluster.
# See the official documentation on how to install it :
# https://cert-manager.io/docs/installation/kubernetes/
- name: Create SSL certificates
hosts: local
gather_facts: false
pre_tasks:
- name: Check configuration
ansible.builtin.import_tasks: tasks/check_configuration.yml
tasks:
- name: Display playbook name
ansible.builtin.debug: msg="==== Starting create_acme playbook ===="
tags: deploy
- name: Set vars
ansible.builtin.import_tasks: tasks/set_vars.yml
- name: Lookup available core applications
ansible.builtin.set_fact:
core_apps: "{{ lookup('apps', core_apps_paths) }}"
- name: Print core_apps
ansible.builtin.debug:
var: core_apps
verbosity: 2
- name: Set acme_templates
ansible.builtin.set_fact:
acme_templates: '{{ core_apps | json_query("[?name==`acme`].services[0].templates[]") | list }}' # noqa jinja[invalid]
- name: Print acme_templates
ansible.builtin.debug:
var: acme_templates
verbosity: 2
- name: Create K8s entities
kubernetes.core.k8s:
namespace: "{{ namespace_name }}"
definition: "{{ lookup('template', item) | from_yaml_all }}"
with_items:
- "{{ acme_templates }}"
when: env_type not in ('development', 'ci')