ansible-antidote-role/tasks/configure.yml
2022-12-29 16:07:16 +01:00

57 lines
1.5 KiB
YAML

---
- name: Set default shell for users
become: true
ansible.builtin.user:
name: "{{ user.username }}"
shell: /bin/zsh
when: user.antidote_plugins is defined
loop: "{{ antidote_users }}"
loop_control:
loop_var: user
label: "{{ user.username }}"
- name: Write .antidoterc for users
become: true
become_user: "{{ user.username }}"
ansible.builtin.template:
src: antidoterc.j2
dest: "~{{ user.username }}/.antidoterc"
mode: "u=rw,go=r"
when: user.antidote_plugins is defined
loop: "{{ antidote_users }}"
loop_control:
loop_var: user
label: "{{ user.username }}"
- name: Write .zsh_plugins.txt for users
become: true
become_user: "{{ user.username }}"
ansible.builtin.template:
src: zsh_plugins.txt.j2
dest: "~{{ user.username }}/.zsh_plugins.txt"
mode: "u=rw,go=r"
when: user.antidote_plugins is defined
loop: "{{ antidote_users }}"
loop_control:
loop_var: user
label: "{{ user.username }}"
notify: "clean antidote"
- name: Add .antidoterc to .zshrc
become: true
become_user: "{{ user.username }}"
ansible.builtin.lineinfile:
path: "~/.zshrc"
line: "source ~/.antidoterc"
insertbefore: "source ~/.ansible_zshrc"
create: true
mode: "u=rw,go=r"
when: user.antidote_plugins is defined
loop: "{{ antidote_users }}"
loop_control:
loop_var: user
label: "{{ user.username }}"
# - name: configure console for Debian family distributions
# include_tasks: configure-debian-console.yml
# when: ansible_os_family == 'Debian'