-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare.yml
41 lines (37 loc) · 1.29 KB
/
prepare.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
---
- name: Prepare
hosts: all
gather_facts: true
tasks:
- name: Clone git component
when: item.git is defined
ansible.builtin.git:
repo: "{{ item.git }}"
dest: /rsc/plugins/{{ item.name }}/
version: "{{ item.version | default(omit) }}"
with_items: "{{ lookup('env', 'components') }}"
tags: skip_ansible_lint # linter complains about idempotence of git module
- name: Copy local component
when: item.git is not defined
ansible.posix.synchronize:
src: "{{ item.dir | default(lookup('env', 'PLAYBOOK_DIR')) }}/"
dest: /rsc/plugins/{{ item.name }}/
archive: false
links: true
recursive: true
rsync_opts:
- --exclude=".*"
ssh_connection_multiplexing: true
with_items: "{{ lookup('env', 'components') }}"
- name: Install dependencies
ansible.builtin.apt:
pkg:
- dirmngr
update_cache: true
when: ansible_pkg_mgr == 'apt'
- name: Set extra_preparations var
ansible.builtin.set_fact:
extra_preparations: "{{ lookup('env', 'extra_prepare_tasks' | default(omit)) }}"
- name: Execute optional extra preparations
ansible.builtin.include_tasks: "{{ extra_preparations }}"
when: extra_preparations != ""