From 7dd7cbdba8b5ca422fbe826cad63392fe1f50ee7 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 12 May 2024 10:03:06 +0200 Subject: [PATCH] Add proxmox action group (#8334) Add proxmox module defaults group. --- .../fragments/8334-proxmox-action-group.yml | 2 ++ meta/runtime.yml | 17 +++++++++++++++++ plugins/doc_fragments/proxmox.py | 10 ++++++++++ plugins/modules/proxmox.py | 3 +++ plugins/modules/proxmox_disk.py | 3 +++ plugins/modules/proxmox_domain_info.py | 4 ++++ plugins/modules/proxmox_group_info.py | 4 ++++ plugins/modules/proxmox_kvm.py | 3 +++ plugins/modules/proxmox_nic.py | 3 +++ plugins/modules/proxmox_node_info.py | 4 ++++ plugins/modules/proxmox_pool.py | 7 +++++-- plugins/modules/proxmox_pool_member.py | 7 +++++-- plugins/modules/proxmox_snap.py | 7 +++++-- .../modules/proxmox_storage_contents_info.py | 4 ++++ plugins/modules/proxmox_storage_info.py | 4 ++++ plugins/modules/proxmox_tasks_info.py | 10 +++++++--- plugins/modules/proxmox_template.py | 3 +++ plugins/modules/proxmox_user_info.py | 4 ++++ plugins/modules/proxmox_vm_info.py | 10 +++++++--- 19 files changed, 97 insertions(+), 12 deletions(-) create mode 100644 changelogs/fragments/8334-proxmox-action-group.yml diff --git a/changelogs/fragments/8334-proxmox-action-group.yml b/changelogs/fragments/8334-proxmox-action-group.yml new file mode 100644 index 00000000000..0e5aeeccdeb --- /dev/null +++ b/changelogs/fragments/8334-proxmox-action-group.yml @@ -0,0 +1,2 @@ +minor_changes: + - "proxmox* modules - there is now a ``community.general.proxmox`` module defaults group that can be used to set default options for all Proxmox modules (https://github.com/ansible-collections/community.general/pull/8334)." diff --git a/meta/runtime.yml b/meta/runtime.yml index 402dfd5fa2a..edeb53005ff 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -12,6 +12,23 @@ action_groups: - consul_role - consul_session - consul_token + proxmox: + - proxmox + - proxmox_disk + - proxmox_domain_info + - proxmox_group_info + - proxmox_kvm + - proxmox_nic + - proxmox_node_info + - proxmox_pool + - proxmox_pool_member + - proxmox_snap + - proxmox_storage_contents_info + - proxmox_storage_info + - proxmox_tasks_info + - proxmox_template + - proxmox_user_info + - proxmox_vm_info plugin_routing: callback: actionable: diff --git a/plugins/doc_fragments/proxmox.py b/plugins/doc_fragments/proxmox.py index 4972da4985f..cb533fefa62 100644 --- a/plugins/doc_fragments/proxmox.py +++ b/plugins/doc_fragments/proxmox.py @@ -65,3 +65,13 @@ class ModuleDocFragment(object): - Add the new VM to the specified pool. type: str ''' + + ACTIONGROUP_PROXMOX = r""" +options: {} +attributes: + action_group: + description: Use C(group/community.general.proxmox) in C(module_defaults) to set defaults for this module. + support: full + membership: + - community.general.proxmox +""" diff --git a/plugins/modules/proxmox.py b/plugins/modules/proxmox.py index 742c87c3c1f..73afd952e26 100644 --- a/plugins/modules/proxmox.py +++ b/plugins/modules/proxmox.py @@ -21,6 +21,8 @@ support: none diff_mode: support: none + action_group: + version_added: 9.0.0 options: password: description: @@ -216,6 +218,7 @@ seealso: - module: community.general.proxmox_vm_info extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.proxmox.selection - community.general.attributes diff --git a/plugins/modules/proxmox_disk.py b/plugins/modules/proxmox_disk.py index 69a7300dfd8..83cdbeee582 100644 --- a/plugins/modules/proxmox_disk.py +++ b/plugins/modules/proxmox_disk.py @@ -21,6 +21,8 @@ support: none diff_mode: support: none + action_group: + version_added: 9.0.0 options: name: description: @@ -325,6 +327,7 @@ - The drive's worldwide name, encoded as 16 bytes hex string, prefixed by V(0x). type: str extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.attributes ''' diff --git a/plugins/modules/proxmox_domain_info.py b/plugins/modules/proxmox_domain_info.py index 7435695a91e..f3ff212bff4 100644 --- a/plugins/modules/proxmox_domain_info.py +++ b/plugins/modules/proxmox_domain_info.py @@ -16,6 +16,9 @@ version_added: 1.3.0 description: - Retrieve information about one or more Proxmox VE domains. +attributes: + action_group: + version_added: 9.0.0 options: domain: description: @@ -24,6 +27,7 @@ type: str author: Tristan Le Guern (@tleguern) extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.attributes - community.general.attributes.info_module diff --git a/plugins/modules/proxmox_group_info.py b/plugins/modules/proxmox_group_info.py index 531a9dae7a1..eda1fe04d8a 100644 --- a/plugins/modules/proxmox_group_info.py +++ b/plugins/modules/proxmox_group_info.py @@ -16,6 +16,9 @@ version_added: 1.3.0 description: - Retrieve information about one or more Proxmox VE groups +attributes: + action_group: + version_added: 9.0.0 options: group: description: @@ -24,6 +27,7 @@ type: str author: Tristan Le Guern (@tleguern) extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.attributes - community.general.attributes.info_module diff --git a/plugins/modules/proxmox_kvm.py b/plugins/modules/proxmox_kvm.py index 8779dcdc1f9..253a75d4b38 100644 --- a/plugins/modules/proxmox_kvm.py +++ b/plugins/modules/proxmox_kvm.py @@ -21,6 +21,8 @@ support: none diff_mode: support: none + action_group: + version_added: 9.0.0 options: archive: description: @@ -579,6 +581,7 @@ seealso: - module: community.general.proxmox_vm_info extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.proxmox.selection - community.general.attributes diff --git a/plugins/modules/proxmox_nic.py b/plugins/modules/proxmox_nic.py index 9afe4944721..6e94ed0bb6d 100644 --- a/plugins/modules/proxmox_nic.py +++ b/plugins/modules/proxmox_nic.py @@ -21,6 +21,8 @@ support: full diff_mode: support: none + action_group: + version_added: 9.0.0 options: bridge: description: @@ -94,6 +96,7 @@ - Specifies the instance ID. type: int extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.attributes ''' diff --git a/plugins/modules/proxmox_node_info.py b/plugins/modules/proxmox_node_info.py index 82ef7aa3883..51d8745c05b 100644 --- a/plugins/modules/proxmox_node_info.py +++ b/plugins/modules/proxmox_node_info.py @@ -17,7 +17,11 @@ description: - Retrieve information about one or more Proxmox VE nodes. author: John Berninger (@jwbernin) +attributes: + action_group: + version_added: 9.0.0 extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.attributes - community.general.attributes.info_module diff --git a/plugins/modules/proxmox_pool.py b/plugins/modules/proxmox_pool.py index 7046320700a..5089ec3bef6 100644 --- a/plugins/modules/proxmox_pool.py +++ b/plugins/modules/proxmox_pool.py @@ -21,6 +21,8 @@ support: full diff_mode: support: none + action_group: + version_added: 9.0.0 options: poolid: description: @@ -42,8 +44,9 @@ type: str extends_documentation_fragment: - - community.general.proxmox.documentation - - community.general.attributes + - community.general.proxmox.actiongroup_proxmox + - community.general.proxmox.documentation + - community.general.attributes """ EXAMPLES = """ diff --git a/plugins/modules/proxmox_pool_member.py b/plugins/modules/proxmox_pool_member.py index 7d6b2494938..b26082f9758 100644 --- a/plugins/modules/proxmox_pool_member.py +++ b/plugins/modules/proxmox_pool_member.py @@ -20,6 +20,8 @@ support: full diff_mode: support: full + action_group: + version_added: 9.0.0 options: poolid: description: @@ -48,8 +50,9 @@ type: str extends_documentation_fragment: - - community.general.proxmox.documentation - - community.general.attributes + - community.general.proxmox.actiongroup_proxmox + - community.general.proxmox.documentation + - community.general.attributes """ EXAMPLES = """ diff --git a/plugins/modules/proxmox_snap.py b/plugins/modules/proxmox_snap.py index 4991423c2a0..4f7b345b80f 100644 --- a/plugins/modules/proxmox_snap.py +++ b/plugins/modules/proxmox_snap.py @@ -21,6 +21,8 @@ support: full diff_mode: support: none + action_group: + version_added: 9.0.0 options: hostname: description: @@ -89,8 +91,9 @@ requirements: [ "proxmoxer", "requests" ] author: Jeffrey van Pelt (@Thulium-Drake) extends_documentation_fragment: - - community.general.proxmox.documentation - - community.general.attributes + - community.general.proxmox.actiongroup_proxmox + - community.general.proxmox.documentation + - community.general.attributes ''' EXAMPLES = r''' diff --git a/plugins/modules/proxmox_storage_contents_info.py b/plugins/modules/proxmox_storage_contents_info.py index 498490fe41e..b777870e54c 100644 --- a/plugins/modules/proxmox_storage_contents_info.py +++ b/plugins/modules/proxmox_storage_contents_info.py @@ -17,6 +17,9 @@ version_added: 8.2.0 description: - Retrieves information about stored objects on a specific storage attached to a node. +attributes: + action_group: + version_added: 9.0.0 options: storage: description: @@ -41,6 +44,7 @@ type: int author: Julian Vanden Broeck (@l00ptr) extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.attributes - community.general.attributes.info_module diff --git a/plugins/modules/proxmox_storage_info.py b/plugins/modules/proxmox_storage_info.py index 3c29e59cf2c..fd5a6ee0d8f 100644 --- a/plugins/modules/proxmox_storage_info.py +++ b/plugins/modules/proxmox_storage_info.py @@ -16,6 +16,9 @@ version_added: 2.2.0 description: - Retrieve information about one or more Proxmox VE storages. +attributes: + action_group: + version_added: 9.0.0 options: storage: description: @@ -28,6 +31,7 @@ type: str author: Tristan Le Guern (@tleguern) extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.attributes - community.general.attributes.info_module diff --git a/plugins/modules/proxmox_tasks_info.py b/plugins/modules/proxmox_tasks_info.py index d31a04980bf..65a07566a88 100644 --- a/plugins/modules/proxmox_tasks_info.py +++ b/plugins/modules/proxmox_tasks_info.py @@ -17,6 +17,9 @@ description: - Retrieve information about one or more Proxmox VE tasks. author: 'Andreas Botzner (@paginabianca) ' +attributes: + action_group: + version_added: 9.0.0 options: node: description: @@ -29,9 +32,10 @@ aliases: ['upid', 'name'] type: str extends_documentation_fragment: - - community.general.proxmox.documentation - - community.general.attributes - - community.general.attributes.info_module + - community.general.proxmox.actiongroup_proxmox + - community.general.proxmox.documentation + - community.general.attributes + - community.general.attributes.info_module ''' diff --git a/plugins/modules/proxmox_template.py b/plugins/modules/proxmox_template.py index 615bfc18233..f73109931fc 100644 --- a/plugins/modules/proxmox_template.py +++ b/plugins/modules/proxmox_template.py @@ -20,6 +20,8 @@ support: none diff_mode: support: none + action_group: + version_added: 9.0.0 options: node: description: @@ -69,6 +71,7 @@ - C(proxmoxer) >= 1.2.0 requires C(requests_toolbelt) to upload files larger than 256 MB. author: Sergei Antipov (@UnderGreen) extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.attributes ''' diff --git a/plugins/modules/proxmox_user_info.py b/plugins/modules/proxmox_user_info.py index 20154528a67..8680dec7ca5 100644 --- a/plugins/modules/proxmox_user_info.py +++ b/plugins/modules/proxmox_user_info.py @@ -16,6 +16,9 @@ version_added: 1.3.0 description: - Retrieve information about one or more Proxmox VE users +attributes: + action_group: + version_added: 9.0.0 options: domain: description: @@ -33,6 +36,7 @@ type: str author: Tristan Le Guern (@tleguern) extends_documentation_fragment: + - community.general.proxmox.actiongroup_proxmox - community.general.proxmox.documentation - community.general.attributes - community.general.attributes.info_module diff --git a/plugins/modules/proxmox_vm_info.py b/plugins/modules/proxmox_vm_info.py index 30342b684ef..39d8307a43a 100644 --- a/plugins/modules/proxmox_vm_info.py +++ b/plugins/modules/proxmox_vm_info.py @@ -17,6 +17,9 @@ description: - Retrieve information about one or more Proxmox VE virtual machines. author: 'Sergei Antipov (@UnderGreen) ' +attributes: + action_group: + version_added: 9.0.0 options: node: description: @@ -55,9 +58,10 @@ default: none version_added: 8.1.0 extends_documentation_fragment: - - community.general.proxmox.documentation - - community.general.attributes - - community.general.attributes.info_module + - community.general.proxmox.actiongroup_proxmox + - community.general.proxmox.documentation + - community.general.attributes + - community.general.attributes.info_module """ EXAMPLES = """