Regarding Notification playbook

42 views
Skip to first unread message

Prasanna M

unread,
Jun 14, 2022, 2:18:15 AM6/14/22
to AWX Project
Hi Team,

I need help to configure the new notification playbook.
Already i written the play book and which i am getting the error,Can you have a look on it please.

---
- hosts: all
  gather_facts: True
  become: yes

  tasks:
    - name: Execute the Uptime command over Command module
      register: uptimeoutput
      command: "uptime"
    - debug:
        var: uptimeoutput.stdout_lines
    - debug:
        msg: "SELinux status on host {{ ansible_selinux.status }}"

    - name: Add AWX Notifications Test
      collections: [awx.awx]
      vars:
        default_values:
        state: present
      awx.awx.tower_notification:

    - name: Add email notification
      tower_notification:
        name: email notification
        notification_type: email
        mail:
        host: smtp.uat.igi.ig.local
        port: 25
        sender:
        recipients:
          - 
        use_tls: no
        use_ssl: no
        state: present
        messages:
          started:
            message: "{{ '{{ job_friendly_name }}{{ job.id }} started' }}"
          success:
            message: "{{ '{{ job_friendly_name }} completed in {{ job.elapsed }} seconds' }}"
          error:
            message: "{{ '{{ job_friendly_name }} FAILED! Please look at {{ job.url }}' }}"
        tower_config_file: "~/tower_cli.cfg"

Prasanna M

unread,
Jun 14, 2022, 7:07:28 AM6/14/22
to AWX Project
any luck on this please

AWX Project

unread,
Jun 14, 2022, 8:58:05 AM6/14/22
to AWX Project
Hello,

Hello, we'd love to help, but we need a little more information about the problem you're having. Can you send us the error you are getting when running ansible-playbook?

-The AWX Team

Andrey Gangan

unread,
Jun 14, 2022, 9:50:04 AM6/14/22
to AWX Project
did you try AWX built in notification?


вторник, 14 июня 2022 г. в 15:58:05 UTC+3, AWX Project:

Prasanna M

unread,
Jun 14, 2022, 12:43:26 PM6/14/22
to AWX Project
The full traceback is:
152
Traceback (most recent call last):
153
File "/home/ansible/.ansible/tmp/ansible-tmp-1655187215.9642656-57-263527928933014/AnsiballZ_notification_template.py", line 100, in <module>
154
_ansiballz_main()
155
File "/home/ansible/.ansible/tmp/ansible-tmp-1655187215.9642656-57-263527928933014/AnsiballZ_notification_template.py", line 92, in _ansiballz_main
156
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
157
File "/home/ansible/.ansible/tmp/ansible-tmp-1655187215.9642656-57-263527928933014/AnsiballZ_notification_template.py", line 41, in invoke_module
158
run_name='__main__', alter_sys=True)
159
File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
160
fname, loader, pkg_name)
161
File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
162
mod_name, mod_fname, mod_loader, pkg_name)
163
File "/usr/lib64/python2.7/r…

Prasanna M

unread,
Jun 15, 2022, 1:02:22 PM6/15/22
to AWX Project
any luck

AWX Project

unread,
Jun 15, 2022, 4:11:24 PM6/15/22
to AWX Project
Hi, can you please post the full error traceback? It looks like what you pasted is missing some important messages.

also this could be problematic,

   - name: Add AWX Notifications Test
      collections: [awx.awx]
      vars:
        default_values:
        state: present
      awx.awx.tower_notification:

nothing is filled in after "awx.awx.tower_notification:"

AWX Team

Prasanna M

unread,
Jun 22, 2022, 10:55:54 PM6/22/22
to AWX Project
any update on my query please???

AWX Project

unread,
Jun 23, 2022, 8:28:10 AM6/23/22
to AWX Project
Last week we had inquired about getting the full stack trace so we could see where this error was generated from.
If you can provide that we should be able to see where the issue was in the module.

If you can also send the full output from the AWX log (there is a button in the upper right of the job output page to download it) that would be useful. Please mask out any information that is private.

In addition, we had reported that the second task in your playbook appears suspicious as it appears to call awx.awx.tower_notification with no parameters (but it could be just how the formatting came through in the email).

- The AWX team 
Reply all
Reply to author
Forward
0 new messages