1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_dotfiles.git synced 2024-08-16 16:09:49 +02:00
ansible_role_dotfiles/tasks/bashrc.yml
2021-09-19 03:18:12 +02:00

33 lines
813 B
YAML

---
- name: Create a global bashrc configuration
become: true
ansible.builtin.template:
src: 'templates/bash.bashrc'
dest: '/etc/bash.bashrc'
owner: root
group: root
mode: 'u=rw,g=r,o=r'
- name: Copy bashrc configuration to root
become: true
ansible.builtin.template:
src: 'templates/bashrc'
dest: '/root/.bashrc'
owner: 'root'
group: 'root'
mode: 'u=rw,g=r,o='
when: not dotfiles__allow_own_root_bashrc | bool
- name: Copy bashrc configuration to non admin users
become: true
ansible.builtin.template:
src: 'templates/bashrc'
dest: '/home/{{ item }}/.bashrc'
owner: '{{ item }}'
group: '{{ item }}'
mode: 'u=rw,g=r,o='
with_items: '{{ accounts }}'
when:
- accounts is defined
- accounts != ['root']
- accounts != 'root'