Skip to content

Commit

Permalink
Make symlink for zshrc
Browse files Browse the repository at this point in the history
  • Loading branch information
cradle8810 committed Nov 3, 2024
1 parent cd5db6f commit 4cc3334
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "templates/all/home/hayato/Source/zshrc"]
path = templates/all/home/hayato/Source/zshrc
url = https://github.com/cradle8810/zshrc
2 changes: 2 additions & 0 deletions tasks/all/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@
- name: "Common / Usermod"
ansible.builtin.import_tasks:
file: tasks/all/usermod.yml
tags:
- users
44 changes: 44 additions & 0 deletions tasks/all/usermod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,47 @@
loop: "{{ all.vars.user }}"
no_log: true
when: ansible_distribution == "MacOSX"

- name: "Common / mkdir zshrc source directory"
ansible.builtin.copy:
src: "templates/all/home/hayato/Source/zshrc/"
dest: "{{ item.homedir }}/Source/zshrc/"
mode: '0644'
owner: "{{ item.username }}"
group: "{{ item.username }}"
loop: "{{ all.vars.user }}"
no_log: true
when: ansible_distribution == "Ubuntu"

- name: "Common / mkdir zshrc source directory"
ansible.builtin.copy:
src: "templates/all/home/hayato/Source/zshrc/"
dest: "{{ item.homedir_mac }}/Source/zshrc/"
mode: '0644'
owner: "{{ item.username }}"
group: "{{ item.username }}"
loop: "{{ all.vars.user }}"
when: ansible_distribution == "MacOSX"
no_log: true

- name: "Common / Make zshrc symlink to homedir (Ubuntu)"
ansible.builtin.file:
src: "{{ item.homedir }}/Source/zshrc/zshrc"
dest: "{{ item.homedir }}/.zshrc"
owner: "{{ item.username }}"
group: "{{ item.username }}"
state: link
loop: "{{ all.vars.user }}"
when: ansible_distribution == "Ubuntu"
no_log: true

- name: "Common / Make zshrc symlink to homedir (macOS)"
ansible.builtin.file:
src: "{{ item.homedir_mac }}/Source/zshrc/zshrc"
dest: "{{ item.homedir_mac }}/.zshrc"
owner: "{{ item.username }}"
group: "{{ item.username }}"
state: link
loop: "{{ all.vars.user }}"
when: ansible_distribution == "MacOS"
no_log: true
1 change: 1 addition & 0 deletions templates/all/home/hayato/Source/zshrc
Submodule zshrc added at 795efb

0 comments on commit 4cc3334

Please sign in to comment.