I've been encountering issues with AWX notification templates and their customizations. The problem I'm facing is that the notification templates don't seem to be functioning as they should. I've followed the documentation provided on the Ansible Tower User Guide and also referred to the list of supported notification parameters, but the customizations I've made are not taking effect.
For instance, I can successfully make a PATCH
request to the following URL: https://{{ ansibleurl }}/api/v2/notification_templates/2/
using the API, and I can also edit the template in the UI. If I input incorrect variables or data, I do receive errors, which indicates that the changes are being recognized. However, the notification templates are not behaving as intended when notifications are triggered.
Here's an excerpt from the notification template structure I've been working with:
"messages": {
"started": {
"message": null,
"body": null
},
"success": {
"message": null,
"body": null
},
"error": {
"message": null,
"body": null
},
"workflow_approval": {
"approved": {
"message": "O 'Approval Node' do AWX \"{{ approval_node_name }}\" precisa ser revisado. Este node pode ser visualizado em: {{ workflow_url }}",
"body": "O 'Approval Node' do AWX \"{{ approval_node_name }}\" precisa ser revisado. Este node pode ser visualizado em: {{ workflow_url }}\n\n{{ job.id }}\n{{ job.name }}\n{{ job.created }}\n{{ job.job_explanation }}\n{{ job.url }}\n{{ job.summary_fields.created_by.username }}\n{{ job.summary_fields.created_by.first_name }}\n{{ job.summary_fields.created_by.last_name }}\n{{ job_friendly_name }}\n{{ job_metadata }}"
},
"denied": {
"message": "O 'Approval Node' do AWX \"{{ approval_node_name }}\" precisa ser revisado. Este node pode ser visualizado em: {{ workflow_url }}",
"body": "O 'Approval Node' do AWX \"{{ approval_node_name }}\" precisa ser revisado. Este node pode ser visualizado em: {{ workflow_url }}\n\n{{ job.id }}\n{{ job.name }}\n{{ job.created }}\n{{ job.job_explanation }}\n{{ job.url }}\n{{ job.summary_fields.created_by.username }}\n{{ job.summary_fields.created_by.first_name }}\n{{ job.summary_fields.created_by.last_name }}\n{{ job_friendly_name }}\n{{ job_metadata }}"
},
"running": {
"message": "O 'Approval Node' do AWX \"{{ approval_node_name }}\" precisa ser revisado. Este node pode ser visualizado em: {{ workflow_url }}",
"body": "O 'Approval Node' do AWX \"{{ approval_node_name }}\" precisa ser revisado. Este node pode ser visualizado em: {{ workflow_url }}\n\n{{ job.id }}\n{{ job.name }}\n{{ job.created }}\n{{ job.job_explanation }}\n{{ job.url }}\n{{ job.summary_fields.created_by.username }}\n{{ job.summary_fields.created_by.first_name }}\n{{ job.summary_fields.created_by.last_name }}\n{{ job_friendly_name }}\n{{ job_metadata }}"
},
"timed_out": {
"message": "O 'Approval Node' do AWX \"{{ approval_node_name }}\" precisa ser revisado. Este node pode ser visualizado em: {{ workflow_url }}",
"body": "O 'Approval Node' do AWX \"{{ approval_node_name }}\" precisa ser revisado. Este node pode ser visualizado em: {{ workflow_url }}\n\n{{ job.id }}\n{{ job.name }}\n{{ job.created }}\n{{ job.job_explanation }}\n{{ job.url }}\n{{ job.summary_fields.created_by.username }}\n{{ job.summary_fields.created_by.first_name }}\n{{ job.summary_fields.created_by.last_name }}\n{{ job_friendly_name }}\n{{ job_metadata }}"
}
}
}
}
Despite following the documentation closely, I haven't been able to achieve the desired behavior. Notifications triggered by these templates aren't reflecting the customization made in the messages
block.
Here's an example of a email not working:
And this is when I let all default:
Has anyone else encountered similar issues with AWX notification templates? Is there something specific I might be overlooking? Any guidance or suggestions on how to troubleshoot and resolve this problem would be greatly appreciated.
I'm using the AWX operator 2.2.1, version 22.3.0.
Expected Behavior:
I expected that the customized notification templates would be triggered with the appropriate messages and bodies when certain events occurred within AWX workflows.