forked from packit/deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
render_secrets_from_templates.yml
45 lines (39 loc) · 1.45 KB
/
render_secrets_from_templates.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
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
# Mimic what we do during deployment when we render secret files
# from their templates before we create k8s secrets from them.
---
- name: Process templates with data from extra-vars.yml
hosts: all
vars:
service: "{{ lookup('env', 'SERVICE') | default('packit', True) }}"
deployment: "{{ lookup('env', 'DEPLOYMENT') }}"
tenant: packit # MP+ tenant
tasks:
- name: Include tasks/project-dir.yml
ansible.builtin.include_tasks: tasks/project-dir.yml
tags:
- always
- name: Include variables
ansible.builtin.include_vars: "{{ project_dir }}/vars/{{ service }}/{{ deployment }}.yml"
tags:
- always
- name: Include tasks/set-facts.yml
ansible.builtin.include_tasks: tasks/set-facts.yml
tags:
- rendering-templates
- name: Include extra secret vars
ansible.builtin.include_vars:
file: "{{ path_to_secrets }}/extra-vars.yml"
name: vault
- name: Process packit-service.yaml.j2 template
ansible.builtin.template:
src: "{{ path_to_secrets }}/packit-service.yaml.j2"
dest: "{{ path_to_secrets }}/packit-service.yaml"
mode: "0644"
- name: Process fedora.toml.j2 template
ansible.builtin.template:
src: "{{ path_to_secrets }}/fedora.toml.j2"
dest: "{{ path_to_secrets }}/fedora.toml"
mode: "0644"
when: service != 'stream'