Send an email on Yum update (success) or fail, etc

10 views
Skip to first unread message

Eric Holzapfel

unread,
Jun 15, 2020, 7:12:31 PM6/15/20
to AWX Project
Hello All,

Finally got my axw running reliably. Using Ubuntu 19.10.
I use the yum module (ansible) with success for listing, updating, etc.

I hope this question is not out-of-scope for the awx forum.

I can get the status of the yum module (like changed, failed, etc
I register the yum results in a variable, and can get results like yum_status.changed.

I want to send an email base on the status: when changed is "false"

Any tips on how to do this?

Thanks,

ewholz

wme...@why-me.com

unread,
Jun 15, 2020, 8:11:29 PM6/15/20
to Eric Holzapfel, AWX Project
Just add something like this:

- name: Mail Results
      mail:
        to: who...@me.com
        from: ansibl...@me.com
        subject: "No Updates applied to {{inventory_hostname}} today"
        body: "No updates were applied"
      when:
        - variable= false
--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
awx-project...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/awx-project/b5f0bc56-7f54-42d1-9dd8-6e012fd5ec02o%40googlegroups.com.

Eric Holzapfel

unread,
Jun 15, 2020, 9:45:40 PM6/15/20
to AWX Project

Hello - thanks for the reply - I did find the correct syntax for this
similar to your suggestion ; the when: variable needs to be configured with == and quotes.

thanks again

On Monday, June 15, 2020 at 5:11:29 PM UTC-7, wme...@why-me.com wrote:
Just add something like this:

- name: Mail Results
      mail:
        to: who...@me.com
        from: ansibl...@me.com
        subject: "No Updates applied to {{inventory_hostname}} today"
        body: "No updates were applied"
      when:
        - variable= false






Hello All,

Finally got my axw running reliably. Using Ubuntu 19.10.
I use the yum module (ansible) with success for listing, updating, etc.

I hope this question is not out-of-scope for the awx forum.

I can get the status of the yum module (like changed, failed, etc
I register the yum results in a variable, and can get results like yum_status.changed.

I want to send an email base on the status: when changed is "false"

Any tips on how to do this?

Thanks,

ewholz
--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.

To view this discussion on the web visit
Reply all
Reply to author
Forward
0 new messages