From acde075b5fd91b2eab10c8b5ea6465601640c15b Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 13:20:40 +0200 Subject: [PATCH] [PR #10026/63cb8f0a backport][stable-10] deprecation: stackpath_compute (#10037) deprecation: stackpath_compute (#10026) * deprecation: stackpath_compute * add changelog frag * restore test file (cherry picked from commit 63cb8f0ace2ef9d207e4e27e1657b7cec15c8ae2) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- .../10026-stackpath-compute-deprecation.yml | 2 + meta/runtime.yml | 4 + plugins/inventory/stackpath_compute.py | 94 +++++++++---------- 3 files changed, 53 insertions(+), 47 deletions(-) create mode 100644 changelogs/fragments/10026-stackpath-compute-deprecation.yml diff --git a/changelogs/fragments/10026-stackpath-compute-deprecation.yml b/changelogs/fragments/10026-stackpath-compute-deprecation.yml new file mode 100644 index 0000000000..dfd3f7e236 --- /dev/null +++ b/changelogs/fragments/10026-stackpath-compute-deprecation.yml @@ -0,0 +1,2 @@ +deprecated_features: + - stackpath_compute inventory plugin - plugin is deprecated and will be removed in community.general 11.0.0 (https://github.com/ansible-collections/community.general/pull/10026). diff --git a/meta/runtime.yml b/meta/runtime.yml index 6499587af7..735e513f67 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -964,6 +964,10 @@ plugin_routing: redirect: community.docker.docker_swarm kubevirt: redirect: community.kubevirt.kubevirt + stackpath_compute: + deprecation: + removal_version: 11.0.0 + warning_text: The company and the service were sunset in June 2024. filter: path_join: # The ansible.builtin.path_join filter has been added in ansible-base 2.10. diff --git a/plugins/inventory/stackpath_compute.py b/plugins/inventory/stackpath_compute.py index bc55027155..e219f92641 100644 --- a/plugins/inventory/stackpath_compute.py +++ b/plugins/inventory/stackpath_compute.py @@ -6,60 +6,60 @@ from __future__ import annotations -DOCUMENTATION = ''' - name: stackpath_compute - short_description: StackPath Edge Computing inventory source - version_added: 1.2.0 - author: - - UNKNOWN (@shayrybak) - extends_documentation_fragment: - - inventory_cache - - constructed +DOCUMENTATION = r""" +name: stackpath_compute +short_description: StackPath Edge Computing inventory source +version_added: 1.2.0 +author: + - UNKNOWN (@shayrybak) +deprecated: + removed_in: 11.0.0 + why: Stackpath (the company) ceased its operations in June 2024. The API URL this plugin relies on is not found in DNS. + alternative: There is none. +extends_documentation_fragment: + - inventory_cache + - constructed +description: + - Get inventory hosts from StackPath Edge Computing. + - Uses a YAML configuration file that ends with stackpath_compute.(yml|yaml). +options: + plugin: description: - - Get inventory hosts from StackPath Edge Computing. - - Uses a YAML configuration file that ends with stackpath_compute.(yml|yaml). - options: - plugin: - description: - - A token that ensures this is a source file for the plugin. - required: true - type: string - choices: ['community.general.stackpath_compute'] - client_id: - description: - - An OAuth client ID generated from the API Management section of the StackPath customer portal - U(https://control.stackpath.net/api-management). - required: true - type: str - client_secret: - description: - - An OAuth client secret generated from the API Management section of the StackPath customer portal - U(https://control.stackpath.net/api-management). - required: true - type: str - stack_slugs: - description: - - A list of Stack slugs to query instances in. If no entry then get instances in all stacks on the account. - type: list - elements: str - use_internal_ip: - description: - - Whether or not to use internal IP addresses, If false, uses external IP addresses, internal otherwise. - - If an instance doesn't have an external IP it will not be returned when this option is set to false. - type: bool -''' + - A token that ensures this is a source file for the plugin. + required: true + type: string + choices: ['community.general.stackpath_compute'] + client_id: + description: + - An OAuth client ID generated from the API Management section of the StackPath customer portal U(https://control.stackpath.net/api-management). + required: true + type: str + client_secret: + description: + - An OAuth client secret generated from the API Management section of the StackPath customer portal U(https://control.stackpath.net/api-management). + required: true + type: str + stack_slugs: + description: + - A list of Stack slugs to query instances in. If no entry then get instances in all stacks on the account. + type: list + elements: str + use_internal_ip: + description: + - Whether or not to use internal IP addresses, If false, uses external IP addresses, internal otherwise. + - If an instance doesn't have an external IP it will not be returned when this option is set to false. + type: bool +""" -EXAMPLES = ''' -# Example using credentials to fetch all workload instances in a stack. ---- +EXAMPLES = r""" plugin: community.general.stackpath_compute client_id: my_client_id client_secret: my_client_secret stack_slugs: -- my_first_stack_slug -- my_other_stack_slug + - my_first_stack_slug + - my_other_stack_slug use_internal_ip: false -''' +""" import traceback import json