summaryrefslogtreecommitdiff
path: root/roles/zsh/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/zsh/tasks/main.yml')
-rw-r--r--roles/zsh/tasks/main.yml33
1 files changed, 33 insertions, 0 deletions
diff --git a/roles/zsh/tasks/main.yml b/roles/zsh/tasks/main.yml
new file mode 100644
index 00000000..12eac8c4
--- /dev/null
+++ b/roles/zsh/tasks/main.yml
@@ -0,0 +1,33 @@
+---
+- name: install zsh packages
+ apt:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - zsh
+
+- name: install zsh-config
+ copy:
+ src: "{{ item.src }}"
+ dest: "{{ item.dest }}"
+ with_items:
+ - { src: "zshrc", dest: "/etc/zsh/zshrc" }
+ - { src: "zshrc.skel", dest: "/etc/skel/.zshrc" }
+
+- name: set zsh as default shell
+ user:
+ name: "{{ item }}"
+ shell: /bin/zsh
+ with_items: "{{ [ 'root' ] | union(zsh_loginshell_user | default([])) }}"
+
+- 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