--- - 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=' loop: '{{ accounts }}' when: - accounts is defined - accounts != ['root'] - accounts != 'root'