From edacf20fb4565a2d0188d67cc6dd8f6085dce349 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 27 Jul 2025 16:51:09 +0200 Subject: [PATCH 1/2] Deprecate default value of is_pre740. --- changelogs/fragments/10490-rocketchat.yml | 3 +++ plugins/modules/rocketchat.py | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/10490-rocketchat.yml diff --git a/changelogs/fragments/10490-rocketchat.yml b/changelogs/fragments/10490-rocketchat.yml new file mode 100644 index 0000000000..73657ba67c --- /dev/null +++ b/changelogs/fragments/10490-rocketchat.yml @@ -0,0 +1,3 @@ +deprecated_features: + - "rocketchat - the default value for ``is_pre740``, currently ``true``, is deprecated and will change to ``false`` in community.general 13.0.0 + (https://github.com/ansible-collections/community.general/pull/10490)." diff --git a/plugins/modules/rocketchat.py b/plugins/modules/rocketchat.py index 0793e9dd38..2830c6db09 100644 --- a/plugins/modules/rocketchat.py +++ b/plugins/modules/rocketchat.py @@ -104,10 +104,9 @@ options: description: - If V(true), the payload matches Rocket.Chat prior to 7.4.0 format. This format has been used by the module since its inception, but is no longer supported by Rocket.Chat 7.4.0. - - The default value of the option is going to change to V(false) eventually. + - The default value of the option, V(true), is **deprecated** since community.general 11.2.0 and will change to V(false) in community.general 13.0.0. - This parameter is going to be removed in a future release when Rocket.Chat 7.4.0 becomes the minimum supported version. type: bool - default: true version_added: 10.5.0 """ @@ -237,7 +236,7 @@ def main(): validate_certs=dict(default=True, type='bool'), color=dict(type='str', default='normal', choices=['normal', 'good', 'warning', 'danger']), attachments=dict(type='list', elements='dict', required=False), - is_pre740=dict(default=True, type='bool') + is_pre740=dict(type='bool') ) ) @@ -254,6 +253,15 @@ def main(): attachments = module.params['attachments'] is_pre740 = module.params['is_pre740'] + if is_pre740 is None: + module.deprecate( + "The default value 'true' for 'is_pre740' is deprecated and will change to 'false' in community.general 13.0.0." + " You can explicitly set 'is_pre740' in your task to avoid this deprecation warning", + version="13.0.0", + collection_name="community.general", + ) + is_pre740 = True + payload = build_payload_for_rocketchat(module, text, channel, username, icon_url, icon_emoji, link_names, color, attachments, is_pre740) do_notify_rocketchat(module, domain, token, protocol, payload) From 2aafefd14254632a27699fdb3e5d20941f065334 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 27 Jul 2025 21:03:13 +0200 Subject: [PATCH 2/2] Use correct markup. Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- plugins/modules/rocketchat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/rocketchat.py b/plugins/modules/rocketchat.py index 2830c6db09..041cf2901c 100644 --- a/plugins/modules/rocketchat.py +++ b/plugins/modules/rocketchat.py @@ -104,7 +104,7 @@ options: description: - If V(true), the payload matches Rocket.Chat prior to 7.4.0 format. This format has been used by the module since its inception, but is no longer supported by Rocket.Chat 7.4.0. - - The default value of the option, V(true), is **deprecated** since community.general 11.2.0 and will change to V(false) in community.general 13.0.0. + - The default value of the option, V(true), is B(deprecated) since community.general 11.2.0 and will change to V(false) in community.general 13.0.0. - This parameter is going to be removed in a future release when Rocket.Chat 7.4.0 becomes the minimum supported version. type: bool version_added: 10.5.0