41 lines
1010 B
YAML

---
- name: Set target user variable
set_fact:
target_user: "{{ ansible_user | default(ansible_user_id) }}"
- name: Install shell packages
apt:
name:
- zsh
- tmux
state: present
- name: Set zsh as default shell for user
user:
name: "{{ target_user }}"
shell: /usr/bin/zsh
- name: Install Oh My Zsh for user
become: true
become_user: "{{ target_user }}"
shell: sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" "" --unattended
args:
creates: "/home/{{ target_user }}/.oh-my-zsh"
- name: Clone Powerlevel10k theme
git:
repo: https://github.com/romkatv/powerlevel10k.git
dest: "/home/{{ target_user }}/.oh-my-zsh/custom/themes/powerlevel10k"
depth: 1
update: no
become: true
become_user: "{{ target_user }}"
- name: Deploy .zshrc for user
copy:
src: files/.zshrc
dest: "/home/{{ target_user }}/.zshrc"
owner: "{{ target_user }}"
group: "{{ target_user }}"
mode: '0644'