ansible-antidote-role/tasks/configure.yml

56 lines
1.4 KiB
YAML
Raw Normal View History

2022-11-20 18:55:05 +01:00
---
- name: set default shell for users
become: yes
user:
name: "{{ user.username }}"
shell: /bin/zsh
when: user.antidote_plugins is defined
2022-11-20 18:59:29 +01:00
loop: "{{ antidote_users }}"
2022-11-20 18:55:05 +01:00
loop_control:
loop_var: user
label: "{{ user.username }}"
- name: write .antidoterc for users
become: yes
become_user: "{{ user.username }}"
template:
src: antidoterc.j2
dest: "~{{ user.username }}/.antidoterc"
mode: "u=rw,go=r"
when: user.antidote_plugins is defined
2022-11-20 18:59:29 +01:00
loop: "{{ antidote_users }}"
2022-11-20 18:55:05 +01:00
loop_control:
loop_var: user
label: "{{ user.username }}"
- name: write .zsh_plugins.txt for users
become: yes
become_user: "{{ user.username }}"
template:
src: zsh_plugins.txt.j2
dest: "~{{ user.username }}/.zsh_plugins.txt"
mode: "u=rw,go=r"
when: user.antidote_plugins is defined
2022-11-20 18:59:29 +01:00
loop: "{{ antidote_users }}"
2022-11-20 18:55:05 +01:00
loop_control:
loop_var: user
label: "{{ user.username }}"
- name: add .antidoterc to .zshrc
become: yes
become_user: "{{ user.username }}"
lineinfile:
path: "~/.zshrc"
line: "source ~/.antidoterc"
2022-11-20 18:59:29 +01:00
insertbefore: "source ~/.ansible_zshrc"
2022-11-20 18:55:05 +01:00
create: yes
mode: "u=rw,go=r"
when: user.antidote_plugins is defined
2022-11-20 18:59:29 +01:00
loop: "{{ antidote_users }}"
2022-11-20 18:55:05 +01:00
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'