diff --git a/README.md b/README.md index d750521..3f85515 100644 --- a/README.md +++ b/README.md @@ -32,75 +32,75 @@ export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ## Available Modules ### Job Worker Management -- **activate_job_worker**: Activate the job worker for an IAP system +- **activate_job_worker**: Activate the job worker for an Itential Platform system ```yaml - - name: Activate IAP job worker + - name: Activate Itential Platform job worker itential.platform.activate_job_worker: ``` -- **deactivate_job_worker**: Deactivate the job worker for an IAP system +- **deactivate_job_worker**: Deactivate the job worker for an Itential Platform system ```yaml - - name: Deactivate IAP job worker + - name: Deactivate Itential Platform job worker itential.platform.deactivate_job_worker: ``` ### Task Worker Management -- **activate_task_worker**: Activate the task worker for an IAP system +- **activate_task_worker**: Activate the task worker for an Itential Platform system ```yaml - - name: Activate IAP task worker + - name: Activate Itential Platform task worker itential.platform.activate_task_worker: ``` -- **deactivate_task_worker**: Deactivate the task worker for an IAP system +- **deactivate_task_worker**: Deactivate the task worker for an Itential Platform system ```yaml - - name: Deactivate IAP task worker + - name: Deactivate Itential Platform task worker itential.platform.deactivate_task_worker: ``` ### System Information -- **get_system_health**: Retrieve the health status of an IAP system +- **get_system_health**: Retrieve the health status of an Itential Platform system ```yaml - - name: Get IAP system health + - name: Get Itential Platform system health itential.platform.get_system_health: ``` -- **get_worker_status**: Get the current status of IAP workers +- **get_worker_status**: Get the current status of Itential Platform workers ```yaml - - name: Get IAP worker status + - name: Get Itential Platform worker status itential.platform.get_worker_status: ``` ### Job and Task Management -- **get_jobs**: Retrieve a list of jobs from an IAP system +- **get_jobs**: Retrieve a list of jobs from an Itential Platform system ```yaml - - name: Get IAP jobs + - name: Get Itential Platform jobs itential.platform.get_jobs: ``` -- **get_tasks**: Retrieve a list of tasks from an IAP system +- **get_tasks**: Retrieve a list of tasks from an Itential Platform system ```yaml - - name: Get IAP tasks + - name: Get Itential Platform tasks itential.platform.get_tasks: ``` ### System Administration -- **restart_adapter**: Restart a specific adapter in the IAP system +- **restart_adapter**: Restart a specific adapter in the Itential Platform system ```yaml - - name: Restart IAP adapter + - name: Restart Itential Platform adapter itential.platform.restart_adapter: adapter_name: "my-adapter" ``` -- **restart_application**: Restart the IAP application +- **restart_application**: Restart the Itential Platform application ```yaml - - name: Restart IAP application + - name: Restart Itential Platform application itential.platform.restart_application: ``` ### Connection Parameters Each module requires the following connection parameters which can be defined in your Ansible environment: -- `host`: The hostname or IP of the IAP instance -- `port`: The port number for the IAP API +- `host`: The hostname or IP of the Itential Platform instance +- `port`: The port number for the Itential Platform API - `use_tls`: Whether to use HTTPS (default: true) - `verify`: Whether to verify SSL certificates (default: true) - `disable_warnings`: Whether to disable SSL warning messages (default: false) diff --git a/plugins/action/activate_job_worker.py b/plugins/action/activate_job_worker.py index 35b2861..78668e5 100644 --- a/plugins/action/activate_job_worker.py +++ b/plugins/action/activate_job_worker.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Activates the IAP job worker. No parameters required. +# Activates the Itential Platform job worker. No parameters required. # Example: # - name: Activate job worker # itential.platform.activate_job_worker: diff --git a/plugins/action/activate_task_worker.py b/plugins/action/activate_task_worker.py index 96462db..80c8932 100644 --- a/plugins/action/activate_task_worker.py +++ b/plugins/action/activate_task_worker.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Activates the IAP task worker. No parameters required. +# Activates the Itential Platform task worker. No parameters required. # Example: # - name: Activate task worker # itential.platform.activate_task_worker: diff --git a/plugins/action/deactivate_job_worker.py b/plugins/action/deactivate_job_worker.py index 45b6bbc..8d04511 100644 --- a/plugins/action/deactivate_job_worker.py +++ b/plugins/action/deactivate_job_worker.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Deactivates the IAP job worker. No parameters required. +# Deactivates the Itential Platform job worker. No parameters required. # Example: # - name: Deactivate job worker # itential.platform.deactivate_job_worker: diff --git a/plugins/action/deactivate_task_worker.py b/plugins/action/deactivate_task_worker.py index c84fa1f..648acc4 100644 --- a/plugins/action/deactivate_task_worker.py +++ b/plugins/action/deactivate_task_worker.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Deactivates the IAP task worker. No parameters required. +# Deactivates the Itential Platform task worker. No parameters required. # Example: # - name: Deactivate task worker # itential.platform.deactivate_task_worker: diff --git a/plugins/action/get_jobs.py b/plugins/action/get_jobs.py index e54b4dd..5cf9251 100644 --- a/plugins/action/get_jobs.py +++ b/plugins/action/get_jobs.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Retrieves list of jobs from IAP. No parameters required. +# Retrieves list of jobs from Itential Platform. No parameters required. # Returns: List of job objects with their status and details. # Example: # - name: Get all jobs diff --git a/plugins/action/get_system_health.py b/plugins/action/get_system_health.py index d031cc5..c183e63 100644 --- a/plugins/action/get_system_health.py +++ b/plugins/action/get_system_health.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Retrieves IAP system health status. No parameters required. +# Retrieves the Itential Platform system health status. No parameters required. # Returns: System health information including component statuses. # Example: # - name: Get system health diff --git a/plugins/action/get_tasks.py b/plugins/action/get_tasks.py index 7a9d067..36cf4d7 100644 --- a/plugins/action/get_tasks.py +++ b/plugins/action/get_tasks.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Retrieves list of tasks from IAP. Supports filtering via parameters. +# Retrieves list of tasks from Itential Platform. Supports filtering via parameters. # Returns: List of task objects with their status and details. # Example: # - name: Get tasks by status diff --git a/plugins/action/get_worker_status.py b/plugins/action/get_worker_status.py index 990c21c..bafa0f8 100644 --- a/plugins/action/get_worker_status.py +++ b/plugins/action/get_worker_status.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Retrieves status of all IAP workers. No parameters required. +# Retrieves status of all Itential Platform workers. No parameters required. # Returns: Status information for job and task workers. # Example: # - name: Get worker status diff --git a/plugins/action/restart_adapters.py b/plugins/action/restart_adapters.py index cfaaa30..e71e1c6 100644 --- a/plugins/action/restart_adapters.py +++ b/plugins/action/restart_adapters.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Restarts one or more IAP adapters. +# Restarts one or more Itential Platform adapters. # Parameters: # adapter_names: A single adapter name (str) or a list of adapter names (list). # @@ -34,7 +34,7 @@ class ActionModule(ActionBase): _requires_connection = False def run(self, tmp=None, task_vars=None): - """Restart one or more IAP adapters by making API requests.""" + """Restart one or more Itential Platform adapters by making API requests.""" adapter_names = self._task.args.get("adapter_names") if not adapter_names: diff --git a/plugins/action/restart_applications.py b/plugins/action/restart_applications.py index f64aa00..33f82c8 100644 --- a/plugins/action/restart_applications.py +++ b/plugins/action/restart_applications.py @@ -3,24 +3,24 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# Restarts one or more IAP applications. +# Restarts one or more Itential Platform applications. # Parameters: # application_names: A single application name (str) or a list of application names (list). # # Examples: # - name: Restart a single application (string input) -# itential.platform.restart_application: -# application_names: "iap-core" +# itential.platform.restart_applications: +# application_names: OperationsManager # # - name: Restart a single application (list input) -# itential.platform.restart_application: +# itential.platform.restart_applications: # application_names: -# - iap-core +# - OperationsManager # # - name: Restart multiple applications -# itential.platform.restart_application: +# itential.platform.restart_applications: # application_names: -# - iap-core +# - OperationsManager # - ag-manager from ansible.plugins.action import ActionBase @@ -34,7 +34,7 @@ class ActionModule(ActionBase): _requires_connection = False def run(self, tmp=None, task_vars=None): - """Restart one or more IAP applications by making API requests.""" + """Restart one or more Itential Platform applications by making API requests.""" application_names = self._task.args.get("application_names") if not application_names: @@ -53,4 +53,4 @@ def run(self, tmp=None, task_vars=None): response = make_request(task_vars, method, endpoint) results.append(response) - return {"results": results} # Always return a list + return {"results": results} diff --git a/plugins/module_utils/host.py b/plugins/module_utils/host.py index 58433bc..78269e4 100644 --- a/plugins/module_utils/host.py +++ b/plugins/module_utils/host.py @@ -22,7 +22,6 @@ type: str required: true vars: - - itential_host - ansible_host port: @@ -30,9 +29,9 @@ - The port used to connect to the remote host type: int vars: - - itential_port - - ansible_port - - iap_port + - platform_port + - platform_http_port + - platform_https_port username: description: @@ -41,9 +40,8 @@ vars: - itential_http_user - itential_user - - ansible_user - - iap_username - - iap_user + - platform_username + - platform_user password: description: @@ -52,38 +50,37 @@ vars: - itential_http_password - itential_password - - ansible_password - - iap_password - - iap_pass + - platform_password + - platform_pass - iap_auth_token: + platform_auth_token: description: - - The authentication token to use for IAP requests (optional) + - The authentication token to use for Itential Platform requests (optional) type: str vars: - - iap_auth_token + - platform_auth_token use_tls: description: - Enable or disable the use of TLS for the connection type: bool - default: true + default: false vars: - - itential_http_use_tls + - platform_https headers: description: - The set of key/value pairs to include in the header on every request type: dict vars: - - intential_http_headers + - platform_http_headers base_path: description: - The API base path to prepend for every request type: str vars: - - itential_http_base_path + - platform_http_base_path auth_type: description: @@ -91,7 +88,7 @@ type: str choices: [ "basic", "token" ] vars: - - itential_http_auth_type + - platform_http_auth_type verify: description: @@ -99,7 +96,7 @@ type: bool default: true vars: - - itential_http_verify + - platform_http_verify disable_warnings: description: @@ -107,5 +104,5 @@ type: bool default: false vars: - - itential_http_disable_warnings + - platform_http_disable_warnings """ diff --git a/plugins/module_utils/login.py b/plugins/module_utils/login.py index 81e1864..fecce08 100644 --- a/plugins/module_utils/login.py +++ b/plugins/module_utils/login.py @@ -3,15 +3,23 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -import json - -from functools import partial +# This module provides a function to authenticate with the Itential Platform API. +# It handles: +# - Constructing a login request with the proper URL, headers, and JSON-encoded credentials. +# - Validating required properties (username and password) before sending the request. +# - Sending a POST request to the Itential Platform's `/login` endpoint using TLS or non-TLS +# based on the host object. +# - Handling exceptions, including missing credentials, connection issues, and unexpected +# HTTP responses. +# - Returning the authentication token or response text if the login is successful. +# - Logging request details (URL and payload type) for debugging purposes. +# +# The function `login()` is used by Ansible modules and utilities to retrieve authentication +# tokens for subsequent API requests. +import json from ansible.errors import AnsibleError - from ansible_collections.itential.core.plugins.module_utils import display -from ansible_collections.itential.core.plugins.module_utils import hosts - from ansible_collections.itential.core.plugins.module_utils import http def login(host): @@ -32,6 +40,7 @@ def login(host): url = http.make_url(host.host, "/login", port=host.port, use_tls=host.use_tls) data = json.dumps({"user": user}).encode("utf-8") + display.v(f"Request URL: {url}") display.v(type(data)) try: diff --git a/plugins/module_utils/request.py b/plugins/module_utils/request.py index 50178da..aaf8845 100644 --- a/plugins/module_utils/request.py +++ b/plugins/module_utils/request.py @@ -3,15 +3,16 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -# This module provides a function to send authenticated API requests to the Itential Automation Platform (IAP). +# This module provides a function to send authenticated API requests to the Itential Platform. # It handles: # - Constructing the API request with proper authentication. # - Validating request parameters such as HTTP method, JSON data, and URL format. -# - Sending the request and handling various exceptions, including connection errors, timeouts, and HTTP failures. +# - Sending the request and handling various exceptions, including connection errors, timeouts, and +# HTTP failures. # - Processing the API response, ensuring it contains valid JSON when applicable. # - Logging request and response details for debugging. # -# The function `make_request()` is used by Ansible modules to interact with IAP. +# The function `make_request()` is used by Ansible modules to interact with Itential Platform. import json import time @@ -64,15 +65,15 @@ def make_request(task_vars, method, endpoint, params=None, data=None): if not re.match(r"^https?://[^\s/$.?#].[^\s]*$", url): raise AnsibleError(f"Malformed URL: {url}") - # Check if iap_auth_token is provided in task vars - auth_token = hostvars.get("iap_auth_token") + # Check if platform_auth_token is provided in task vars + auth_token = hostvars.get("platform_auth_token") # If auth_token is already provided, add it to params. Otherwise, call the login function if auth_token: - display.vvv("Using Provided IAP Auth Token") + display.vvv("Using Provided Itential Platform Auth Token") params["token"] = auth_token else: - display.vvv("Generating new IAP Auth Token") + display.vvv("Generating new Itential Platform Auth Token") params["token"] = login(host) display.vvv( diff --git a/plugins/modules/activate_job_worker.py b/plugins/modules/activate_job_worker.py index 26fe832..6582dc4 100644 --- a/plugins/modules/activate_job_worker.py +++ b/plugins/modules/activate_job_worker.py @@ -13,15 +13,15 @@ module: itential.platform.activate_job_worker author: Itential -short_description: Activate the job worker for an IAP system +short_description: Activate the job worker for an Itential Platform system description: - The M(itential.platform.activate_job_worker) module activates a - job worker for an IAP system. + job worker for an Itential Platform system. """ EXAMPLES = """ - - name: activate iap job worker + - name: activate platform job worker itential.platform.activate_job_worker: """ diff --git a/plugins/modules/activate_task_worker.py b/plugins/modules/activate_task_worker.py index ad3483d..6793f25 100644 --- a/plugins/modules/activate_task_worker.py +++ b/plugins/modules/activate_task_worker.py @@ -13,15 +13,15 @@ module: itential.platform.activate_task_worker author: Itential -short_description: Activate the task worker for an IAP system +short_description: Activate the task worker for an Itential Platform system description: - The M(itential.platform.activate_task_worker) module activates a - task worker for an IAP system. + task worker for an Itential Platform system. """ EXAMPLES = """ - - name: activate iap task worker + - name: activate platform task worker itential.platform.activate_task_worker: """ diff --git a/plugins/modules/auth_token.py b/plugins/modules/auth_token.py index d0748ea..d02a79a 100644 --- a/plugins/modules/auth_token.py +++ b/plugins/modules/auth_token.py @@ -13,10 +13,11 @@ module: itential.platform.auth_token author: Itential -short_description: Generate an authentication token for IAP. +short_description: Generate an authentication token for Itential Platform. description: - - The M(itential.platform.auth_token) module generates an authentication token for an IAP system. + - The M(itential.platform.auth_token) module generates an authentication token for an + Itential Platform system. - This token can be used to authenticate API requests within the platform. - The module does not require any input parameters. diff --git a/plugins/modules/deactivate_job_worker.py b/plugins/modules/deactivate_job_worker.py index 259996a..c7d15bd 100644 --- a/plugins/modules/deactivate_job_worker.py +++ b/plugins/modules/deactivate_job_worker.py @@ -13,15 +13,15 @@ module: itential.platform.deactivate_job_worker author: Itential -short_description: deactivate the job worker for an IAP system +short_description: deactivate the job worker for an Itential Platform system description: - The M(itential.platform.deactivate_job_worker) module deactivates a - job worker for an IAP system. + job worker for an Itential Platform system. """ EXAMPLES = """ - - name: deactivate iap job worker + - name: deactivate platform job worker itential.platform.deactivate_job_worker: """ diff --git a/plugins/modules/deactivate_task_worker.py b/plugins/modules/deactivate_task_worker.py index a210b08..e0d17e4 100644 --- a/plugins/modules/deactivate_task_worker.py +++ b/plugins/modules/deactivate_task_worker.py @@ -13,15 +13,15 @@ module: itential.platform.deactivate_task_worker author: Itential -short_description: deactivate the task worker for an IAP system +short_description: deactivate the task worker for an Itential Platform system description: - The M(itential.platform.deactivate_task_worker) module deactivates a - task worker for an IAP system. + task worker for an Itential Platform system. """ EXAMPLES = """ - - name: deactivate iap task worker + - name: deactivate platform task worker itential.platform.deactivate_task_worker: """ diff --git a/plugins/modules/generic_request.py b/plugins/modules/generic_request.py index fd16a8b..43ee007 100644 --- a/plugins/modules/generic_request.py +++ b/plugins/modules/generic_request.py @@ -13,12 +13,14 @@ module: itential.platform.api_request author: Itential -short_description: Send a generic API request to an IAP system. +short_description: Send a generic API request to an Itential Platform system. description: - - The M(itential.platform.api_request) module allows users to send generic API requests to an IAP system. + - The M(itential.platform.api_request) module allows users to send generic API requests to an + Itential Platform system. - It supports specifying the HTTP method, endpoint, query parameters, and request body data. - - This module is useful for interacting with various IAP API endpoints without creating dedicated modules. + - This module is useful for interacting with various Itential Platform API endpoints without + creating dedicated modules. options: method: diff --git a/plugins/modules/get_jobs.py b/plugins/modules/get_jobs.py index dbb0cdf..c0754d7 100644 --- a/plugins/modules/get_jobs.py +++ b/plugins/modules/get_jobs.py @@ -13,10 +13,11 @@ module: itential.platform.get_jobs author: Itential -short_description: Retrieve a list of jobs from an IAP system with optional filtering. +short_description: Retrieve a list of jobs from an Itential Platform system with optional filtering. description: - - The M(itential.platform.get_jobs) module retrieves a list of jobs from an IAP system. + - The M(itential.platform.get_jobs) module retrieves a list of jobs from an + Itential Platform system. - Users can provide key-value pairs as arguments to filter the results based on job attributes. - Filters are dynamically converted to query parameters, allowing for flexible job retrieval. - The response includes the job name and status by default. diff --git a/plugins/modules/get_system_health.py b/plugins/modules/get_system_health.py index 7dce623..c479772 100644 --- a/plugins/modules/get_system_health.py +++ b/plugins/modules/get_system_health.py @@ -10,18 +10,18 @@ DOCUMENTATION = """ --- -module: itential.iap.get_system_health +module: itential.platform.get_system_health author: Itential -short_description: Get the health of an IAP system +short_description: Get the health of an Itential Platform system description: - - The M(itential.iap.get_system_health) module returns the health of the - IAP system. + - The M(itential.platform.get_system_health) module returns the health of the + Itential Platform system. """ EXAMPLES = """ - name: get the health of a system - itential.iap.get_system_health: + itential.platform.get_system_health: """ diff --git a/plugins/modules/get_tasks.py b/plugins/modules/get_tasks.py index 287dc06..56a3073 100644 --- a/plugins/modules/get_tasks.py +++ b/plugins/modules/get_tasks.py @@ -13,10 +13,12 @@ module: itential.platform.get_tasks author: Itential -short_description: Retrieve a list of tasks from an IAP system with optional filtering. +short_description: Retrieve a list of tasks from an Itential Platform system with +optional filtering. description: - - The M(itential.platform.get_tasks) module retrieves a list of tasks from an IAP system. + - The M(itential.platform.get_tasks) module retrieves a list of tasks from an + Itential Platform system. - Users can provide key-value pairs as arguments to filter the results based on task attributes. - Filters are dynamically converted to query parameters, allowing for flexible task retrieval. - The response includes the task name and status by default. diff --git a/plugins/modules/get_worker_status.py b/plugins/modules/get_worker_status.py index 8b08b52..cfcb15f 100644 --- a/plugins/modules/get_worker_status.py +++ b/plugins/modules/get_worker_status.py @@ -13,11 +13,11 @@ module: itential.platform.get_worker_status author: Itential -short_description: Get the worker status from an IAP system +short_description: Get the worker status from an Itential Platform system description: - The M(itential.platform.get_worker_status) module returns the status of job - and task workers from an IAP system. + and task workers from an Itential Platform system. """ diff --git a/plugins/modules/restart_adapters.py b/plugins/modules/restart_adapters.py index 0a23654..7d0f3c9 100644 --- a/plugins/modules/restart_adapters.py +++ b/plugins/modules/restart_adapters.py @@ -13,13 +13,14 @@ module: itential.platform.restart_adapters author: Itential -short_description: Restart one or more adapters in the IAP system. +short_description: Restart one or more adapters in the Itential Platform system. description: - The M(itential.platform.restart_adapters) module restarts one or more adapters in the - IAP system using the names provided via the C(adapter_names) argument. - - This module communicates with the IAP API to perform the restart operation. - - The C(adapter_names) parameter supports both a single adapter name (as a string) and multiple adapter names (as a list). + Itential Platform system using the names provided via the C(adapter_names) argument. + - This module communicates with the Itential Platform API to perform the restart operation. + - The C(adapter_names) parameter supports both a single adapter name (as a string) and + multiple adapter names (as a list). options: adapter_names: diff --git a/plugins/modules/restart_applications.py b/plugins/modules/restart_applications.py index 0399905..66ff0e3 100644 --- a/plugins/modules/restart_applications.py +++ b/plugins/modules/restart_applications.py @@ -13,13 +13,14 @@ module: itential.platform.restart_applications author: Itential -short_description: Restart one or more applications in the IAP system. +short_description: Restart one or more applications in the Itential Platform system. description: - The M(itential.platform.restart_applications) module restarts one or more applications in the - IAP system using the names provided via the C(application_names) argument. - - This module communicates with the IAP API to perform the restart operation. - - The C(application_names) parameter supports both a single application name (as a string) and multiple application names (as a list). + Itential Platform system using the names provided via the C(application_names) argument. + - This module communicates with the Itential Platform API to perform the restart operation. + - The C(application_names) parameter supports both a single application name (as a string) and + multiple application names (as a list). options: application_names: @@ -33,19 +34,19 @@ EXAMPLES = """ - name: Restart a single application (string input) itential.platform.restart_applications: - application_names: iap-core + application_names: OperationsManager delegate_to: localhost - name: Restart a single application (list input) itential.platform.restart_applications: application_names: - - iap-core + - OperationsManager delegate_to: localhost - name: Restart multiple applications itential.platform.restart_applications: application_names: - - iap-core + - OperationsManager - ag-manager delegate_to: localhost """ diff --git a/tests/unit/test_request.py b/tests/unit/test_request.py index 6673949..d3b511a 100644 --- a/tests/unit/test_request.py +++ b/tests/unit/test_request.py @@ -67,7 +67,7 @@ def test_make_request_with_manual_token(mock_login, mock_http_request, mock_task manual_token = "manual-token" # Add the manual token to the existing mock_task_vars - mock_task_vars["hostvars"]["platform"]["iap_auth_token"] = manual_token + mock_task_vars["hostvars"]["platform"]["platform_auth_token"] = manual_token # Mock HTTP response api_response = MagicMock(status_code=200, text=json.dumps({"key": "value"}))