blob: 80880f8340ffaaae83bf85a5fc32f4c930d7b6b4 (
plain) (
blame)
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
41
42
43
44
45
46
47
48
49
50
51
|
---
- name: install zsh packages
apt:
name: zsh
state: present
- name: install zsh-config
loop:
- src: "zshrc"
dest: "/etc/zsh/zshrc"
- src: "zshrc.skel"
dest: "/etc/skel/.zshrc"
loop_control:
label: "{{ item.dest }}"
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
- name: set zsh as default shell
loop: "{{ [ 'root' ] | union(zsh_loginshell_user | default([])) }}"
user:
name: "{{ item }}"
shell: /bin/zsh
- name: make zsh the default shell for useradd
lineinfile:
regexp: '^#?SHELL='
line: 'SHELL=/bin/zsh'
path: /etc/default/useradd
- name: make zsh the default shell for adduser
lineinfile:
regexp: '^#?DSHELL='
line: 'DSHELL=/bin/zsh'
path: /etc/adduser.conf
- name: install shell banner
when: zsh_banner is defined
block:
- name: install banner script
template:
src: "banner.{{ zsh_banner }}.j2"
dest: /etc/banner.sh
mode: 0755
- name: enable banner for zsh login
lineinfile:
path: /etc/zsh/zlogin
line: /etc/banner.sh
insertbefore: "^## END OF FILE #"
|