summaryrefslogtreecommitdiff
path: root/roles/common/tasks/zsh.yml
blob: aabcfac7deaa3057ac46c094f9a49931c9c9fd27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- name: Install zsh
  package:
    name: zsh
    state: present

- name: Ensure zshrc.d directory exists
  file:
    path: /etc/zsh/zshrc.d
    state: directory
    mode: '0755'

- name: Enable zshrc.d loading
  blockinfile:
    path: /etc/zsh/zshrc
    block: |
      # Load modular zsh config
      if [ -d /etc/zsh/zshrc.d ]; then
        for file in /etc/zsh/zshrc.d/*.zsh; do
          [ -r "$file" ] && source "$file"
        done
      fi
  when: ansible_distribution == "Debian"

- name: Configure zsh
  copy:
    src: zshrc
    dest: /etc/zsh/zshrc.d/10-freya.zsh
    owner: root
    group: root
    mode: '0664'

- name: Remove old zsh config
  file:
    path: /etc/zsh/zshrc.d/freya.yml
    state: absent

- name: Ensure root user shell is zsh
  user:
    name: root
    shell: /bin/zsh