diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a8e3b5d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "templates/all/home/hayato/Source/zshrc"] + path = templates/all/home/hayato/Source/zshrc + url = https://github.com/cradle8810/zshrc diff --git a/tasks/all/main.yml b/tasks/all/main.yml index edb9608..4f850a4 100644 --- a/tasks/all/main.yml +++ b/tasks/all/main.yml @@ -64,3 +64,5 @@ - name: "Common / Usermod" ansible.builtin.import_tasks: file: tasks/all/usermod.yml + tags: + - users diff --git a/tasks/all/usermod.yml b/tasks/all/usermod.yml index 7ac5c31..930f3d0 100644 --- a/tasks/all/usermod.yml +++ b/tasks/all/usermod.yml @@ -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 diff --git a/templates/all/home/hayato/Source/zshrc b/templates/all/home/hayato/Source/zshrc new file mode 160000 index 0000000..795efb5 --- /dev/null +++ b/templates/all/home/hayato/Source/zshrc @@ -0,0 +1 @@ +Subproject commit 795efb5cd08399497ba2cc0d206809e1e3f4992f