|
7 | 7 | user: "{{ ansible_user }}"
|
8 | 8 |
|
9 | 9 | tasks:
|
10 |
| - |
11 | 10 | - name: Install necessary packages
|
12 | 11 | apt:
|
13 | 12 | name:
|
|
17 | 16 | state: present
|
18 | 17 | update_cache: yes
|
19 | 18 |
|
20 |
| - - name: Change default shell to Zsh |
21 |
| - user: |
22 |
| - name: "{{ user }}" |
23 |
| - shell: /bin/zsh |
| 19 | + - name: Pre-create basic .zshrc to avoid the zsh-newuser-install prompt |
| 20 | + copy: |
| 21 | + dest: "/home/{{ user }}/.zshrc" |
| 22 | + content: | |
| 23 | + # Basic .zshrc to prevent zsh-newuser-install prompt |
| 24 | + # Path to your Oh My Zsh installation. |
| 25 | + export ZSH="$HOME/.oh-my-zsh" |
| 26 | + export PATH=$PATH:$HOME/.local/bin |
| 27 | +
|
| 28 | + # Set theme |
| 29 | + ZSH_THEME="robbyrussell" |
| 30 | +
|
| 31 | + # Plugins |
| 32 | + plugins=(git ubuntu copypath copyfile dirhistory zsh-interactive-cd docker docker-compose opentofu zsh-history-substring-search zsh-autosuggestions zsh-syntax-highlighting you-should-use) |
| 33 | +
|
| 34 | + source $ZSH/oh-my-zsh.sh |
| 35 | +
|
| 36 | + # Set up Oh My Posh |
| 37 | + eval "$(oh-my-posh init zsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/sonicboom_dark.omp.json)" |
| 38 | +
|
| 39 | + # Custom aliases |
| 40 | + alias dcd="docker compose down" |
| 41 | + alias dcu="docker compose up -d" |
| 42 | +
|
| 43 | + # Display system information |
| 44 | + neofetch |
| 45 | + owner: "{{ user }}" |
| 46 | + mode: '0644' |
24 | 47 |
|
25 | 48 | - name: Install Oh My Zsh (unattended)
|
26 | 49 | shell: |
|
|
72 | 95 | owner: "{{ user }}"
|
73 | 96 | mode: '0755'
|
74 | 97 |
|
75 |
| - - name: Set up custom .zshrc |
76 |
| - copy: |
77 |
| - dest: "/home/{{ user }}/.zshrc" |
78 |
| - content: | |
79 |
| - # Path to your Oh My Zsh installation. |
80 |
| - export ZSH="$HOME/.oh-my-zsh" |
81 |
| - export PATH=$PATH:$HOME/.local/bin |
82 |
| -
|
83 |
| - # Set theme |
84 |
| - ZSH_THEME="robbyrussell" |
85 |
| -
|
86 |
| - # Plugins |
87 |
| - plugins=(git ubuntu copypath copyfile dirhistory zsh-interactive-cd docker docker-compose opentofu zsh-history-substring-search zsh-autosuggestions zsh-syntax-highlighting you-should-use) |
88 |
| -
|
89 |
| - source $ZSH/oh-my-zsh.sh |
90 |
| -
|
91 |
| - # Set up Oh My Posh |
92 |
| - eval "$(oh-my-posh init zsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/sonicboom_dark.omp.json)" |
93 |
| -
|
94 |
| - # Custom aliases |
95 |
| - alias dcd="docker compose down" |
96 |
| - alias dcu="docker compose up -d" |
97 |
| -
|
98 |
| - # Display system information |
99 |
| - neofetch |
100 |
| - owner: "{{ user }}" |
101 |
| - mode: '0644' |
| 98 | + - name: Change default shell to Zsh (after setting up .zshrc) |
| 99 | + user: |
| 100 | + name: "{{ user }}" |
| 101 | + shell: /bin/zsh |
0 commit comments