-
Notifications
You must be signed in to change notification settings - Fork 4
/
services.yml
42 lines (37 loc) · 1.16 KB
/
services.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
---
- hosts: k3s_controllers[0]
gather_facts: false
roles:
- role: service_configurations
tags:
- configs
tasks:
- name: deploy services
block:
- name: list of build files
ansible.builtin.find:
paths: "{{ de_releases_dir}}/builds"
patterns: "*.json"
file_type: file
register: build_json_files
- name: list of project names
ansible.builtin.set_fact:
project_names: "{{ project_names|default([]) + [item.path|basename|splitext|first] }}"
loop: "{{ build_json_files.files }}"
- name: filter project names
ansible.builtin.set_fact:
project_names: "{{ project_names | intersect(projects)}}"
when: projects is defined
- ansible.builtin.debug:
msg: "{{ projects }}"
when: projects is defined
- ansible.builtin.debug:
msg: "{{ project_names }}"
- ansible.builtin.include_role:
name: services
vars:
project_name: "{{ item }}"
loop: "{{ project_names }}"
delegate_to: localhost
tags:
- deploy