2024-03-26 14:22:08 +01:00
|
|
|
---
|
|
|
|
- name: Create global bashrc configuration
|
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: 'templates/bash.bashrc.j2'
|
|
|
|
dest: '/etc/bash.bashrc'
|
2024-03-26 15:58:56 +01:00
|
|
|
owner: 'root'
|
|
|
|
group: 'root'
|
2024-05-24 11:40:08 +02:00
|
|
|
backup: true
|
2024-03-26 14:22:08 +01:00
|
|
|
mode: 'u=rw,g=r,o=r'
|
2024-03-26 15:58:56 +01:00
|
|
|
|
2024-04-06 20:08:55 +02:00
|
|
|
- name: Create bashrc configuration per user
|
2024-03-26 15:58:56 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: 'templates/dotbashrc.j2'
|
|
|
|
dest: "{{ user.home | default('/home/' + user.name) }}/.bashrc"
|
|
|
|
owner: "{{ user.name }}"
|
|
|
|
group: "{{ user.name }}"
|
|
|
|
mode: '0640'
|
2024-05-24 11:40:08 +02:00
|
|
|
backup: true
|
2024-03-26 15:58:56 +01:00
|
|
|
loop: "{{ _l3d_users__merged_users }}"
|
|
|
|
loop_control:
|
|
|
|
label: "user={{ user.name }}"
|
|
|
|
loop_var: user
|
|
|
|
when: user.state | default ('present') == 'present'
|
2024-05-24 11:40:08 +02:00
|
|
|
|
|
|
|
- name: Create bashrc for root
|
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: 'templates/dotbashrc.j2'
|
|
|
|
dest: "/root/.bashrc"
|
|
|
|
owner: 'root'
|
|
|
|
group: 'root'
|
|
|
|
mode: '0640'
|
|
|
|
backup: true
|
|
|
|
when: user.state | default ('present') == 'present'
|