Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'idempotent' attribute #132

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions plugins/doc_fragments/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ class ModuleDocFragment(object):
description: Can run in C(check_mode) and return changed status prediction without modifying target.
diff_mode:
description: Will return details on what has changed (or possibly needs changing in C(check_mode)), when in diff mode.
idempotent:
description:
- When run twice in a row outside check mode, with the same arguments, the second invocation indicates no change.
- 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
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
support: full
diff_mode:
support: none
idempotent:
support: full

options:
server_number:
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/failover_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
support: full
diff_mode:
support: full
idempotent:
support: full

options:
failover_ip:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/failover_ip_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- community.hrobot.robot
- community.hrobot.attributes
- community.hrobot.attributes.actiongroup_robot
- community.hrobot.attributes.idempotent_not_modify_state
- community.hrobot.attributes.info_module

attributes:
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
support: full
diff_mode:
support: full
idempotent:
support: full

options:
server_ip:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/firewall_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- community.hrobot.robot
- community.hrobot.attributes
- community.hrobot.attributes.actiongroup_robot
- community.hrobot.attributes.idempotent_not_modify_state
- community.hrobot.attributes.info_module

attributes:
Expand Down
4 changes: 4 additions & 0 deletions plugins/modules/reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
support: full
diff_mode:
support: none
idempotent:
support: none
details:
- This module performs an action on every invocation.

options:
server_number:
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/reverse_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
support: full
diff_mode:
support: none
idempotent:
support: full

options:
ip:
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
support: full
diff_mode:
support: none
idempotent:
support: full

options:
server_number:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/server_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- community.hrobot.robot
- community.hrobot.attributes
- community.hrobot.attributes.actiongroup_robot
- community.hrobot.attributes.idempotent_not_modify_state
- community.hrobot.attributes.info_module

attributes:
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/ssh_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
support: full
diff_mode:
support: none
idempotent:
support: full

options:
state:
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/ssh_key_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- community.hrobot.robot
- community.hrobot.attributes
- community.hrobot.attributes.actiongroup_robot
- community.hrobot.attributes.idempotent_not_modify_state
- community.hrobot.attributes.info_module
attributes:
action_group:
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/v_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
support: full
diff_mode:
support: none
idempotent:
support: full

options:
vlan:
Expand Down
Loading