Ansible: Symlink dotfile tasks
Add a new tasks file for symlinking a directory. Doing it this way instead of stat'ing the file and forking based on its type in symlink_dotfile.yml is more efficient, I think? Clean up file permissions: remove other permissions. Add a variable to toggle skipping symlink errors.
This commit is contained in:
parent
d022b579d2
commit
0839618327
2 changed files with 12 additions and 2 deletions
|
@ -2,7 +2,8 @@
|
|||
- name: "Symlink {{ dotfile_src }}"
|
||||
ansible.builtin.file:
|
||||
src: "{{ ansible_local.dotfiles.path }}/{{ dotfile_src }}"
|
||||
dest: "~/.{{ dotfile_dest | default(dotfile_src) }}"
|
||||
dest: "{{ dotfile_dest | default('~/.' + dotfile_src) }}"
|
||||
owner: "{{ ansible_user_id }}"
|
||||
mode: 0644
|
||||
mode: 0640
|
||||
state: link
|
||||
ignore_errors: "{{ eryn_dotfiles_ignore_symlink_errors | default(false) }}"
|
||||
|
|
9
Ansible/roles/eryn/tasks/symlink_dotfile_directory.yml
Normal file
9
Ansible/roles/eryn/tasks/symlink_dotfile_directory.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- name: "Symlink {{ dotfile_src }}"
|
||||
ansible.builtin.file:
|
||||
src: "{{ ansible_local.dotfiles.path }}/{{ dotfile_src }}"
|
||||
dest: "{{ dotfile_dest | default('~/.' + dotfile_src) }}"
|
||||
owner: "{{ ansible_user_id }}"
|
||||
mode: 0750
|
||||
state: link
|
||||
ignore_errors: "{{ eryn_dotfiles_ignore_symlink_errors | default(false) }}"
|
Loading…
Add table
Add a link
Reference in a new issue