mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
improved context system
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Copy config {{ context }}
|
||||
- name: Setup directories
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
@@ -7,25 +7,12 @@
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files/{{ context }}
|
||||
- ../files/
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: "Copy templates : {{ context }}"
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../templates/{{ context }}
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: Copy config {{ context }}
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
@@ -33,7 +20,7 @@
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files/{{ context }}
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
Reference in New Issue
Block a user