Johannes Kastl
unread,Jun 2, 2016, 3:10:46 PM6/2/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Dear all,
how to check the result of a lineinfile task?
I got one that outputs the following:
> "backup": "",
> "changed": true,
> "diff": [
> {
> "after": "",
> "after_header": "/path/to/file (content)",
> "before": "",
> "before_header": "/path/to/file (content)"
> },
> {
> "after_header": "/path/to/file (file attributes)",
> "before_header": "/path/to/file (file attributes)"
> }
> ],
> "msg": "line added"
I see the line has been added, but there is no rc or similar. I could
test for '(changed==true and msg=="line added") or (changed==false)',
but that seems rather clunky. Any better ideas?
Johannes