Skip to content

Commit

Permalink
Add helper fragment for modules that do not modify state.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Dec 29, 2024
1 parent 8eb7c75 commit 2321349
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 20 deletions.
10 changes: 10 additions & 0 deletions plugins/doc_fragments/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ class ModuleDocFragment(object):
- This assumes that the system controlled/queried by the module has not changed in a relevant way.
"""

# Should be used together with the standard fragment
IDEMPOTENT_NOT_MODIFY_STATE = r"""
options: {}
attributes:
idempotent:
support: full
details:
- This action does not modify state.
"""

# Should be used together with the standard fragment
INFO_MODULE = r'''
options: {}
Expand Down
2 changes: 0 additions & 2 deletions plugins/doc_fragments/module_record_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class ModuleDocFragment(object):
attributes:
idempotent:
support: full
details:
- This action does not modify state.
options:
what:
description:
Expand Down
2 changes: 0 additions & 2 deletions plugins/doc_fragments/module_record_set_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class ModuleDocFragment(object):
attributes:
idempotent:
support: full
details:
- This action does not modify state.
options:
what:
description:
Expand Down
2 changes: 0 additions & 2 deletions plugins/doc_fragments/module_zone_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class ModuleDocFragment(object):
attributes:
idempotent:
support: full
details:
- This action does not modify state.
options:
zone_name:
description:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/hetzner_dns_record_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- community.dns.attributes
- community.dns.attributes.actiongroup_hetzner
- community.dns.attributes.info_module
- community.dns.attributes.idempotent_not_modify_state
attributes:
action_group:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/hetzner_dns_record_set_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- community.dns.attributes
- community.dns.attributes.actiongroup_hetzner
- community.dns.attributes.info_module
- community.dns.attributes.idempotent_not_modify_state
attributes:
action_group:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/hetzner_dns_zone_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- community.dns.attributes
- community.dns.attributes.actiongroup_hetzner
- community.dns.attributes.info_module
- community.dns.attributes.idempotent_not_modify_state
attributes:
action_group:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/hosttech_dns_record_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- community.dns.attributes
- community.dns.attributes.actiongroup_hosttech
- community.dns.attributes.info_module
- community.dns.attributes.idempotent_not_modify_state
attributes:
action_group:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/hosttech_dns_record_set_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- community.dns.attributes
- community.dns.attributes.actiongroup_hosttech
- community.dns.attributes.info_module
- community.dns.attributes.idempotent_not_modify_state
attributes:
action_group:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/hosttech_dns_zone_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- community.dns.attributes
- community.dns.attributes.actiongroup_hosttech
- community.dns.attributes.info_module
- community.dns.attributes.idempotent_not_modify_state
attributes:
action_group:
Expand Down
6 changes: 1 addition & 5 deletions plugins/modules/nameserver_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@
extends_documentation_fragment:
- community.dns.attributes
- community.dns.attributes.info_module
- community.dns.attributes.idempotent_not_modify_state
author:
- Felix Fontein (@felixfontein)
attributes:
idempotent:
support: full
details:
- This action does not modify state.
options:
name:
description:
Expand Down
6 changes: 1 addition & 5 deletions plugins/modules/nameserver_record_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@
extends_documentation_fragment:
- community.dns.attributes
- community.dns.attributes.info_module
- community.dns.attributes.idempotent_not_modify_state
author:
- Felix Fontein (@felixfontein)
attributes:
idempotent:
support: full
details:
- This action does not modify state.
options:
name:
description:
Expand Down
5 changes: 1 addition & 4 deletions plugins/modules/wait_for_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Wait for TXT entries with specific values to show up on B(all) authoritative nameservers for the DNS name.
extends_documentation_fragment:
- community.dns.attributes
- community.dns.attributes.idempotent_not_modify_state
attributes:
check_mode:
support: full
Expand All @@ -27,10 +28,6 @@
support: N/A
details:
- This action does not modify state.
idempotent:
support: full
details:
- This action does not modify state.
author:
- Felix Fontein (@felixfontein)
options:
Expand Down

0 comments on commit 2321349

Please sign in to comment.