From 78bf8a427f9e8cdabb5f63d7f23918655c505f1d Mon Sep 17 00:00:00 2001 From: Romi Asad <54517168+Romi1495@users.noreply.github.com> Date: Mon, 16 Nov 2026 10:11:15 -0600 Subject: [PATCH] chore: address partner engineering feedback (ACA-7227) (#1284) * chore: address partner engineering feedback Assisted-by: Codex GPT-6 * Updating CHANGELOG link (cherry picked from commit 536eded7d0b70c32d4706d38c58646b4f79c5049) --- .ansible-lint | 3 +++ .ansible-lint-ignore | 4 ---- README.md | 10 ++++++++-- plugins/connection/kubectl.py | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 4c3b7f0f..4b0108a3 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,6 +1,9 @@ --- profile: production +warn_list: + - no-log-password + exclude_paths: - .ansible/ - .github/ diff --git a/.ansible-lint-ignore b/.ansible-lint-ignore index 09bcf301..e0755ea3 100644 --- a/.ansible-lint-ignore +++ b/.ansible-lint-ignore @@ -1,8 +1,4 @@ # https://docs.ansible.com/ansible-lint/docs/rules/ -# no-changed-when is not requried for examples -plugins/connection/kubectl.py no-changed-when -# false positive result -plugins/connection/kubectl.py var-naming[no-reserved] plugins/connection/kubectl.py jinja[invalid] # collection EE metadata is not an ansible-builder definition file meta/execution-environment.yml schema[execution-environment] diff --git a/README.md b/README.md index cef74464..257ca99b 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,8 @@ Before using the Kubernetes collection, you need to install it with the Ansible ansible-galaxy collection install kubernetes.core +Red Hat customers can install certified content from [Ansible Automation Hub](https://console.redhat.com/ansible/automation-hub). Configure Automation Hub as the primary content source for the Ansible Galaxy CLI by following the [Red Hat configuration guide](https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.4/html/getting_started_with_automation_hub/configure-hub-primary), then install the collection with `ansible-galaxy collection install kubernetes.core`. + You can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml`, using the format: ```yaml @@ -105,12 +107,14 @@ collections: ### Installing the Kubernetes Python Library -Content in this collection requires the [Kubernetes Python client](https://pypi.org/project/kubernetes/) to interact with Kubernetes' APIs. You can install it with: +Content in this collection requires the [Kubernetes Python client](https://pypi.org/project/kubernetes/) to interact with Kubernetes' APIs. For installs outside an execution environment, install it with: ```bash pip3 install kubernetes ``` +Execution environments install this dependency when they are built with `ansible-builder`; you do not need to install it separately with `pip3` in that case. + ## Use Cases It's preferable to use content in this collection using their Fully Qualified Collection Namespace (FQCN), for example `kubernetes.core.k8s_info`: @@ -243,6 +247,8 @@ This project follows the [Ansible Code of Conduct](https://docs.ansible.com/ansi ## Support +This collection is maintained by Red Hat Ansible Cloud Content. + As Red Hat Ansible Certified Content, this collection is entitled to support through the Ansible Automation Platform (AAP) using the **Create issue** button on the top right corner. If a support case cannot be opened with Red Hat and the collection has been obtained either from Galaxy or GitHub, there may be community help available on the [Ansible Forum](https://forum.ansible.com/). > **Note:** The `stable-4` branch (all `4.x.y` releases) is no longer supported. No backports or releases are performed on `stable-4`. @@ -263,7 +269,7 @@ Releases are automatically built and pushed to Ansible Galaxy for any new tag. B 1. The `version` in `galaxy.yml` 2. This README's `requirements.yml` example 3. The `VERSION` in `Makefile` - 2. Update the CHANGELOG: + 2. Update the [CHANGELOG](CHANGELOG.rst): 1. Make sure you have [`antsibull-changelog`](https://pypi.org/project/antsibull-changelog/) installed. 2. Make sure there are fragments for all known changes in `changelogs/fragments`. 3. Run `antsibull-changelog release`. diff --git a/plugins/connection/kubectl.py b/plugins/connection/kubectl.py index e97c0ba9..8df33485 100644 --- a/plugins/connection/kubectl.py +++ b/plugins/connection/kubectl.py @@ -228,13 +228,13 @@ EXAMPLES = r""" gather_facts: no vars: kubeconfig: /root/.kube/config - namespace: my-namespace + k8s_namespace: my-namespace my_app: my-app tasks: - name: Get My App pod info based on label kubernetes.core.k8s_info: kubeconfig: "{{ kubeconfig }}" - namespace: "{{ namespace }}" + namespace: "{{ k8s_namespace }}" kind: Pod label_selectors: app.kubernetes.io/name = "{{ my_app }}" register: my_app_pod @@ -249,7 +249,7 @@ EXAMPLES = r""" ansible_connection: kubernetes.core.kubectl ansible_kubectl_kubeconfig: "{{ kubeconfig }}" ansible_kubectl_pod: "{{ my_app_pod_name }}" - ansible_kubectl_namespace: "{{ namespace }}" + ansible_kubectl_namespace: "{{ k8s_namespace }}" - name: Run a command in My App pod # be aware that the command is executed as the user that started the container