-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from cradle8810/345_usermod
Usermod, zsh, zshrcの自動設定
- Loading branch information
Showing
5 changed files
with
108 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
- name: "Common / Install zsh (Ubuntu)" | ||
ansible.builtin.apt: | ||
name: "zsh" | ||
state: present | ||
when: ansible_distribution == "Ubuntu" | ||
|
||
- name: "Common / Setting Users (Ubuntu)" | ||
no_log: true | ||
when: ansible_distribution == "Ubuntu" | ||
block: | ||
- name: "Common / Usermod (Ubuntu)" | ||
ansible.builtin.user: | ||
name: "{{ item.username }}" | ||
shell: "{{ item.shell }}" | ||
state: "present" | ||
system: true | ||
uid: "{{ item.uid }}" | ||
loop: | ||
"{{ all.vars.user }}" | ||
|
||
- name: "Common / Makedir source dir (Ubuntu)" | ||
ansible.builtin.file: | ||
path: "{{ item.homedir }}/Source/zshrc" | ||
state: directory | ||
recurse: true | ||
owner: "{{ item.username }}" | ||
group: "{{ item.username }}" | ||
mode: '0755' | ||
loop: | ||
"{{ all.vars.user }}" | ||
|
||
- name: "Common / copy zshrc source directory (Ubuntu)" | ||
ansible.builtin.copy: | ||
src: "templates/all/home/hayato/Source/zshrc/zshrc" | ||
dest: "{{ item.homedir }}/Source/zshrc/zshrc" | ||
mode: '0644' | ||
owner: "{{ item.username }}" | ||
group: "{{ item.username }}" | ||
loop: | ||
"{{ all.vars.user }}" | ||
|
||
- 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 }}" | ||
|
||
- name: "Common / Setting Users (macOS)" | ||
no_log: true | ||
when: ansible_distribution == "MacOS" | ||
block: | ||
- name: "Common / Usermod (macOS)" | ||
ansible.builtin.user: | ||
name: "{{ item.username }}" | ||
shell: "{{ item.shell_mac }}" | ||
state: "present" | ||
system: true | ||
uid: "{{ item.uid }}" | ||
loop: | ||
"{{ all.vars.user }}" | ||
|
||
- name: "Common / Makedir source dir (Ubuntu)" | ||
ansible.builtin.file: | ||
path: "{{ item.homedir_mac }}/Source/zshrc/" | ||
recurse: true | ||
owner: "{{ item.username }}" | ||
group: "{{ item.username }}" | ||
state: directory | ||
mode: '0755' | ||
loop: | ||
"{{ all.vars.user }}" | ||
|
||
- name: "Common / mkdir zshrc source directory (macOS)" | ||
ansible.builtin.copy: | ||
src: "templates/all/home/hayato/Source/zshrc/zshrc" | ||
dest: "{{ item.homedir_mac }}/Source/zshrc/zshrc" | ||
mode: '0644' | ||
owner: "{{ item.username }}" | ||
group: "{{ item.username }}" | ||
loop: | ||
"{{ all.vars.user }}" | ||
|
||
- 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 }}" |