Do not remove line that would have a customized subject
This commit is contained in:
parent
213e4a7bcd
commit
7ecf7be4a4
|
@ -1,4 +1,13 @@
|
||||||
---
|
---
|
||||||
|
- name: Fetch rc.local content
|
||||||
|
command: "grep -v '^#' /etc/rc.local"
|
||||||
|
check_mode: false
|
||||||
|
register: rclocal_content
|
||||||
|
failed_when: false
|
||||||
|
changed_when: false
|
||||||
|
tags:
|
||||||
|
- misc
|
||||||
|
|
||||||
- name: Configure rc.local
|
- name: Configure rc.local
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/rc.local
|
path: /etc/rc.local
|
||||||
|
@ -6,6 +15,8 @@
|
||||||
'date | mail -s "boot/reboot of $(hostname -s)" {{ general_alert_email }}'
|
'date | mail -s "boot/reboot of $(hostname -s)" {{ general_alert_email }}'
|
||||||
insertbefore: 'echo'
|
insertbefore: 'echo'
|
||||||
create: true
|
create: true
|
||||||
|
when:
|
||||||
|
- not (rclocal_content.stdout | regex_search('date \| mail -s (\"|\')boot/reboot of \$\(hostname -s\)'))
|
||||||
tags:
|
tags:
|
||||||
- misc
|
- misc
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue