From fae0f98f37c0e47448bb4bf42cb917a8dc454a5e Mon Sep 17 00:00:00 2001 From: bluikko <14869000+bluikko@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:59:53 +0700 Subject: [PATCH] Validate priority arg and doc fixes Validate the two possible priorities with choices. Add priority arg to one example and add version_added field for the arg docs. --- plugins/modules/mattermost.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/modules/mattermost.py b/plugins/modules/mattermost.py index d5eb7d791a3..af8ce696009 100644 --- a/plugins/modules/mattermost.py +++ b/plugins/modules/mattermost.py @@ -72,7 +72,9 @@ priority: type: str description: - - Set a priority for the message. For supported values, see mattermost doc. + - Set a priority for the message. + choices: [ important, urgent ] + version_added: 10.0.0 validate_certs: description: - If V(false), SSL certificates will not be validated. This should only be used @@ -96,6 +98,7 @@ channel: notifications username: 'Ansible on {{ inventory_hostname }}' icon_url: http://www.example.com/some-image-file.png + priority: important - name: Send attachments message via Mattermost community.general.mattermost: @@ -139,7 +142,7 @@ def main(): channel=dict(type='str', default=None), username=dict(type='str', default='Ansible'), icon_url=dict(type='str', default='https://docs.ansible.com/favicon.ico'), - priority=dict(type='str', default=None), + priority=dict(type='str', default=None, choices=['important', 'urgent']), validate_certs=dict(default=True, type='bool'), attachments=dict(type='list', elements='dict'), ),