Add line before the "echo '.'" line instead of the end Delete old entry not precising the hostname if still there
This commit is contained in:
parent
b0f1f9c2ca
commit
f97317b767
|
@ -4,10 +4,20 @@
|
||||||
path: /etc/rc.local
|
path: /etc/rc.local
|
||||||
line:
|
line:
|
||||||
'date | mail -s "boot/reboot of $(hostname -s)" {{ general_alert_email }}'
|
'date | mail -s "boot/reboot of $(hostname -s)" {{ general_alert_email }}'
|
||||||
|
insertbefore: 'echo'
|
||||||
create: true
|
create: true
|
||||||
tags:
|
tags:
|
||||||
- misc
|
- misc
|
||||||
|
|
||||||
|
- name: Delete rc.local entry of boot/reboot not precising hostname
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/rc.local
|
||||||
|
regexp:
|
||||||
|
"^.* mail -s (?!.*of.*).+$"
|
||||||
|
state: absent
|
||||||
|
tags:
|
||||||
|
- misc
|
||||||
|
|
||||||
- name: Set root mail alias
|
- name: Set root mail alias
|
||||||
replace:
|
replace:
|
||||||
dest: /etc/mail/aliases
|
dest: /etc/mail/aliases
|
||||||
|
|
Loading…
Reference in a new issue