26 lines
1.1 KiB
YAML
26 lines
1.1 KiB
YAML
---
|
|
|
|
- name: Copy repo scripts to local bin (for remote hosts)
|
|
ansible.builtin.copy:
|
|
src: "{{ item }}"
|
|
dest: "{{ local_bin_dir | default(ansible_facts['env']['HOME'] ~ '/.local/bin') }}/{{ item | basename }}"
|
|
mode: "0755"
|
|
owner: "{{ local_bin_owner | default(ansible_facts['user_id']) }}"
|
|
group: "{{ local_bin_group | default(ansible_facts['user_gid']) }}"
|
|
with_fileglob:
|
|
- "{{ scripts_src_glob | default(playbook_dir + '/scripts/*') }}"
|
|
when: ansible_connection not in ['local', 'localhost'] and item is file
|
|
|
|
- name: Symlink repo scripts into local bin (stow-like, for local hosts)
|
|
ansible.builtin.file:
|
|
src: "{{ item }}"
|
|
dest: "{{ local_bin_dir | default(ansible_facts['env']['HOME'] ~ '/.local/bin') }}/{{ item | basename }}"
|
|
state: link
|
|
force: true
|
|
owner: "{{ local_bin_owner | default(ansible_facts['user_id']) }}"
|
|
group: "{{ local_bin_group | default(ansible_facts['user_gid']) }}"
|
|
follow: false
|
|
with_fileglob:
|
|
- "{{ scripts_src_glob | default(playbook_dir + '/scripts/*') }}"
|
|
when: ansible_connection in ['local', 'localhost'] and item is file
|