Set email aliases for users

This commit is contained in:
Stefan Haun 2020-12-11 11:17:12 +01:00
parent 8c78c2bbfd
commit 081a0d1af6

View file

@ -39,3 +39,13 @@
append: yes append: yes
when: item.sudo == true when: item.sudo == true
with_items: "{{ users }}" with_items: "{{ users }}"
- name: Set system email alias
lineinfile:
path: /etc/aliases
state: present
regexp: "^{{ item.logname }}:"
line: "{{ item.logname }}: {{ item.email }}"
notify: Update aliases
when: item.email is defined
with_items: "{{ users }}"