diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-05-31 23:12:36 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-05-31 23:12:36 +0200 |
commit | 3a2319c9c58886a7938deabafc66ad4bc128c9f8 (patch) | |
tree | 222b41b5b49633b9156c070df830d5c73617edd7 /roles/core/zsh/tasks/main.yml | |
parent | chaos-at-home: deploy apt-repo/base to some more hosts (diff) |
move core roles to subdir
Diffstat (limited to 'roles/core/zsh/tasks/main.yml')
-rw-r--r-- | roles/core/zsh/tasks/main.yml | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/roles/core/zsh/tasks/main.yml b/roles/core/zsh/tasks/main.yml new file mode 100644 index 00000000..a5ae60ec --- /dev/null +++ b/roles/core/zsh/tasks/main.yml @@ -0,0 +1,58 @@ +--- +- 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: "{{ zsh_conf_base_dir }}/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: "{{ zsh_bin_path }}" + +- 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: + path: "{{ item.key }}" + regexp: "{{ item.value.regexp }}" + line: "{{ item.value.line }}" + create: yes + +- 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: "{{ zsh_conf_base_dir }}/zlogin" + line: /etc/banner.sh + insertbefore: "^## END OF FILE #" + create: yes |