diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-12-26 23:25:02 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-12-26 23:25:02 +0100 |
commit | 74684fb93e26e2c9f37f699a84eb94acaf93c07a (patch) | |
tree | b514b605b934a6ee074a200e75f918ba05ad109e /roles/zsh/tasks | |
parent | nextcloud: upgrade all instances and add occ script (diff) | |
parent | base role supports openbsd now too (diff) |
Merge branch 'topic/openbsd-test'
Diffstat (limited to 'roles/zsh/tasks')
-rw-r--r-- | roles/zsh/tasks/main.yml | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/roles/zsh/tasks/main.yml b/roles/zsh/tasks/main.yml index 80880f83..a5ae60ec 100644 --- a/roles/zsh/tasks/main.yml +++ b/roles/zsh/tasks/main.yml @@ -1,13 +1,21 @@ --- -- name: install zsh packages - apt: +- name: load os/distrubtion/version specific variables + include_vars: "{{ item }}" + with_first_found: + - files: + - "{{ ansible_distribution_release }}.yml" + - "{{ ansible_distribution }}.yml" + - "{{ ansible_os_family }}.yml" + +- name: install zsh package + package: name: zsh state: present - name: install zsh-config loop: - src: "zshrc" - dest: "/etc/zsh/zshrc" + dest: "{{ zsh_conf_base_dir }}/zshrc" - src: "zshrc.skel" dest: "/etc/skel/.zshrc" loop_control: @@ -20,19 +28,17 @@ 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 + shell: "{{ zsh_bin_path }}" -- name: make zsh the default shell for adduser +- name: make zsh the default shell for new users + loop: "{{ zsh_default_shell_lineinfile | dict2items }}" + loop_control: + label: "{{ item.key }} ('{{ item.value.regexp }}' -> '{{ item.value.line }}')" lineinfile: - regexp: '^#?DSHELL=' - line: 'DSHELL=/bin/zsh' - path: /etc/adduser.conf + path: "{{ item.key }}" + regexp: "{{ item.value.regexp }}" + line: "{{ item.value.line }}" + create: yes - name: install shell banner when: zsh_banner is defined @@ -46,6 +52,7 @@ - name: enable banner for zsh login lineinfile: - path: /etc/zsh/zlogin + path: "{{ zsh_conf_base_dir }}/zlogin" line: /etc/banner.sh insertbefore: "^## END OF FILE #" + create: yes |