SHA256
1
0

Refactor to reduce config in group_vars

This commit is contained in:
2026-01-29 23:34:14 -05:00
parent 1b0c289b9b
commit 6d38e1dc5c
76 changed files with 1900 additions and 2119 deletions

View File

@@ -1,10 +1,30 @@
---
- name: Glob all files in role directory
ansible.builtin.find:
paths: "{{ role_path }}"
depth: 1
file_type: file
register: scripts_files
- name: Deploy scripts to user's local bin
ansible.builtin.include_tasks: ../../deploy_files.yml
vars:
var_prefix: scripts
subdir: ''
target_root: "{{ ansible_facts.env.HOME }}/.local/bin"
use_symlinks: true
become_root: false
- name: "Ensure script directory exist"
ansible.builtin.file:
path: "{{ ansible_facts.env.HOME }}/.local/bin"
state: directory
mode: "0755"
- name: "Deploy scripts (local with symlinks)"
ansible.builtin.file:
src: "{{ item.path }}"
dest: "{{ ansible_facts.env.HOME }}/.local/bin/{{ item.path | basename }}"
state: link
force: true
loop: "{{ scripts_files.files }}"
when: ansible_connection in ['local', 'localhost']
- name: "Deploy scripts (remote with copy)"
ansible.builtin.copy:
src: "{{ item.path }}"
dest: "{{ ansible_facts.env.HOME }}/.local/bin/{{ item.path | basename }}"
mode: '0755'
loop: "{{ scripts_files.files }}"
when: ansible_connection not in ['local', 'localhost']