adding oh-my-zsh for root user

This commit is contained in:
2021-03-07 23:08:35 +00:00
parent 63457caed5
commit 3c0e08ac91
4 changed files with 166 additions and 6 deletions

View File

@@ -88,3 +88,71 @@
group: "{{ default_user_group }}"
force: yes
mode: 0644
- name: Configure shell for root user
tags: shell
become: true
block:
- name: Get root home
user:
name: root
state: present
shell: /bin/zsh
register: root_user_details
- name: Set root home
set_fact:
root_user_home: "{{ root_user_details.home }}"
- name: Print root user home
debug:
var: root_user_home
- name: Install .tmux.conf to root user
copy:
src: .tmux.conf
dest: "{{ root_user_home }}/.tmux.conf"
force: yes
mode: 0644
- name: Create temporary root install directory
tempfile:
path: "{{ root_user_home }}"
state: directory
suffix: .tmp
register: temp_install_dir_root
changed_when: false
- name: Download oh-my-zsh
get_url:
url: https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh
dest: "{{ temp_install_dir_root.path }}"
mode: 0777
- name: Install oh-my-zsh
shell: "sh {{ temp_install_dir_root.path }}/install.sh --unattended"
args:
creates: "{{ root_user_home }}/.oh-my-zsh"
- name: Install zsh-syntax-highlighting
git:
repo: "https://github.com/zsh-users/zsh-syntax-highlighting.git"
version: master
dest: "{{ root_user_home }}/.zsh/zsh-syntax-highlighting"
clone: yes
update: yes
- name: Install zsh-autosuggestions
git:
repo: https://github.com/zsh-users/zsh-autosuggestions
version: master
dest: "{{ root_user_home }}/.zsh/zsh-autosuggestions"
clone: yes
update: yes
- name: Install .zshrc to root user
template:
src: .zshrc.root.j2
dest: "{{ root_user_home }}/.zshrc"
force: yes
mode: 0644