Initial commit
This commit is contained in:
25
roles/scripts/tasks/main.yml
Normal file
25
roles/scripts/tasks/main.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
|
||||
- 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
|
||||
Reference in New Issue
Block a user