mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-11-21 22:50:20 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
747964cefe | ||
|
|
d7b53d0464 | ||
|
|
14712d57a7 | ||
|
|
51f0386633 | ||
|
|
8c0de50fb8 | ||
|
|
8ec2912419 | ||
|
|
c35fc5e10e | ||
|
|
66ec4758f0 | ||
|
|
feb44ae16a | ||
|
|
00dab977a5 | ||
|
|
983851296a | ||
|
|
d3e177d62c | ||
|
|
b5d5fa4d65 | ||
|
|
dad9a8457e | ||
|
|
1a0914352a | ||
|
|
efe2d1aa69 | ||
|
|
0cd0f3df9e | ||
|
|
d0daf56ea7 | ||
|
|
3967f5e2ca | ||
|
|
7150d04f01 | ||
|
|
00f3d12a1d | ||
|
|
33bb3b81ba | ||
|
|
e4b748a791 | ||
|
|
c76cc63a75 | ||
|
|
c9b918a453 | ||
|
|
d3e408556b | ||
|
|
16f4b49c43 | ||
|
|
178611ef5d | ||
|
|
2b52790a01 | ||
|
|
84cf83fe0f | ||
|
|
a2aa079829 | ||
|
|
ca050aa3f6 | ||
|
|
84249fc4f1 | ||
|
|
229575fe8f |
@@ -4,3 +4,5 @@ plugins/connection/kubectl.py no-changed-when
|
|||||||
# false positive result
|
# false positive result
|
||||||
plugins/connection/kubectl.py var-naming[no-reserved]
|
plugins/connection/kubectl.py var-naming[no-reserved]
|
||||||
plugins/connection/kubectl.py jinja[invalid]
|
plugins/connection/kubectl.py jinja[invalid]
|
||||||
|
# collection EE metadata is not an ansible-builder definition file
|
||||||
|
meta/execution-environment.yml schema[execution-environment]
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
---
|
||||||
|
name: all_green
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.head_ref || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on: # yamllint disable-line rule:truthy
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- synchronize
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- stable-*
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- stable-*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
security-check:
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
uses: ./.github/workflows/security-check.yaml
|
||||||
|
|
||||||
|
linters:
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
uses: ./.github/workflows/linters.yaml
|
||||||
|
|
||||||
|
sanity:
|
||||||
|
uses: ./.github/workflows/sanity-tests.yaml
|
||||||
|
|
||||||
|
units:
|
||||||
|
uses: ./.github/workflows/unit-tests.yaml
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
name: Unit test coverage
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: ansible_collections/kubernetes/core
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.12"
|
||||||
|
|
||||||
|
- name: Run unit tests with coverage
|
||||||
|
working-directory: ansible_collections/kubernetes/core
|
||||||
|
env:
|
||||||
|
PYTHONPATH: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install ansible-compat
|
||||||
|
python -m pip install https://github.com/ansible/ansible/archive/stable-2.19.tar.gz
|
||||||
|
# Same deps as the units matrix (build_install_collection); do not use
|
||||||
|
# tests/unit/requirements.txt — its kubernetes pin breaks test_core.py.
|
||||||
|
python -m pip install -r requirements.txt -r test-requirements.txt
|
||||||
|
python -m coverage run --source=plugins -m pytest tests/unit \
|
||||||
|
--ansible-host-pattern localhost
|
||||||
|
python -m coverage xml -o coverage.xml
|
||||||
|
|
||||||
|
- name: Upload coverage artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: coverage
|
||||||
|
path: ansible_collections/kubernetes/core/coverage.xml
|
||||||
|
|
||||||
|
all_green:
|
||||||
|
if: ${{ always() }}
|
||||||
|
needs:
|
||||||
|
- security-check
|
||||||
|
- linters
|
||||||
|
- sanity
|
||||||
|
- units
|
||||||
|
- coverage
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: |
|
||||||
|
python -c "
|
||||||
|
import sys
|
||||||
|
|
||||||
|
required = ['sanity', 'units', 'coverage']
|
||||||
|
if '${{ github.event_name }}' == 'pull_request':
|
||||||
|
required = ['security-check', 'linters', 'sanity', 'units', 'coverage']
|
||||||
|
results = {
|
||||||
|
'security-check': '${{ needs.security-check.result }}',
|
||||||
|
'linters': '${{ needs.linters.result }}',
|
||||||
|
'sanity': '${{ needs.sanity.result }}',
|
||||||
|
'units': '${{ needs.units.result }}',
|
||||||
|
'coverage': '${{ needs.coverage.result }}',
|
||||||
|
}
|
||||||
|
|
||||||
|
for name in required:
|
||||||
|
if results[name] == 'failure':
|
||||||
|
print(f'all_green: required job failed: {name} results={results}', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# cancel-in-progress superseded this run; do not fail (newer run is authoritative)
|
||||||
|
if any(v == 'cancelled' for v in results.values()):
|
||||||
|
print(
|
||||||
|
'all_green: one or more jobs cancelled (usually concurrency); skipping strict gate.',
|
||||||
|
results,
|
||||||
|
)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
not_ok = [j for j in required if results[j] != 'success']
|
||||||
|
if not_ok:
|
||||||
|
print(f'all_green: required jobs not success: {not_ok} results={results}', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
for job, status in results.items():
|
||||||
|
if job not in required and status not in ('success', 'skipped'):
|
||||||
|
print(f'all_green: unexpected {job}={status} results={results}', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
print('all_green OK', results)
|
||||||
|
"
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Run collection certification checks
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- stable-*
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: cert-ver-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
call:
|
||||||
|
uses: ansible-collections/partner-certification-checker/.github/workflows/certification-reusable.yml@f4bf7ba4d3f008b2db8fc6a812fa3f89fdf42c2e # v4.1.0
|
||||||
@@ -55,15 +55,29 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
ansible-version:
|
# Ref must match a branch/tag on github.com/ansible/ansible (e.g. stable-2.18, not 2.18).
|
||||||
- milestone
|
#
|
||||||
python-version:
|
ansible-version: ["stable-2.18", "stable-2.21", "milestone"]
|
||||||
- "3.12"
|
enable-turbo-mode: [true, false]
|
||||||
enable-turbo-mode:
|
python-version: ["3.12", "3.13"]
|
||||||
- true
|
exclude:
|
||||||
- false
|
# stable-2.18 is used mainly because turbo mode, no reason to test it with turbo mode disabled
|
||||||
|
- ansible-version: "stable-2.18"
|
||||||
|
enable-turbo-mode: false
|
||||||
|
# turbo mode is supported only by ansible<2.19
|
||||||
|
- ansible-version: "milestone"
|
||||||
|
enable-turbo-mode: true
|
||||||
|
- ansible-version: "stable-2.21"
|
||||||
|
enable-turbo-mode: true
|
||||||
|
# stable-2.18 supports 3.12
|
||||||
|
- ansible-version: "stable-2.18"
|
||||||
|
python-version: "3.13"
|
||||||
|
- ansible-version: "stable-2.21"
|
||||||
|
python-version: "3.12"
|
||||||
|
- ansible-version: "milestone"
|
||||||
|
python-version: "3.12"
|
||||||
workflow-id: ${{ fromJson(needs.splitter.outputs.test_jobs) }}
|
workflow-id: ${{ fromJson(needs.splitter.outputs.test_jobs) }}
|
||||||
name: "integration-py${{ matrix.python-version }}-${{ matrix.ansible-version }}-${{ matrix.workflow-id }}-enable_turbo=${{ matrix.enable-turbo-mode }}"
|
name: Integration tests
|
||||||
steps:
|
steps:
|
||||||
- name: Read target
|
- name: Read target
|
||||||
id: read-targets
|
id: read-targets
|
||||||
@@ -107,6 +121,7 @@ jobs:
|
|||||||
source_path: ${{ env.source }}
|
source_path: ${{ env.source }}
|
||||||
|
|
||||||
- name: checkout ansible-collections/cloud.common
|
- name: checkout ansible-collections/cloud.common
|
||||||
|
if: ${{ matrix.enable-turbo-mode == true }}
|
||||||
uses: ansible-network/github_actions/.github/actions/checkout_dependency@main
|
uses: ansible-network/github_actions/.github/actions/checkout_dependency@main
|
||||||
with:
|
with:
|
||||||
repository: ansible-collections/cloud.common
|
repository: ansible-collections/cloud.common
|
||||||
@@ -128,6 +143,7 @@ jobs:
|
|||||||
ref: main
|
ref: main
|
||||||
|
|
||||||
- name: install cloud.common collection
|
- name: install cloud.common collection
|
||||||
|
if: ${{ matrix.enable-turbo-mode == true }}
|
||||||
uses: ansible-network/github_actions/.github/actions/build_install_collection@main
|
uses: ansible-network/github_actions/.github/actions/build_install_collection@main
|
||||||
with:
|
with:
|
||||||
install_python_dependencies: true
|
install_python_dependencies: true
|
||||||
|
|||||||
@@ -1,16 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: Linters
|
name: Linters
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
on:
|
on: [workflow_call]
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- stable-*
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linters:
|
linters:
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: Sanity tests
|
name: Sanity tests
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
on:
|
on: [workflow_call]
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- stable-*
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sanity:
|
sanity:
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
name: Security Check
|
||||||
|
|
||||||
|
on: [workflow_call]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
security-check:
|
||||||
|
name: Block unsafe directories
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Check for blocked directories
|
||||||
|
uses: ansible/cloud-content-ci-automation/.github/actions/security_check_directories@74b5fe870e1d5346c5fcea332b97a6fb26f1ad8a
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
## SonarCloud Analysis Workflow for kubernetes.core
|
||||||
|
#
|
||||||
|
# This workflow runs SonarCloud analysis triggered by all_green workflow completion.
|
||||||
|
#
|
||||||
|
# FLOW: all_green completes (linters, ansible-test, coverage) → workflow_run triggers this workflow → finalize job runs
|
||||||
|
#
|
||||||
|
# - Triggered by: workflow_run (all_green on pull_request or push to main/stable-*)
|
||||||
|
# - Steps: Checkout → Download coverage from all_green run → Get PR info (if PR) → Run SonarCloud scan
|
||||||
|
# - Coverage: Unit test coverage is produced by the coverage job in all_green and passed to SonarCloud here.
|
||||||
|
|
||||||
|
---
|
||||||
|
name: SonarCloud
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows:
|
||||||
|
- all_green
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
|
actions: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
finalize:
|
||||||
|
name: finalize
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event.workflow_run.conclusion == 'success'
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.workflow_run.head_sha }}
|
||||||
|
fetch-depth: 0
|
||||||
|
show-progress: false
|
||||||
|
|
||||||
|
- name: Download coverage artifacts
|
||||||
|
uses: dawidd6/action-download-artifact@2536c51d3d126276eb39f74d6bc9c72ac6ef30d3 # v16
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
workflow: all_green
|
||||||
|
run_id: ${{ github.event.workflow_run.id }}
|
||||||
|
pattern: coverage*
|
||||||
|
|
||||||
|
- name: Set coverage report paths
|
||||||
|
run: |
|
||||||
|
coverage_files=$(find . -name "coverage*.xml" -type f 2>/dev/null | tr '\n' ',' | sed 's/,$//')
|
||||||
|
echo "Found coverage files: ${coverage_files:-none}"
|
||||||
|
echo "COVERAGE_PATHS=${coverage_files}" >> "${GITHUB_ENV}"
|
||||||
|
|
||||||
|
- name: Get PR number and info
|
||||||
|
if: github.event.workflow_run.event == 'pull_request'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
PR_NUMBER=$(gh pr list --head "$HEAD_BRANCH" --repo "$REPO" --json number -q '.[0].number')
|
||||||
|
echo "PR_NUMBER=${PR_NUMBER}" >> "${GITHUB_ENV}"
|
||||||
|
if [ -n "${PR_NUMBER}" ]; then
|
||||||
|
PR_DATA=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}")
|
||||||
|
echo "PR_BASE=$(echo "${PR_DATA}" | jq -r '.base.ref')" >> "${GITHUB_ENV}"
|
||||||
|
echo "PR_HEAD=$(echo "${PR_DATA}" | jq -r '.head.ref')" >> "${GITHUB_ENV}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Prepare SonarCloud args
|
||||||
|
env:
|
||||||
|
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
|
||||||
|
EVENT_TYPE: ${{ github.event.workflow_run.event }}
|
||||||
|
run: |
|
||||||
|
SONAR_ARGS="-Dsonar.scm.revision=\"${COMMIT_SHA}\""
|
||||||
|
if [[ "${EVENT_TYPE}" == "pull_request" && -n "${PR_NUMBER:-}" ]]; then
|
||||||
|
SONAR_ARGS="${SONAR_ARGS} -Dsonar.pullrequest.key=${PR_NUMBER}"
|
||||||
|
SONAR_ARGS="${SONAR_ARGS} -Dsonar.pullrequest.branch=${PR_HEAD}"
|
||||||
|
SONAR_ARGS="${SONAR_ARGS} -Dsonar.pullrequest.base=${PR_BASE}"
|
||||||
|
fi
|
||||||
|
if [[ -n "${COVERAGE_PATHS:-}" ]]; then
|
||||||
|
SONAR_ARGS="${SONAR_ARGS} -Dsonar.python.coverage.reportPaths=${COVERAGE_PATHS}"
|
||||||
|
fi
|
||||||
|
echo "SONAR_ARGS=${SONAR_ARGS}" >> "${GITHUB_ENV}"
|
||||||
|
|
||||||
|
- name: SonarCloud Scan
|
||||||
|
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7
|
||||||
|
env:
|
||||||
|
SONAR_TOKEN: ${{ secrets.ANSIBLE_COLLECTIONS_ORG_SONAR_TOKEN_CICD_BOT }}
|
||||||
|
with:
|
||||||
|
args: ${{ env.SONAR_ARGS }}
|
||||||
@@ -1,13 +1,6 @@
|
|||||||
name: Unit tests
|
name: Unit tests
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
on:
|
on: [workflow_call]
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- stable-*
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-source:
|
unit-source:
|
||||||
|
|||||||
+5
-1
@@ -22,5 +22,9 @@ tests/integration/*-chart-*.tgz
|
|||||||
tests/integration/inventory
|
tests/integration/inventory
|
||||||
tests/integration/*-*.yml
|
tests/integration/*-*.yml
|
||||||
|
|
||||||
# VS Code settings
|
# IDE and editor settings
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.claude/
|
||||||
|
|
||||||
|
# Root coverage report for SonarCloud (generated locally or in CI)
|
||||||
|
/coverage.xml
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/ansible/cloud-content-ci-automation
|
||||||
|
rev: precommit_hook
|
||||||
|
hooks:
|
||||||
|
- id: block-ide-ai-files
|
||||||
|
always_run: true
|
||||||
+67
-7
@@ -4,19 +4,79 @@ Kubernetes Collection Release Notes
|
|||||||
|
|
||||||
.. contents:: Topics
|
.. contents:: Topics
|
||||||
|
|
||||||
|
v5.5.0
|
||||||
|
======
|
||||||
|
|
||||||
|
Release Summary
|
||||||
|
---------------
|
||||||
|
|
||||||
|
This minor release deprecates Ansible Turbo mode (``ENABLE_TURBO_MODE``), the ``status.values`` return value of the ``helm`` and ``helm_info`` modules, the ``wait_timeout`` parameter of the ``helm`` module, the ``return_code`` return value of the ``k8s_exec`` module, and the ``merge_type=json`` option of the ``k8s_service`` module. It also includes bugfixes for ``helm_repository`` URL comparison and for empty template output handling in ``k8s_info``.
|
||||||
|
|
||||||
|
Minor Changes
|
||||||
|
-------------
|
||||||
|
|
||||||
|
- Remove the remaining ``ansible.module_utils.six`` import to avoid deprecation warnings, replacing it with the Python standard library equivalent (https://github.com/ansible-collections/kubernetes.core/pull/1197).
|
||||||
|
- k8s lookup - warn when ``ENABLE_TURBO_MODE`` is set but the ``cloud.common`` collection is not installed, instead of silently falling back to the standard lookup base (https://github.com/ansible-collections/kubernetes.core/pull/1242).
|
||||||
|
|
||||||
|
Deprecated Features
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
- Ansible Turbo mode (``ENABLE_TURBO_MODE``) has been deprecated and will be removed in release 8.0.0, as it depends on the ``cloud.common`` collection, which is being retired (https://github.com/ansible-collections/kubernetes.core/pull/1242).
|
||||||
|
- helm - the ``status.values`` return value has been deprecated and will be removed in version 8.0.0. Use ``status.release_values`` instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
- helm - the ``wait_timeout`` parameter has been deprecated and will be removed in version 7.0.0. Use ``timeout`` instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
- helm_info - the ``status.values`` return value has been deprecated and will be removed in version 8.0.0. Use ``status.release_values`` instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
- k8s_exec - the ``return_code`` return value has been deprecated and will be removed in version 7.0.0. Use ``rc`` instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
- k8s_service - the ``merge_type=json`` option has been deprecated and will be removed in version 7.0.0. Use ``kubernetes.core.k8s_json_patch`` module instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Ansible Turbo mode - ignore ``ENABLE_TURBO_MODE`` on ansible-core 2.19.0 and later, where the ``cloud.common`` collection is not supported, and fall back to the standard ``AnsibleModule`` instead of failing with ``byte indices must be integers or slices, not str`` (https://github.com/ansible-collections/kubernetes.core/pull/1242).
|
||||||
|
- helm_repository - normalize both sides of the repository URL comparison, so that a repository already registered with a trailing slash is recognized as matching instead of failing with ``Repository already have a repository named <name>`` (https://github.com/ansible-collections/kubernetes.core/pull/1236).
|
||||||
|
- k8s lookup - ignore ``ENABLE_TURBO_MODE`` on ansible-core 2.19.0 and later, where the ``cloud.common`` collection is not supported. Fall back to the standard ``LookupBase`` instead of failing with a traceback (https://github.com/ansible-collections/kubernetes.core/pull/1253).
|
||||||
|
- k8s_info - Handle empty template output gracefully by returning ``changed=false`` instead of failing when Jinja2 template renders to an empty string (https://github.com/ansible-collections/kubernetes.core/issues/1042).
|
||||||
|
|
||||||
|
v5.4.4
|
||||||
|
======
|
||||||
|
|
||||||
|
Release Summary
|
||||||
|
---------------
|
||||||
|
|
||||||
|
This release corrects the documented and enforced minimum ``ansible-core`` version to ``>=2.16.0``.
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
--------
|
||||||
|
|
||||||
|
- meta - Update ``requires_ansible`` in ``runtime.yml`` and README to ``>=2.16.0`` to match the actual minimum supported ``ansible-core`` version (https://github.com/ansible-collections/kubernetes.core/pull/1193).
|
||||||
|
|
||||||
|
v5.4.3
|
||||||
|
======
|
||||||
|
|
||||||
|
Release Summary
|
||||||
|
---------------
|
||||||
|
|
||||||
|
This release contains bugfixes such as improved idempotency for helm repository URLs with trailing slashes.
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
--------
|
||||||
|
|
||||||
|
- ee - Add ``meta/execution-environment.yml`` to decouple ansible-builder EE builds from the ``openshift-clients`` system dependency declared in ``bindep.txt``, which is not available in standard UBI repositories and caused builds to fail with ``No package matches 'openshift-clients'`` (https://github.com/ansible-collections/kubernetes.core/issues/1141).
|
||||||
|
- helm_repository - Correct handling of repository URLs with trailing slashes (https://github.com/ansible-collections/kubernetes.core/pull/1121).
|
||||||
|
- k8s_drain - Fix logic for handling pods with local storage to correctly check for empty_dir volumes in replicated pods and pods managed by DaemonSets (https://github.com/ansible-collections/kubernetes.core/pull/1095).
|
||||||
|
|
||||||
v5.4.2
|
v5.4.2
|
||||||
======
|
======
|
||||||
|
|
||||||
Release Summary
|
Release Summary
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
This release includes bugfixes such as replacing the passing of ``warnings`` to ``exit_json`` with ``AnsibleModule.warn`` as well as a security update for selectively redacting sensitive information from kubeconfig.
|
This release includes bugfixes such as replacing the passing of ``warnings`` to ``exit_json`` with ``AnsibleModule.warn`` as well as a security update for selectively redacting sensitive information from kubeconfig, and adds a new ``release_values`` key to the ``status`` return value.
|
||||||
|
|
||||||
Minor Changes
|
Minor Changes
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
- helm - add ``release_values`` key to ``status`` return value that can be accessed using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
- helm - Add ``release_values`` key to ``status`` return value that can be accessed using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
- helm_info - add ``release_values`` key to ``status`` return value that can be accessed using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
- helm_info - Add ``release_values`` key to ``status`` return value that can be accessed using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
|
|
||||||
Deprecated Features
|
Deprecated Features
|
||||||
-------------------
|
-------------------
|
||||||
@@ -65,7 +125,7 @@ This release updates the ``helm_registry_auth`` module to match the behavior of
|
|||||||
Minor Changes
|
Minor Changes
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
- Module ``helm_registry_auth`` does not support idempotency with ``helm >= 3.18.0`` (https://github.com/ansible-collections/kubernetes.core/pull/946)
|
- Module ``helm_registry_auth`` does not support idempotency with ``helm >= 3.18.0`` (https://github.com/ansible-collections/kubernetes.core/pull/946).
|
||||||
|
|
||||||
v5.3.0
|
v5.3.0
|
||||||
======
|
======
|
||||||
@@ -78,15 +138,15 @@ This release includes minor changes, bug fixes and also bumps ``ansible-lint`` v
|
|||||||
Minor Changes
|
Minor Changes
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
- Bump version of ``ansible-lint`` to 25.1.2 (https://github.com/ansible-collections/kubernetes.core/pull/919).
|
|
||||||
- action/k8s_info - update templating mechanism with changes from ``ansible-core 2.19`` (https://github.com/ansible-collections/kubernetes.core/pull/888).
|
- action/k8s_info - update templating mechanism with changes from ``ansible-core 2.19`` (https://github.com/ansible-collections/kubernetes.core/pull/888).
|
||||||
- helm - add ``reset_then_reuse_values`` support to helm module (https://github.com/ansible-collections/kubernetes.core/issues/803).
|
- helm - add ``reset_then_reuse_values`` support to helm module (https://github.com/ansible-collections/kubernetes.core/issues/803).
|
||||||
- helm - add support for ``insecure_skip_tls_verify`` option to helm and helm_repository(https://github.com/ansible-collections/kubernetes.core/issues/694).
|
- helm - add support for ``insecure_skip_tls_verify`` option to helm and ``helm_repository`` (https://github.com/ansible-collections/kubernetes.core/issues/694).
|
||||||
|
- kubernetes.core - Bump version of ``ansible-lint`` to ``25.1.2`` (https://github.com/ansible-collections/kubernetes.core/pull/919).
|
||||||
|
|
||||||
Bugfixes
|
Bugfixes
|
||||||
--------
|
--------
|
||||||
|
|
||||||
- module_utils/k8s/service - fix issue when trying to delete resource using ``delete_options`` and ``check_mode=true`` (https://github.com/ansible-collections/kubernetes.core/issues/892).
|
- module_utils/k8s/service - fix issue when trying to delete resource using `delete_options` and `check_mode=true` (https://github.com/ansible-collections/kubernetes.core/issues/892).
|
||||||
|
|
||||||
v5.2.0
|
v5.2.0
|
||||||
======
|
======
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# Continuous Integration (CI)
|
||||||
|
|
||||||
|
## Kubernetes Upstream Testing
|
||||||
|
|
||||||
|
GitHub Actions are used to run the CI for the kubernetes.core collection. The workflows used for the CI can be found in the [.github/workflows](.github/workflows) directory.
|
||||||
|
|
||||||
|
### PR Testing Workflows
|
||||||
|
|
||||||
|
The following tests run on every pull request:
|
||||||
|
|
||||||
|
| Job | Description | Python Versions | ansible-core Versions |
|
||||||
|
| --- | ----------- | --------------- | --------------------- |
|
||||||
|
| [Changelog](.github/workflows/changelog.yaml) | Checks for the presence of changelog fragments | 3.12 | devel |
|
||||||
|
| [Linters](.github/workflows/linters.yaml) | Runs `black`, `flake8`, `isort`, `yamllint`, and `ansible-lint` on plugins and tests | 3.10 | devel |
|
||||||
|
| [Sanity](.github/workflows/sanity-tests.yaml) | Runs ansible sanity checks | See compatibility table below | devel, stable-2.18, stable-2.19, stable-2.20 |
|
||||||
|
| [Unit tests](.github/workflows/unit-tests.yaml) | Executes unit test cases | See compatibility table below | devel, stable-2.16, stable-2.17, stable-2.18, stable-2.19, stable-2.20 |
|
||||||
|
| [Integration](.github/workflows/integration-tests.yaml) | Executes integration test suites using KinD cluster (split across 8 jobs, tests with Turbo mode enabled/disabled) | 3.12 (stable-2.18), 3.13 (milestone) | stable-2.18, milestone |
|
||||||
|
| [all_green](.github/workflows/all_green_check.yaml) | Linters (PR only), sanity, units, coverage XML, aggregate gate, and SonarCloud scan (same-repo PR / push only) | (see jobs) | (see jobs) |
|
||||||
|
|
||||||
|
**Note:** Integration tests require a KinD (Kubernetes in Docker) cluster and test both with Turbo mode enabled and disabled.
|
||||||
|
|
||||||
|
### Python Version Compatibility by ansible-core Version
|
||||||
|
|
||||||
|
These are outlined in the collection's [tox.ini](tox.ini) file (`envlist`) and GitHub Actions workflow exclusions.
|
||||||
|
|
||||||
|
| ansible-core Version | Sanity Tests | Unit Tests | Integration Tests |
|
||||||
|
| -------------------- | ------------ | ---------- | ----------------- |
|
||||||
|
| devel | 3.12, 3.13, 3.14 | 3.13 | 3.13 (milestone) |
|
||||||
|
| stable-2.20 | 3.12, 3.13, 3.14 | 3.12, 3.13, 3.14 | — |
|
||||||
|
| stable-2.19 | 3.11, 3.12, 3.13 | 3.11, 3.12, 3.13 | — |
|
||||||
|
| stable-2.18 | 3.11, 3.12, 3.13 | 3.11, 3.12, 3.13 | 3.12 |
|
||||||
|
| stable-2.17 | 3.10, 3.11, 3.12 | 3.10, 3.11, 3.12 | — |
|
||||||
|
| stable-2.16 | 3.10, 3.11 | 3.10, 3.11 | — |
|
||||||
|
|
||||||
|
## SonarCloud
|
||||||
|
|
||||||
|
SonarCloud analysis runs from **[`all_green_check.yaml`](.github/workflows/all_green_check.yaml)** via the **`sonarcloud`** job, which calls **[`sonarcloud.yml`](.github/workflows/sonarcloud.yml)** (**`workflow_call`**) after the **`all_green`** gate and **coverage** succeed. The reusable workflow checks out the PR head or push SHA, downloads the **`coverage`** artifact, and runs the pinned **SonarSource** scan action. Same-repo **`pull_request`** and **`push`** only (fork PRs are excluded by the job **`if:`** gate). Details: [SONARCLOUD.md](SONARCLOUD.md).
|
||||||
@@ -66,6 +66,20 @@ After installation, you can update documentation
|
|||||||
|
|
||||||
Review the changes and create a pull request using updated files.
|
Review the changes and create a pull request using updated files.
|
||||||
|
|
||||||
|
### Pre-Commit Hooks
|
||||||
|
|
||||||
|
To prevent accidental commits of local configuration and IDE files (specifically `.vscode/` and `.claude/`), this repository utilizes the `pre-commit` framework.
|
||||||
|
|
||||||
|
Please set up the hooks locally before making your first commit:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install the pre-commit tool
|
||||||
|
pip install pre-commit
|
||||||
|
|
||||||
|
# Register the hooks with Git
|
||||||
|
pre-commit install
|
||||||
|
```
|
||||||
|
|
||||||
### Code of Conduct
|
### Code of Conduct
|
||||||
The `kubernetes.core` collection follows the Ansible project's
|
The `kubernetes.core` collection follows the Ansible project's
|
||||||
[Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html).
|
[Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html).
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Also needs to be updated in galaxy.yml
|
# Also needs to be updated in galaxy.yml
|
||||||
VERSION = 5.4.2
|
VERSION = 5.5.0
|
||||||
|
|
||||||
TEST_ARGS ?= ""
|
TEST_ARGS ?= ""
|
||||||
PYTHON_VERSION ?= `python -c 'import platform; print(".".join(platform.python_version_tuple()[0:2]))'`
|
PYTHON_VERSION ?= `python -c 'import platform; print(".".join(platform.python_version_tuple()[0:2]))'`
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
[](https://sonarcloud.io/summary/new_code?id=ansible-collections_kubernetes.core)
|
||||||
|
[](https://sonarcloud.io/summary/new_code?id=ansible-collections_kubernetes.core)
|
||||||
|
[](https://sonarcloud.io/summary/new_code?id=ansible-collections_kubernetes.core)
|
||||||
|
[](https://sonarcloud.io/summary/new_code?id=ansible-collections_kubernetes.core)
|
||||||
|
[](https://sonarcloud.io/summary/new_code?id=ansible-collections_kubernetes.core)
|
||||||
|
[](https://sonarcloud.io/summary/new_code?id=ansible-collections_kubernetes.core)
|
||||||
|
[](https://sonarcloud.io/summary/new_code?id=ansible-collections_kubernetes.core)
|
||||||
|
|
||||||
# Kubernetes Collection for Ansible
|
# Kubernetes Collection for Ansible
|
||||||
|
|
||||||
This repository hosts the `kubernetes.core` (formerly known as `community.kubernetes`) Ansible Collection.
|
This repository hosts the `kubernetes.core` (formerly known as `community.kubernetes`) Ansible Collection.
|
||||||
@@ -6,27 +14,65 @@ This repository hosts the `kubernetes.core` (formerly known as `community.kubern
|
|||||||
|
|
||||||
The collection includes a variety of Ansible content to help automate the management of applications in Kubernetes and OpenShift clusters, as well as the provisioning and maintenance of clusters themselves.
|
The collection includes a variety of Ansible content to help automate the management of applications in Kubernetes and OpenShift clusters, as well as the provisioning and maintenance of clusters themselves.
|
||||||
|
|
||||||
## Communication
|
### Included Content
|
||||||
|
|
||||||
* Join the Ansible forum:
|
Click on the name of a plugin or module to view that content's documentation:
|
||||||
* [Get Help](https://forum.ansible.com/c/help/6): get help or help others.
|
|
||||||
* [Posts tagged with 'kubernetes'](https://forum.ansible.com/tag/kubernetes): subscribe to participate in collection-related conversations.
|
|
||||||
* [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
|
|
||||||
* [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
|
|
||||||
|
|
||||||
* The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
|
<!--start collection content-->
|
||||||
|
### Connection plugins
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
[kubernetes.core.kubectl](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.kubectl_connection.rst)|Execute tasks in pods running on Kubernetes.
|
||||||
|
|
||||||
For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
|
### K8s filter plugins
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
kubernetes.core.k8s_config_resource_name|Generate resource name for the given resource of type ConfigMap, Secret
|
||||||
|
|
||||||
|
### Inventory plugins
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
[kubernetes.core.k8s](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_inventory.rst)|Kubernetes (K8s) inventory source
|
||||||
|
|
||||||
|
### Lookup plugins
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
[kubernetes.core.k8s](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_lookup.rst)|Query the K8s API
|
||||||
|
[kubernetes.core.kustomize](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.kustomize_lookup.rst)|Build a set of kubernetes resources using a 'kustomization.yaml' file.
|
||||||
|
|
||||||
|
### Modules
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
[kubernetes.core.helm](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.helm_module.rst)|Manages Kubernetes packages with the Helm package manager
|
||||||
|
[kubernetes.core.helm_info](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.helm_info_module.rst)|Get information from Helm package deployed inside the cluster
|
||||||
|
[kubernetes.core.helm_plugin](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.helm_plugin_module.rst)|Manage Helm plugins
|
||||||
|
[kubernetes.core.helm_plugin_info](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.helm_plugin_info_module.rst)|Gather information about Helm plugins
|
||||||
|
[kubernetes.core.helm_pull](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.helm_pull_module.rst)|download a chart from a repository and (optionally) unpack it in local directory.
|
||||||
|
[kubernetes.core.helm_registry_auth](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.helm_registry_auth_module.rst)|Helm registry authentication module
|
||||||
|
[kubernetes.core.helm_repository](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.helm_repository_module.rst)|Manage Helm repositories.
|
||||||
|
[kubernetes.core.helm_template](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.helm_template_module.rst)|Render chart templates
|
||||||
|
[kubernetes.core.k8s](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_module.rst)|Manage Kubernetes (K8s) objects
|
||||||
|
[kubernetes.core.k8s_cluster_info](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_cluster_info_module.rst)|Describe Kubernetes (K8s) cluster, APIs available and their respective versions
|
||||||
|
[kubernetes.core.k8s_cp](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_cp_module.rst)|Copy files and directories to and from pod.
|
||||||
|
[kubernetes.core.k8s_drain](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_drain_module.rst)|Drain, Cordon, or Uncordon node in k8s cluster
|
||||||
|
[kubernetes.core.k8s_exec](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_exec_module.rst)|Execute command in Pod
|
||||||
|
[kubernetes.core.k8s_info](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_info_module.rst)|Describe Kubernetes (K8s) objects
|
||||||
|
[kubernetes.core.k8s_json_patch](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_json_patch_module.rst)|Apply JSON patch operations to existing objects
|
||||||
|
[kubernetes.core.k8s_log](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_log_module.rst)|Fetch logs from Kubernetes resources
|
||||||
|
[kubernetes.core.k8s_rollback](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_rollback_module.rst)|Rollback Kubernetes (K8S) Deployments and DaemonSets
|
||||||
|
[kubernetes.core.k8s_scale](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_scale_module.rst)|Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job.
|
||||||
|
[kubernetes.core.k8s_service](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_service_module.rst)|Manage Services on Kubernetes
|
||||||
|
[kubernetes.core.k8s_taint](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/kubernetes.core.k8s_taint_module.rst)|Taint a node in a Kubernetes/OpenShift cluster
|
||||||
|
|
||||||
|
<!--end collection content-->
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
<!--start requires_ansible-->
|
<!--start requires_ansible-->
|
||||||
## Ansible Version Compatibility
|
## Ansible version compatibility
|
||||||
|
|
||||||
This collection has been tested against following Ansible versions: **>=2.15.0**.
|
This collection has been tested against the following Ansible versions: **>=2.16.0**.
|
||||||
|
|
||||||
For collections that support Ansible 2.9, please ensure you update your `network_os` to use the
|
|
||||||
fully qualified collection name (for example, `cisco.ios.ios`).
|
|
||||||
Plugins and modules within a collection may be tested with only specific Ansible versions.
|
Plugins and modules within a collection may be tested with only specific Ansible versions.
|
||||||
A collection may contain metadata that identifies these versions.
|
A collection may contain metadata that identifies these versions.
|
||||||
PEP440 is the schema used to describe the versions of Ansible.
|
PEP440 is the schema used to describe the versions of Ansible.
|
||||||
@@ -46,58 +92,6 @@ Note: Python2 is deprecated from [1st January 2020](https://www.python.org/doc/s
|
|||||||
|
|
||||||
This collection supports Kubernetes versions >= 1.24.
|
This collection supports Kubernetes versions >= 1.24.
|
||||||
|
|
||||||
### Included Content
|
|
||||||
|
|
||||||
Click on the name of a plugin or module to view that content's documentation:
|
|
||||||
|
|
||||||
<!--start collection content-->
|
|
||||||
### Connection Plugins
|
|
||||||
Name | Description
|
|
||||||
--- | ---
|
|
||||||
[kubernetes.core.kubectl](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.kubectl_connection.rst)|Execute tasks in pods running on Kubernetes.
|
|
||||||
|
|
||||||
### K8s filter Plugins
|
|
||||||
Name | Description
|
|
||||||
--- | ---
|
|
||||||
kubernetes.core.k8s_config_resource_name|Generate resource name for the given resource of type ConfigMap, Secret
|
|
||||||
|
|
||||||
### Inventory Plugins
|
|
||||||
Name | Description
|
|
||||||
--- | ---
|
|
||||||
[kubernetes.core.k8s](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_inventory.rst)|Kubernetes (K8s) inventory source
|
|
||||||
|
|
||||||
### Lookup Plugins
|
|
||||||
Name | Description
|
|
||||||
--- | ---
|
|
||||||
[kubernetes.core.k8s](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_lookup.rst)|Query the K8s API
|
|
||||||
[kubernetes.core.kustomize](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.kustomize_lookup.rst)|Build a set of kubernetes resources using a 'kustomization.yaml' file.
|
|
||||||
|
|
||||||
### Modules
|
|
||||||
Name | Description
|
|
||||||
--- | ---
|
|
||||||
[kubernetes.core.helm](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_module.rst)|Manages Kubernetes packages with the Helm package manager
|
|
||||||
[kubernetes.core.helm_info](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_info_module.rst)|Get information from Helm package deployed inside the cluster
|
|
||||||
[kubernetes.core.helm_plugin](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_plugin_module.rst)|Manage Helm plugins
|
|
||||||
[kubernetes.core.helm_plugin_info](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_plugin_info_module.rst)|Gather information about Helm plugins
|
|
||||||
[kubernetes.core.helm_pull](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_pull_module.rst)|download a chart from a repository and (optionally) unpack it in local directory.
|
|
||||||
[kubernetes.core.helm_registry_auth](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_registry_auth_module.rst)|Helm registry authentication module
|
|
||||||
[kubernetes.core.helm_repository](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_repository_module.rst)|Manage Helm repositories.
|
|
||||||
[kubernetes.core.helm_template](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_template_module.rst)|Render chart templates
|
|
||||||
[kubernetes.core.k8s](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_module.rst)|Manage Kubernetes (K8s) objects
|
|
||||||
[kubernetes.core.k8s_cluster_info](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_cluster_info_module.rst)|Describe Kubernetes (K8s) cluster, APIs available and their respective versions
|
|
||||||
[kubernetes.core.k8s_cp](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_cp_module.rst)|Copy files and directories to and from pod.
|
|
||||||
[kubernetes.core.k8s_drain](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_drain_module.rst)|Drain, Cordon, or Uncordon node in k8s cluster
|
|
||||||
[kubernetes.core.k8s_exec](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_exec_module.rst)|Execute command in Pod
|
|
||||||
[kubernetes.core.k8s_info](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_info_module.rst)|Describe Kubernetes (K8s) objects
|
|
||||||
[kubernetes.core.k8s_json_patch](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_json_patch_module.rst)|Apply JSON patch operations to existing objects
|
|
||||||
[kubernetes.core.k8s_log](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_log_module.rst)|Fetch logs from Kubernetes resources
|
|
||||||
[kubernetes.core.k8s_rollback](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_rollback_module.rst)|Rollback Kubernetes (K8S) Deployments and DaemonSets
|
|
||||||
[kubernetes.core.k8s_scale](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_scale_module.rst)|Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job.
|
|
||||||
[kubernetes.core.k8s_service](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_service_module.rst)|Manage Services on Kubernetes
|
|
||||||
[kubernetes.core.k8s_taint](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_taint_module.rst)|Taint a node in a Kubernetes/OpenShift cluster
|
|
||||||
|
|
||||||
<!--end collection content-->
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Before using the Kubernetes collection, you need to install it with the Ansible Galaxy CLI:
|
Before using the Kubernetes collection, you need to install it with the Ansible Galaxy CLI:
|
||||||
@@ -110,14 +104,16 @@ You can also include it in a `requirements.yml` file and install it via `ansible
|
|||||||
---
|
---
|
||||||
collections:
|
collections:
|
||||||
- name: kubernetes.core
|
- name: kubernetes.core
|
||||||
version: 5.4.2
|
version: 5.5.0
|
||||||
```
|
```
|
||||||
|
|
||||||
### Installing the Kubernetes Python Library
|
### 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. You can install it with:
|
||||||
|
|
||||||
pip3 install kubernetes
|
```bash
|
||||||
|
pip3 install kubernetes
|
||||||
|
```
|
||||||
|
|
||||||
## Use Cases
|
## Use Cases
|
||||||
|
|
||||||
@@ -189,7 +185,11 @@ For documentation on how to use individual modules and other content included in
|
|||||||
|
|
||||||
## Ansible Turbo Mode Tech Preview
|
## Ansible Turbo Mode Tech Preview
|
||||||
|
|
||||||
The ``kubernetes.core`` collection supports Ansible Turbo mode as a tech preview via the ``cloud.common`` collection. By default, this feature is disabled. To enable Turbo mode for modules, set the environment variable `ENABLE_TURBO_MODE=1` on the managed node. For example:
|
> **Deprecated:** Ansible Turbo mode (`ENABLE_TURBO_MODE`) is deprecated and will be removed in a future major release (planned for 8.0.0), since it depends on the `cloud.common` collection, which is being retired. Setting `ENABLE_TURBO_MODE` will keep emitting a deprecation warning until support is removed, at which point the variable will have no effect.
|
||||||
|
|
||||||
|
> **Note:** Ansible Turbo mode is supported only with ``ansible-core`` versions **lower than 2.19**. Starting from ``ansible-core`` 2.19, the ``cloud.common`` collection is no longer supported, and therefore Ansible Turbo mode is also not supported in ``kubernetes.core``. If ``ENABLE_TURBO_MODE`` is set to ``1`` (or any truthy value) with ``ansible-core >= 2.19.0``, Turbo mode is ignored and a warning is emitted; modules run without it.
|
||||||
|
|
||||||
|
The ``kubernetes.core`` collection supports Ansible Turbo mode as a tech preview via the ``cloud.common`` collection (requires `ansible-core < 2.19`). By default, this feature is disabled. To enable Turbo mode for modules, set the environment variable `ENABLE_TURBO_MODE=1` on the managed node. For example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
@@ -203,13 +203,7 @@ The ``kubernetes.core`` collection supports Ansible Turbo mode as a tech preview
|
|||||||
To enable Turbo mode for k8s lookup plugin, set the environment variable `ENABLE_TURBO_MODE=1` on the managed node. This is not working when
|
To enable Turbo mode for k8s lookup plugin, set the environment variable `ENABLE_TURBO_MODE=1` on the managed node. This is not working when
|
||||||
defined in the playbook using `environment` keyword as above, you must set it using `export ENABLE_TURBO_MODE=1`.
|
defined in the playbook using `environment` keyword as above, you must set it using `export ENABLE_TURBO_MODE=1`.
|
||||||
|
|
||||||
Please read more about Ansible Turbo mode - [here](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/ansible_turbo_mode.rst).
|
Please read more about Ansible Turbo mode - [here](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/ansible_turbo_mode.rst).
|
||||||
|
|
||||||
## Contributing to this Collection
|
|
||||||
|
|
||||||
If you want to develop new content for this collection or improve what's already here, the easiest way to work on the collection is to clone it into one of the configured [`COLLECTIONS_PATHS`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths), and work on it there.
|
|
||||||
|
|
||||||
See [Contributing to kubernetes.core](CONTRIBUTING.md).
|
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
@@ -232,7 +226,40 @@ There are also integration tests in the `molecule` directory which are meant to
|
|||||||
kind create cluster
|
kind create cluster
|
||||||
make test-molecule
|
make test-molecule
|
||||||
|
|
||||||
## Publishing New Versions
|
## Contributing to this Collection
|
||||||
|
|
||||||
|
If you want to develop new content for this collection or improve what is already here, clone the Git repository into one of the configured [`COLLECTIONS_PATHS`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths) and work on it there.
|
||||||
|
|
||||||
|
See [Contributing to kubernetes.core](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
Join the Ansible community:
|
||||||
|
|
||||||
|
* [Get Help](https://forum.ansible.com/c/help/6)
|
||||||
|
* [Posts tagged with 'kubernetes'](https://forum.ansible.com/tag/kubernetes)
|
||||||
|
* [Social Spaces](https://forum.ansible.com/c/chat/4)
|
||||||
|
* [News & Announcements](https://forum.ansible.com/c/news/5)
|
||||||
|
|
||||||
|
The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn) announces releases and important changes. For more information, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
|
||||||
|
|
||||||
|
### Code of Conduct
|
||||||
|
|
||||||
|
This project follows the [Ansible Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html). If you encounter abusive behavior, see the [policy violations](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html#policy-violations) section for how to raise a complaint.
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
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`.
|
||||||
|
|
||||||
|
We announce releases and important changes through Ansible's [The Bullhorn newsletter](https://github.com/ansible/community/wiki/News#the-bullhorn). Subscribe via [this link](https://eepurl.com/gZmiEP).
|
||||||
|
|
||||||
|
We take part in the global quarterly [Ansible Contributor Summit](https://github.com/ansible/community/wiki/Contributor-Summit). Track The Bullhorn and join when announced.
|
||||||
|
|
||||||
|
For the latest supported versions, see [Release Notes and Roadmap](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/README.md#release-notes-and-roadmap).
|
||||||
|
|
||||||
|
Report bugs, request features, or ask questions by opening an issue in the [GitHub repository](https://github.com/ansible-collections/kubernetes.core/).
|
||||||
|
|
||||||
|
## Release Notes and Roadmap
|
||||||
|
|
||||||
Releases are automatically built and pushed to Ansible Galaxy for any new tag. Before tagging a release, make sure to do the following:
|
Releases are automatically built and pushed to Ansible Galaxy for any new tag. Before tagging a release, make sure to do the following:
|
||||||
|
|
||||||
@@ -249,37 +276,24 @@ Releases are automatically built and pushed to Ansible Galaxy for any new tag. B
|
|||||||
|
|
||||||
After the version is published, verify it exists on the [Kubernetes Collection Galaxy page](https://galaxy.ansible.com/kubernetes/core).
|
After the version is published, verify it exists on the [Kubernetes Collection Galaxy page](https://galaxy.ansible.com/kubernetes/core).
|
||||||
|
|
||||||
The process for uploading a supported release to Automation Hub is documented separately.
|
The process for [uploading a supported release to Automation Hub](https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.1/html/uploading_content_to_red_hat_automation_hub/proc-upload-collection) is documented separately.
|
||||||
|
|
||||||
## Support
|
## Related Information
|
||||||
|
|
||||||
<!--List available communication channels. In addition to channels specific to your collection, we also recommend to use the following ones.-->
|
* [Using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html)
|
||||||
|
* [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html)
|
||||||
|
* [Continuous integration (CI) overview](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/CI.md)
|
||||||
|
* [SonarCloud integration](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/SONARCLOUD.md)
|
||||||
|
* [Ansible Turbo mode (tech preview)](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/docs/ansible_turbo_mode.rst)
|
||||||
|
|
||||||
> **Note:** The `stable-4` branch, which handles all `4.x.y` releases of this collection, is no longer supported. This means that no backports nor releases will be performed on the `stable-4` branch.
|
### Code of conduct
|
||||||
|
|
||||||
We announce releases and important changes through Ansible's [The Bullhorn newsletter](https://github.com/ansible/community/wiki/News#the-bullhorn). Be sure you are [subscribed](https://eepurl.com/gZmiEP).
|
|
||||||
|
|
||||||
We take part in the global quarterly [Ansible Contributor Summit](https://github.com/ansible/community/wiki/Contributor-Summit) virtually or in-person. Track [The Bullhorn newsletter](https://eepurl.com/gZmiEP) and join us.
|
|
||||||
|
|
||||||
For more information about communication, refer to the [Ansible Communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
|
|
||||||
|
|
||||||
For the latest supported versions, refer to the release notes below.
|
|
||||||
|
|
||||||
If you encounter issues or have questions, you can submit a support request through the following channels:
|
|
||||||
- GitHub Issues: Report bugs, request features, or ask questions by opening an issue in the [GitHub repository](https://github.com/ansible-collections/kubernetes.core/).
|
|
||||||
|
|
||||||
## Release Notes
|
|
||||||
|
|
||||||
See the [raw generated changelog](https://github.com/ansible-collections/kubernetes.core/blob/main/CHANGELOG.rst).
|
|
||||||
|
|
||||||
## Code of Conduct
|
|
||||||
|
|
||||||
We follow the [Ansible Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html) in all our interactions within this project.
|
We follow the [Ansible Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html) in all our interactions within this project.
|
||||||
|
|
||||||
If you encounter abusive behavior, please refer to the [policy violations](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html#policy-violations) section of the Code for information on how to raise a complaint.
|
If you encounter abusive behavior, please refer to the [policy violations](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html#policy-violations) section of the Code for information on how to raise a complaint.
|
||||||
|
|
||||||
## License
|
## License Information
|
||||||
|
|
||||||
GNU General Public License v3.0 or later
|
GNU General Public License v3.0 or later
|
||||||
|
|
||||||
See LICENSE to see the full text.
|
See [LICENSE](https://github.com/ansible-collections/kubernetes.core/blob/stable-5/LICENSE) to see the full text.
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# SonarCloud
|
||||||
|
|
||||||
|
Dashboard:
|
||||||
|
|
||||||
|
[SonarCloud project overview](https://sonarcloud.io/project/overview?id=ansible-collections_kubernetes.core)
|
||||||
|
|
||||||
|
## CI integration
|
||||||
|
|
||||||
|
Sonar analysis is implemented in **[.github/workflows/sonarcloud.yml](.github/workflows/sonarcloud.yml)** as a **reusable workflow** (`on: workflow_call` only). It is **not** triggered by `workflow_run`.
|
||||||
|
|
||||||
|
**[.github/workflows/all_green_check.yaml](.github/workflows/all_green_check.yaml)** runs **linters** (on pull requests), **sanity**, **units**, and **coverage**, passes the aggregate **`all_green`** gate, then calls **`sonarcloud.yml`** via a **`sonarcloud`** job when the conditions below are met. The **coverage** job uploads a **`coverage`** artifact; the Sonar job downloads it in the **same** workflow run.
|
||||||
|
|
||||||
|
The caller runs on **`pull_request`** or **`push`**, so the reusable workflow inherits that **`github.event`**. **`actions/checkout`** uses **`github.event.pull_request.head.sha`** on pull requests and **`github.sha`** on push (Sonar-friendly checkout). PR parameters (**`sonar.pullrequest.*`**) are taken from **`github.event.pull_request`** (no `gh` API calls in **`sonarcloud.yml`**).
|
||||||
|
|
||||||
|
The scan step uses **`SonarSource/sonarqube-scan-action`** (pinned SHA in the workflow file) with **`sonar.python.coverage.reportPaths`** set from any **`coverage*.xml`** files found under the workspace after the artifact download. The overall flow (coverage in CI, then Sonar with XML) follows the same idea as [ansible-collections/amazon.aws#2871](https://github.com/ansible-collections/amazon.aws/pull/2871), using **`workflow_call`** from **`all_green`** instead of a separate **`workflow_run`** finalize workflow.
|
||||||
|
|
||||||
|
Workflow files:
|
||||||
|
|
||||||
|
- [.github/workflows/all_green_check.yaml](.github/workflows/all_green_check.yaml) -- **`all_green`** gate, **coverage** artifact upload, and **`sonarcloud`** job (**`uses: ./.github/workflows/sonarcloud.yml`**, passing only **`ANSIBLE_COLLECTIONS_ORG_SONAR_TOKEN_CICD_BOT`**) after **`all_green`** and **`coverage`** succeed, gated for **`push`** and same-repo **`pull_request`** only.
|
||||||
|
- [.github/workflows/sonarcloud.yml](.github/workflows/sonarcloud.yml) -- **`scan`** job: checkout, download **`coverage`**, **`SONAR_ARGS`**, SonarCloud scan.
|
||||||
|
|
||||||
|
Scanner configuration lives in [sonar-project.properties](sonar-project.properties).
|
||||||
|
|
||||||
|
The **coverage** job (in **`all_green`**) uses **`ansible-test`** (`units --coverage`, then **`coverage combine`** / **`coverage xml`**) with **ansible-core `stable-2.18`** on **`stable-5`**, then writes **`coverage.xml`** with workspace paths normalized for Sonar. **`pytest-cov`** is listed in **`tests/unit/requirements.txt`** for parity and any direct pytest runs; **`ansible-test`** still owns the coverage data used in CI.
|
||||||
|
|
||||||
|
**`sonarcloud.yml`** declares a required secret **`ANSIBLE_COLLECTIONS_ORG_SONAR_TOKEN_CICD_BOT`** and **`permissions: contents: read`**, **`pull-requests: read`**.
|
||||||
|
|
||||||
|
Org secrets and fork PR behavior follow GitHub's [secrets in Actions](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) documentation. The **`sonarcloud`** job is **`if:`**-gated so the org token is not used for fork-head checkouts; fork PRs still run **`all_green`** for CI without running Sonar.
|
||||||
|
|
||||||
|
## Branch protection (repository settings)
|
||||||
|
|
||||||
|
If **`SonarCloud scan`** or **`all_green`** should block merges, add them under **Settings** > **Branches** > **Required status checks** for the protected branch. That is not configured in YAML.
|
||||||
@@ -1029,11 +1029,12 @@ releases:
|
|||||||
- module_utils/k8s/service - fix issue when trying to delete resource using
|
- module_utils/k8s/service - fix issue when trying to delete resource using
|
||||||
`delete_options` and `check_mode=true` (https://github.com/ansible-collections/kubernetes.core/issues/892).
|
`delete_options` and `check_mode=true` (https://github.com/ansible-collections/kubernetes.core/issues/892).
|
||||||
minor_changes:
|
minor_changes:
|
||||||
- kubernetes.core - Bump version of ``ansible-lint`` to ``25.1.2`` (https://github.com/ansible-collections/kubernetes.core/pull/919).
|
|
||||||
- action/k8s_info - update templating mechanism with changes from ``ansible-core
|
- action/k8s_info - update templating mechanism with changes from ``ansible-core
|
||||||
2.19`` (https://github.com/ansible-collections/kubernetes.core/pull/888).
|
2.19`` (https://github.com/ansible-collections/kubernetes.core/pull/888).
|
||||||
- helm - add ``reset_then_reuse_values`` support to helm module (https://github.com/ansible-collections/kubernetes.core/issues/803).
|
- helm - add ``reset_then_reuse_values`` support to helm module (https://github.com/ansible-collections/kubernetes.core/issues/803).
|
||||||
- helm - add support for ``insecure_skip_tls_verify`` option to helm and ``helm_repository`` (https://github.com/ansible-collections/kubernetes.core/issues/694).
|
- helm - add support for ``insecure_skip_tls_verify`` option to helm and ``helm_repository``
|
||||||
|
(https://github.com/ansible-collections/kubernetes.core/issues/694).
|
||||||
|
- kubernetes.core - Bump version of ``ansible-lint`` to ``25.1.2`` (https://github.com/ansible-collections/kubernetes.core/pull/919).
|
||||||
release_summary: This release includes minor changes, bug fixes and also bumps
|
release_summary: This release includes minor changes, bug fixes and also bumps
|
||||||
``ansible-lint`` version to ``25.1.2``.
|
``ansible-lint`` version to ``25.1.2``.
|
||||||
fragments:
|
fragments:
|
||||||
@@ -1096,13 +1097,14 @@ releases:
|
|||||||
be removed in a release after 2027-01-08. Use ``status.release_values`` instead
|
be removed in a release after 2027-01-08. Use ``status.release_values`` instead
|
||||||
(https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
(https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
minor_changes:
|
minor_changes:
|
||||||
- helm - added ``release_values`` key to ``status`` return value that can be
|
- helm - Add ``release_values`` key to ``status`` return value that can be accessed
|
||||||
accessed using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
- helm_info - added ``release_values`` key to ``status`` return value that can
|
- helm_info - Add ``release_values`` key to ``status`` return value that can
|
||||||
be accessed using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
be accessed using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
release_summary: This release includes various bugfixes such as replacing the
|
release_summary: This release includes bugfixes such as replacing the passing
|
||||||
passing of ``warnings`` to ``exit_json`` with ``AnsibleModule.warn`` as well
|
of ``warnings`` to ``exit_json`` with ``AnsibleModule.warn`` as well as a
|
||||||
as security updates for selectively redacting sensitive information from kubeconfig.
|
security update for selectively redacting sensitive information from kubeconfig,
|
||||||
|
and adds a new ``release_values`` key to the ``status`` return value.
|
||||||
security_fixes:
|
security_fixes:
|
||||||
- Selectively redact sensitive info from kubeconfig instead of applying blanket
|
- Selectively redact sensitive info from kubeconfig instead of applying blanket
|
||||||
``no_log=True`` (https://github.com/ansible-collections/kubernetes.core/pull/1014).
|
``no_log=True`` (https://github.com/ansible-collections/kubernetes.core/pull/1014).
|
||||||
@@ -1116,3 +1118,85 @@ releases:
|
|||||||
- 20260108-fix-sanity-failures.yml
|
- 20260108-fix-sanity-failures.yml
|
||||||
- 5-4-2.yaml
|
- 5-4-2.yaml
|
||||||
release_date: '2026-02-03'
|
release_date: '2026-02-03'
|
||||||
|
5.4.3:
|
||||||
|
changes:
|
||||||
|
bugfixes:
|
||||||
|
- ee - Add ``meta/execution-environment.yml`` to decouple ansible-builder EE
|
||||||
|
builds from the ``openshift-clients`` system dependency declared in ``bindep.txt``,
|
||||||
|
which is not available in standard UBI repositories and caused builds to fail
|
||||||
|
with ``No package matches 'openshift-clients'`` (https://github.com/ansible-collections/kubernetes.core/issues/1141).
|
||||||
|
- helm_repository - Correct handling of repository URLs with trailing slashes
|
||||||
|
(https://github.com/ansible-collections/kubernetes.core/pull/1121).
|
||||||
|
- k8s_drain - Fix logic for handling pods with local storage to correctly check
|
||||||
|
for empty_dir volumes in replicated pods and pods managed by DaemonSets (https://github.com/ansible-collections/kubernetes.core/pull/1095).
|
||||||
|
release_summary: This release contains bugfixes such as improved idempotency
|
||||||
|
for helm repository URLs with trailing slashes.
|
||||||
|
fragments:
|
||||||
|
- 1173-security-check-workflow.yml
|
||||||
|
- 20260306-k8s_drain-delete-logic-fixes-for-daemonsets.yaml
|
||||||
|
- 20260506-improve_idempotency_for_helm_repository.yaml
|
||||||
|
- 5-4-3.yml
|
||||||
|
- fix-openshift-clients-ee-dependency.yaml
|
||||||
|
release_date: '2026-07-08'
|
||||||
|
5.4.4:
|
||||||
|
changes:
|
||||||
|
bugfixes:
|
||||||
|
- meta - Update ``requires_ansible`` in ``runtime.yml`` and README to ``>=2.16.0``
|
||||||
|
to match the actual minimum supported ``ansible-core`` version (https://github.com/ansible-collections/kubernetes.core/pull/1193).
|
||||||
|
release_summary: This release corrects the documented and enforced minimum ``ansible-core``
|
||||||
|
version to ``>=2.16.0``.
|
||||||
|
release_date: '2026-07-09'
|
||||||
|
5.5.0:
|
||||||
|
changes:
|
||||||
|
bugfixes:
|
||||||
|
- Ansible Turbo mode - ignore ``ENABLE_TURBO_MODE`` on ansible-core 2.19.0 and
|
||||||
|
later, where the ``cloud.common`` collection is not supported, and fall back
|
||||||
|
to the standard ``AnsibleModule`` instead of failing with ``byte indices must
|
||||||
|
be integers or slices, not str`` (https://github.com/ansible-collections/kubernetes.core/pull/1242).
|
||||||
|
- helm_repository - normalize both sides of the repository URL comparison, so
|
||||||
|
that a repository already registered with a trailing slash is recognized as
|
||||||
|
matching instead of failing with ``Repository already have a repository named
|
||||||
|
<name>`` (https://github.com/ansible-collections/kubernetes.core/pull/1236).
|
||||||
|
- k8s lookup - ignore ``ENABLE_TURBO_MODE`` on ansible-core 2.19.0 and later,
|
||||||
|
where the ``cloud.common`` collection is not supported. Fall back to the standard
|
||||||
|
``LookupBase`` instead of failing with a traceback (https://github.com/ansible-collections/kubernetes.core/pull/1253).
|
||||||
|
- k8s_info - Handle empty template output gracefully by returning ``changed=false``
|
||||||
|
instead of failing when Jinja2 template renders to an empty string (https://github.com/ansible-collections/kubernetes.core/issues/1042).
|
||||||
|
deprecated_features:
|
||||||
|
- Ansible Turbo mode (``ENABLE_TURBO_MODE``) has been deprecated and will be
|
||||||
|
removed in release 8.0.0, as it depends on the ``cloud.common`` collection,
|
||||||
|
which is being retired (https://github.com/ansible-collections/kubernetes.core/pull/1242).
|
||||||
|
- helm - the ``status.values`` return value has been deprecated and will be
|
||||||
|
removed in version 8.0.0. Use ``status.release_values`` instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
- helm - the ``wait_timeout`` parameter has been deprecated and will be removed
|
||||||
|
in version 7.0.0. Use ``timeout`` instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
- helm_info - the ``status.values`` return value has been deprecated and will
|
||||||
|
be removed in version 8.0.0. Use ``status.release_values`` instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
- k8s_exec - the ``return_code`` return value has been deprecated and will be
|
||||||
|
removed in version 7.0.0. Use ``rc`` instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
- k8s_service - the ``merge_type=json`` option has been deprecated and will
|
||||||
|
be removed in version 7.0.0. Use ``kubernetes.core.k8s_json_patch`` module
|
||||||
|
instead (https://github.com/ansible-collections/kubernetes.core/issues/1239).
|
||||||
|
minor_changes:
|
||||||
|
- Remove the remaining ``ansible.module_utils.six`` import to avoid deprecation
|
||||||
|
warnings, replacing it with the Python standard library equivalent (https://github.com/ansible-collections/kubernetes.core/pull/1197).
|
||||||
|
- k8s lookup - warn when ``ENABLE_TURBO_MODE`` is set but the ``cloud.common``
|
||||||
|
collection is not installed, instead of silently falling back to the standard
|
||||||
|
lookup base (https://github.com/ansible-collections/kubernetes.core/pull/1242).
|
||||||
|
release_summary: This minor release deprecates Ansible Turbo mode (``ENABLE_TURBO_MODE``),
|
||||||
|
the ``status.values`` return value of the ``helm`` and ``helm_info`` modules,
|
||||||
|
the ``wait_timeout`` parameter of the ``helm`` module, the ``return_code``
|
||||||
|
return value of the ``k8s_exec`` module, and the ``merge_type=json`` option
|
||||||
|
of the ``k8s_service`` module. It also includes bugfixes for ``helm_repository``
|
||||||
|
URL comparison and for empty template output handling in ``k8s_info``.
|
||||||
|
fragments:
|
||||||
|
- 1253-k8s-lookup-turbo-version-check.yml
|
||||||
|
- 20250108-fix-empty-template-output.yaml
|
||||||
|
- 20260723-remove-module-utils-six.yaml
|
||||||
|
- 20260908-helm-repository-trailing-slash.yaml
|
||||||
|
- 20260911-deprecate-status-values.yaml
|
||||||
|
- 20260911-update-deprecation-notices.yaml
|
||||||
|
- 5.5.0.yml
|
||||||
|
- deprecate-enable-turbo-mode.yml
|
||||||
|
- fix-ansible-lint-warnings.yaml
|
||||||
|
release_date: '2026-09-15'
|
||||||
|
|||||||
@@ -12,6 +12,20 @@ Following document provides overview of Ansible Turbo mode in ``kubernetes.core`
|
|||||||
:depth: 1
|
:depth: 1
|
||||||
|
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
Ansible Turbo mode is **deprecated** and will be removed in a future major release
|
||||||
|
(planned for 8.0.0), as it depends on the ``cloud.common`` collection, which is being
|
||||||
|
retired. Setting ``ENABLE_TURBO_MODE`` now emits a deprecation warning; once support is
|
||||||
|
removed, the variable will have no effect. Start planning your migration away from
|
||||||
|
Turbo mode.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
Ansible Turbo mode is supported only with ``ansible-core`` versions **lower than 2.19**.
|
||||||
|
Starting from ``ansible-core`` 2.19, the ``cloud.common`` collection is no longer supported,
|
||||||
|
and therefore Ansible Turbo mode is also not supported in ``kubernetes.core``.
|
||||||
|
If ``ENABLE_TURBO_MODE`` is set to ``1`` (or any truthy value) with ``ansible-core >= 2.19.0``,
|
||||||
|
Turbo mode is ignored and a warning is emitted; modules run without it.
|
||||||
|
|
||||||
Synopsis
|
Synopsis
|
||||||
--------
|
--------
|
||||||
- A brief introduction about Ansible Turbo mode in ``kuberentes.core`` collection.
|
- A brief introduction about Ansible Turbo mode in ``kuberentes.core`` collection.
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
@@ -410,6 +410,23 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
<br/>
|
<br/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="1">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>release_values</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">dictionary</span>
|
||||||
|
</div>
|
||||||
|
<div style="font-style: italic; font-size: small; color: darkgreen">added in 6.3.0</div>
|
||||||
|
</td>
|
||||||
|
<td>always</td>
|
||||||
|
<td>
|
||||||
|
<div>Dict of Values used to deploy.</div>
|
||||||
|
<br/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
@@ -465,12 +482,13 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
<b>values</b>
|
<b>values</b>
|
||||||
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
<div style="font-size: small">
|
<div style="font-size: small">
|
||||||
<span style="color: purple">string</span>
|
<span style="color: purple">dictionary</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>always</td>
|
<td>always</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Dict of Values used to deploy</div>
|
<div>Dict of Values used to deploy</div>
|
||||||
|
<div>This return value has been deprecated and will be removed in version 8.0.0. Use RV(status.release_values) instead.</div>
|
||||||
<br/>
|
<br/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -713,7 +713,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Timeout when wait option is enabled (helm2 is a number of seconds, helm3 is a duration).</div>
|
<div>Timeout when wait option is enabled (helm2 is a number of seconds, helm3 is a duration).</div>
|
||||||
<div>The use of <em>wait_timeout</em> to wait for kubernetes commands to complete has been deprecated and will be removed after 2022-12-01.</div>
|
<div>The use of <em>wait_timeout</em> to wait for kubernetes commands to complete has been deprecated and will be removed in version 7.0.0. Use O(timeout) instead.</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -851,7 +851,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
@@ -957,6 +957,23 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
<br/>
|
<br/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="1">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>release_values</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">dictionary</span>
|
||||||
|
</div>
|
||||||
|
<div style="font-style: italic; font-size: small; color: darkgreen">added in 6.3.0</div>
|
||||||
|
</td>
|
||||||
|
<td>always</td>
|
||||||
|
<td>
|
||||||
|
<div>Dict of Values used to deploy.</div>
|
||||||
|
<br/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
@@ -1012,12 +1029,13 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
<b>values</b>
|
<b>values</b>
|
||||||
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
<div style="font-size: small">
|
<div style="font-size: small">
|
||||||
<span style="color: purple">string</span>
|
<span style="color: purple">dictionary</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>always</td>
|
<td>always</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Dict of Values used to deploy</div>
|
<div>Dict of Values used to deploy.</div>
|
||||||
|
<div>This return value has been deprecated and will be removed in version 8.0.0. Use RV(status.release_values) instead.</div>
|
||||||
<br/>
|
<br/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -571,7 +571,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
@@ -535,7 +535,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<div>The command status code. This attribute is deprecated and will be removed in a future release. Please use rc instead.</div>
|
<div>The command status code. This attribute is deprecated and will be removed in version 7.0.0. Use RV(result.rc) instead.</div>
|
||||||
<br/>
|
<br/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -701,11 +701,26 @@ Examples
|
|||||||
wait_sleep: 10
|
wait_sleep: 10
|
||||||
wait_timeout: 360
|
wait_timeout: 360
|
||||||
|
|
||||||
|
- name: Wait for OpenShift bootstrap to complete
|
||||||
|
kubernetes.core.k8s_info:
|
||||||
|
api_version: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
name: bootstrap
|
||||||
|
namespace: kube-system
|
||||||
|
register: ocp_bootstrap_status
|
||||||
|
until: >
|
||||||
|
ocp_bootstrap_status.resources is defined and
|
||||||
|
(ocp_bootstrap_status.resources | length > 0) and
|
||||||
|
(ocp_bootstrap_status.resources[0].data.status is defined) and
|
||||||
|
(ocp_bootstrap_status.resources[0].data.status == 'complete')
|
||||||
|
retries: 60
|
||||||
|
delay: 15
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -621,7 +621,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -612,7 +612,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -38,13 +38,13 @@ Parameters
|
|||||||
|
|
||||||
<table border=0 cellpadding=0 class="documentation-table">
|
<table border=0 cellpadding=0 class="documentation-table">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="1">Parameter</th>
|
<th colspan="2">Parameter</th>
|
||||||
<th>Choices/<font color="blue">Defaults</font></th>
|
<th>Choices/<font color="blue">Defaults</font></th>
|
||||||
<th>Configuration</th>
|
<th>Configuration</th>
|
||||||
<th width="100%">Comments</th>
|
<th width="100%">Comments</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>api_key</b>
|
<b>api_key</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -61,7 +61,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>api_version</b>
|
<b>api_version</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -79,7 +79,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>ca_cert</b>
|
<b>ca_cert</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -97,7 +97,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>client_cert</b>
|
<b>client_cert</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -115,7 +115,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>client_key</b>
|
<b>client_key</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -133,7 +133,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>cluster_info</b>
|
<b>cluster_info</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -150,7 +150,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>context</b>
|
<b>context</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -167,7 +167,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>field_selector</b>
|
<b>field_selector</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -184,7 +184,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>host</b>
|
<b>host</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -201,7 +201,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>kind</b>
|
<b>kind</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -219,7 +219,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>kubeconfig</b>
|
<b>kubeconfig</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -236,7 +236,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>label_selector</b>
|
<b>label_selector</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -253,7 +253,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>namespace</b>
|
<b>namespace</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -270,7 +270,26 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
<b>no_proxy</b>
|
||||||
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">string</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div>The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.</div>
|
||||||
|
<div>Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).</div>
|
||||||
|
<div>This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even if no_proxy is set correctly.</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>password</b>
|
<b>password</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -287,7 +306,101 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
<b>proxy</b>
|
||||||
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">string</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div>The URL of an HTTP proxy to use for the connection. Can also be specified via K8S_AUTH_PROXY environment variable.</div>
|
||||||
|
<div>Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP_PROXY).</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
<b>proxy_headers</b>
|
||||||
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">dictionary</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div>The Header used for the HTTP proxy.</div>
|
||||||
|
<div>Documentation can be found here <a href='https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html?highlight=proxy_headers#urllib3.util.make_headers'>https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html?highlight=proxy_headers#urllib3.util.make_headers</a>.</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"></td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
<b>basic_auth</b>
|
||||||
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">string</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div>Colon-separated username:password for basic authentication header.</div>
|
||||||
|
<div>Can also be specified via K8S_AUTH_PROXY_HEADERS_BASIC_AUTH environment.</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"></td>
|
||||||
|
<td colspan="1">
|
||||||
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
<b>proxy_basic_auth</b>
|
||||||
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">string</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div>Colon-separated username:password for proxy basic authentication header.</div>
|
||||||
|
<div>Can also be specified via K8S_AUTH_PROXY_HEADERS_PROXY_BASIC_AUTH environment.</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"></td>
|
||||||
|
<td colspan="1">
|
||||||
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
<b>user_agent</b>
|
||||||
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">string</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div>String representing the user-agent you want, such as foo/1.0.</div>
|
||||||
|
<div>Can also be specified via K8S_AUTH_PROXY_HEADERS_USER_AGENT environment.</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>resource_definition</b>
|
<b>resource_definition</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -304,7 +417,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>resource_name</b>
|
<b>resource_name</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -321,7 +434,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>src</b>
|
<b>src</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -339,7 +452,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>username</b>
|
<b>username</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -356,7 +469,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
<b>validate_certs</b>
|
<b>validate_certs</b>
|
||||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
@@ -432,7 +545,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this lookup:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this lookup:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -1279,18 +1279,35 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
<table border=0 cellpadding=0 class="documentation-table">
|
<table border=0 cellpadding=0 class="documentation-table">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2">Key</th>
|
<th colspan="3">Key</th>
|
||||||
<th>Returned</th>
|
<th>Returned</th>
|
||||||
<th width="100%">Description</th>
|
<th width="100%">Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="3">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>method</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">string</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>success</td>
|
||||||
|
<td>
|
||||||
|
<div>The method used to deploy the resource.</div>
|
||||||
|
<br/>
|
||||||
|
<div style="font-size: smaller"><b>Sample:</b></div>
|
||||||
|
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">create</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
<div class="ansibleOptionAnchor" id="return-"></div>
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
<b>result</b>
|
<b>result</b>
|
||||||
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
@@ -1306,6 +1323,105 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>api_version</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">string</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
|
<td>
|
||||||
|
<div>The versioned schema of this representation of an object.</div>
|
||||||
|
<br/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>duration</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">integer</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>when <code>wait</code> is true</td>
|
||||||
|
<td>
|
||||||
|
<div>elapsed time of task in seconds</div>
|
||||||
|
<br/>
|
||||||
|
<div style="font-size: smaller"><b>Sample:</b></div>
|
||||||
|
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">48</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>error</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">complex</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>error</td>
|
||||||
|
<td>
|
||||||
|
<div>error while trying to create/delete the object.</div>
|
||||||
|
<br/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>kind</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">string</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
|
<td>
|
||||||
|
<div>Represents the REST resource this object represents.</div>
|
||||||
|
<br/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>metadata</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">complex</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
|
<td>
|
||||||
|
<div>Standard object metadata. Includes name, namespace, annotations, labels, etc.</div>
|
||||||
|
<br/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>results</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">complex</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>when O(resource_definition) or O(src) contains a list of objects.</td>
|
||||||
|
<td>
|
||||||
|
<div>An array of created, patched, or otherwise present objects.</div>
|
||||||
|
<br/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<div class="ansibleOptionAnchor" id="return-"></div>
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
<b>api_version</b>
|
<b>api_version</b>
|
||||||
@@ -1314,7 +1430,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
<span style="color: purple">string</span>
|
<span style="color: purple">string</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>success</td>
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
<td>
|
<td>
|
||||||
<div>The versioned schema of this representation of an object.</div>
|
<div>The versioned schema of this representation of an object.</div>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -1322,6 +1438,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<div class="ansibleOptionAnchor" id="return-"></div>
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
<b>duration</b>
|
<b>duration</b>
|
||||||
@@ -1340,6 +1457,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<div class="ansibleOptionAnchor" id="return-"></div>
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
<b>error</b>
|
<b>error</b>
|
||||||
@@ -1356,21 +1474,6 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
|
||||||
<div class="ansibleOptionAnchor" id="return-"></div>
|
|
||||||
<b>items</b>
|
|
||||||
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
|
||||||
<div style="font-size: small">
|
|
||||||
<span style="color: purple">list</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>when resource_definition or src contains list of objects</td>
|
|
||||||
<td>
|
|
||||||
<div>Returned only when multiple yaml documents are passed to src or resource_definition</div>
|
|
||||||
<br/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<div class="ansibleOptionAnchor" id="return-"></div>
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
@@ -1380,7 +1483,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
<span style="color: purple">string</span>
|
<span style="color: purple">string</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>success</td>
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Represents the REST resource this object represents.</div>
|
<div>Represents the REST resource this object represents.</div>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -1388,6 +1491,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<div class="ansibleOptionAnchor" id="return-"></div>
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
<b>metadata</b>
|
<b>metadata</b>
|
||||||
@@ -1396,7 +1500,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
<span style="color: purple">complex</span>
|
<span style="color: purple">complex</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>success</td>
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Standard object metadata. Includes name, namespace, annotations, labels, etc.</div>
|
<div>Standard object metadata. Includes name, namespace, annotations, labels, etc.</div>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -1404,6 +1508,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<div class="ansibleOptionAnchor" id="return-"></div>
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
<b>spec</b>
|
<b>spec</b>
|
||||||
@@ -1412,7 +1517,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
<span style="color: purple">complex</span>
|
<span style="color: purple">complex</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>success</td>
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Specific attributes of the object. Will vary based on the <em>api_version</em> and <em>kind</em>.</div>
|
<div>Specific attributes of the object. Will vary based on the <em>api_version</em> and <em>kind</em>.</div>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -1420,6 +1525,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="elbow-placeholder"> </td>
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<div class="ansibleOptionAnchor" id="return-"></div>
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
<b>status</b>
|
<b>status</b>
|
||||||
@@ -1428,7 +1534,40 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
|
|||||||
<span style="color: purple">complex</span>
|
<span style="color: purple">complex</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>success</td>
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
|
<td>
|
||||||
|
<div>Current status details for the object.</div>
|
||||||
|
<br/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>spec</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">complex</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
|
<td>
|
||||||
|
<div>Specific attributes of the object. Will vary based on the <em>api_version</em> and <em>kind</em>.</div>
|
||||||
|
<br/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="elbow-placeholder"> </td>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="return-"></div>
|
||||||
|
<b>status</b>
|
||||||
|
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">complex</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>when O(resource_definition) or O(src) contains a single object.</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Current status details for the object.</div>
|
<div>Current status details for the object.</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@@ -503,7 +503,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -686,7 +686,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -247,6 +247,7 @@ Parameters
|
|||||||
<div>See <a href='https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment'>https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment</a></div>
|
<div>See <a href='https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment'>https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment</a></div>
|
||||||
<div>If more than one <code>merge_type</code> is given, the merge_types will be tried in order</div>
|
<div>If more than one <code>merge_type</code> is given, the merge_types will be tried in order</div>
|
||||||
<div>This defaults to <code>['strategic-merge', 'merge']</code>, which is ideal for using the same parameters on resource kinds that combine Custom Resources and built-in resources.</div>
|
<div>This defaults to <code>['strategic-merge', 'merge']</code>, which is ideal for using the same parameters on resource kinds that combine Custom Resources and built-in resources.</div>
|
||||||
|
<div><em>merge_type=json</em> has been deprecated and will be removed in version 7.0.0. Use <span class='module'>kubernetes.core.k8s_json_patch</span> instead.</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -614,7 +615,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -541,7 +541,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
@@ -383,6 +383,7 @@ Examples
|
|||||||
# and requires python to be installed in the image
|
# and requires python to be installed in the image
|
||||||
- name: Run a command in a pod
|
- name: Run a command in a pod
|
||||||
ansible.builtin.command: echo "Hello, World!"
|
ansible.builtin.command: echo "Hello, World!"
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Run a command in a pod using local kubectl with inventory variables
|
- name: Run a command in a pod using local kubectl with inventory variables
|
||||||
# Example inventory:
|
# Example inventory:
|
||||||
@@ -407,6 +408,7 @@ Examples
|
|||||||
# and requires python to be installed in the image
|
# and requires python to be installed in the image
|
||||||
- name: Run a command in a pod
|
- name: Run a command in a pod
|
||||||
ansible.builtin.command: echo "Hello, World!"
|
ansible.builtin.command: echo "Hello, World!"
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Run a command in a pod using dynamic inventory
|
- name: Run a command in a pod using dynamic inventory
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
@@ -440,6 +442,7 @@ Examples
|
|||||||
# be aware that the command is executed as the user that started the container
|
# be aware that the command is executed as the user that started the container
|
||||||
# and requires python to be installed in the image
|
# and requires python to be installed in the image
|
||||||
ansible.builtin.command: echo "Hello, World!"
|
ansible.builtin.command: echo "Hello, World!"
|
||||||
|
changed_when: false
|
||||||
delegate_to: "{{ my_app_pod_name }}"
|
delegate_to: "{{ my_app_pod_name }}"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ Examples
|
|||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
-------------
|
-------------
|
||||||
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this lookup:
|
Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this lookup:
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ tags:
|
|||||||
- openshift
|
- openshift
|
||||||
- okd
|
- okd
|
||||||
- cluster
|
- cluster
|
||||||
version: 5.4.2
|
version: 5.5.0
|
||||||
build_ignore:
|
build_ignore:
|
||||||
- .DS_Store
|
- .DS_Store
|
||||||
- "*.tar.gz"
|
- "*.tar.gz"
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
kubernetes-client [platform:fedora]
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
version: 3
|
||||||
|
dependencies:
|
||||||
|
python: requirements.txt
|
||||||
|
system: meta/ee-bindep.txt
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
requires_ansible: '>=2.15.0'
|
requires_ansible: '>=2.16.0'
|
||||||
|
|
||||||
action_groups:
|
action_groups:
|
||||||
helm:
|
helm:
|
||||||
|
|||||||
@@ -35,7 +35,11 @@ def _from_yaml_to_definition(buffer):
|
|||||||
import yaml
|
import yaml
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise AnsibleError("Failed to import the required Python library (PyYAML).")
|
raise AnsibleError("Failed to import the required Python library (PyYAML).")
|
||||||
return list(yaml.safe_load_all(buffer))
|
|
||||||
|
# Handle empty template output
|
||||||
|
if buffer is None:
|
||||||
|
return []
|
||||||
|
return [doc for doc in yaml.safe_load_all(buffer) if doc is not None]
|
||||||
|
|
||||||
|
|
||||||
ENV_KUBECONFIG_PATH_SEPARATOR = ";" if platform.system() == "Windows" else ":"
|
ENV_KUBECONFIG_PATH_SEPARATOR = ";" if platform.system() == "Windows" else ":"
|
||||||
@@ -380,10 +384,15 @@ class ActionModule(ActionBase):
|
|||||||
template = self._task.args.get("template", None)
|
template = self._task.args.get("template", None)
|
||||||
if template:
|
if template:
|
||||||
self.load_template(template, new_module_args, task_vars)
|
self.load_template(template, new_module_args, task_vars)
|
||||||
|
# If template rendered to empty definition, return early with no changes
|
||||||
|
if not new_module_args.get("definition"):
|
||||||
|
result["changed"] = False
|
||||||
|
return self._ensure_invocation(result)
|
||||||
|
|
||||||
local_path = self._task.args.get("local_path")
|
local_path = self._task.args.get("local_path")
|
||||||
state = self._task.args.get("state", None)
|
state = self._task.args.get("state", None)
|
||||||
if local_path and state == "to_pod" and not remote_transport:
|
is_local_pod_upload = local_path and state == "to_pod" and not remote_transport
|
||||||
|
if is_local_pod_upload:
|
||||||
new_module_args["local_path"] = self.get_file_realpath(local_path)
|
new_module_args["local_path"] = self.get_file_realpath(local_path)
|
||||||
|
|
||||||
# Execute the k8s_* module.
|
# Execute the k8s_* module.
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ EXAMPLES = r"""
|
|||||||
# and requires python to be installed in the image
|
# and requires python to be installed in the image
|
||||||
- name: Run a command in a pod
|
- name: Run a command in a pod
|
||||||
ansible.builtin.command: echo "Hello, World!"
|
ansible.builtin.command: echo "Hello, World!"
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Run a command in a pod using local kubectl with inventory variables
|
- name: Run a command in a pod using local kubectl with inventory variables
|
||||||
# Example inventory:
|
# Example inventory:
|
||||||
@@ -220,6 +221,7 @@ EXAMPLES = r"""
|
|||||||
# and requires python to be installed in the image
|
# and requires python to be installed in the image
|
||||||
- name: Run a command in a pod
|
- name: Run a command in a pod
|
||||||
ansible.builtin.command: echo "Hello, World!"
|
ansible.builtin.command: echo "Hello, World!"
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Run a command in a pod using dynamic inventory
|
- name: Run a command in a pod using dynamic inventory
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
@@ -253,6 +255,7 @@ EXAMPLES = r"""
|
|||||||
# be aware that the command is executed as the user that started the container
|
# be aware that the command is executed as the user that started the container
|
||||||
# and requires python to be installed in the image
|
# and requires python to be installed in the image
|
||||||
ansible.builtin.command: echo "Hello, World!"
|
ansible.builtin.command: echo "Hello, World!"
|
||||||
|
changed_when: false
|
||||||
delegate_to: "{{ my_app_pod_name }}"
|
delegate_to: "{{ my_app_pod_name }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -262,11 +265,11 @@ import os.path
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
from shlex import quote as shlex_quote
|
||||||
|
|
||||||
from ansible.errors import AnsibleError, AnsibleFileNotFound
|
from ansible.errors import AnsibleError, AnsibleFileNotFound
|
||||||
from ansible.module_utils._text import to_bytes
|
from ansible.module_utils._text import to_bytes
|
||||||
from ansible.module_utils.parsing.convert_bool import boolean
|
from ansible.module_utils.parsing.convert_bool import boolean
|
||||||
from ansible.module_utils.six.moves import shlex_quote
|
|
||||||
from ansible.parsing.yaml.loader import AnsibleLoader
|
from ansible.parsing.yaml.loader import AnsibleLoader
|
||||||
from ansible.plugins.connection import BUFSIZE, ConnectionBase
|
from ansible.plugins.connection import BUFSIZE, ConnectionBase
|
||||||
from ansible.utils.display import Display
|
from ansible.utils.display import Display
|
||||||
|
|||||||
@@ -211,26 +211,58 @@ RETURN = """
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
|
from ansible.module_utils.ansible_release import __version__ as ansible_version
|
||||||
from ansible.module_utils.common._collections_compat import KeysView
|
from ansible.module_utils.common._collections_compat import KeysView
|
||||||
from ansible.module_utils.common.validation import check_type_bool
|
from ansible.module_utils.common.validation import check_type_bool
|
||||||
|
from ansible.utils.display import Display
|
||||||
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.client import (
|
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.client import (
|
||||||
get_api_client,
|
get_api_client,
|
||||||
)
|
)
|
||||||
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.resource import (
|
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.resource import (
|
||||||
create_definitions,
|
create_definitions,
|
||||||
)
|
)
|
||||||
|
from ansible_collections.kubernetes.core.plugins.module_utils.version import (
|
||||||
|
LooseVersion,
|
||||||
|
)
|
||||||
|
|
||||||
|
display = Display()
|
||||||
|
|
||||||
|
# cloud.common declares requires_ansible '>=2.15.0,<2.19'. On newer ansible-core the
|
||||||
|
# import still succeeds, so the version has to be checked explicitly: relying on
|
||||||
|
# ImportError alone lets turbo mode fail later with an unrelated traceback.
|
||||||
|
TURBO_UNSUPPORTED_CORE = "2.19.0"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
enable_turbo_mode = check_type_bool(os.environ.get("ENABLE_TURBO_MODE"))
|
enable_turbo_mode = check_type_bool(os.environ.get("ENABLE_TURBO_MODE"))
|
||||||
except TypeError:
|
except TypeError:
|
||||||
enable_turbo_mode = False
|
enable_turbo_mode = False
|
||||||
|
|
||||||
|
if enable_turbo_mode:
|
||||||
|
display.deprecated(
|
||||||
|
"ENABLE_TURBO_MODE is deprecated, as it relies on the cloud.common "
|
||||||
|
"collection which is being retired. Setting this environment "
|
||||||
|
"variable will have no effect once support is removed.",
|
||||||
|
version="8.0.0",
|
||||||
|
collection_name="kubernetes.core",
|
||||||
|
)
|
||||||
|
if LooseVersion(ansible_version) >= LooseVersion(TURBO_UNSUPPORTED_CORE):
|
||||||
|
display.warning(
|
||||||
|
"ENABLE_TURBO_MODE is ignored on ansible-core %s: Ansible Turbo mode requires "
|
||||||
|
"the cloud.common collection, which supports ansible-core < %s only. "
|
||||||
|
"Continuing without Turbo mode." % (ansible_version, TURBO_UNSUPPORTED_CORE)
|
||||||
|
)
|
||||||
|
enable_turbo_mode = False
|
||||||
|
|
||||||
if enable_turbo_mode:
|
if enable_turbo_mode:
|
||||||
try:
|
try:
|
||||||
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
|
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
|
||||||
TurboLookupBase as LookupBase,
|
TurboLookupBase as LookupBase,
|
||||||
)
|
)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
display.warning(
|
||||||
|
"ENABLE_TURBO_MODE is set but the cloud.common collection is not installed. "
|
||||||
|
"Continuing without Turbo mode."
|
||||||
|
)
|
||||||
from ansible.plugins.lookup import LookupBase # noqa: F401
|
from ansible.plugins.lookup import LookupBase # noqa: F401
|
||||||
else:
|
else:
|
||||||
from ansible.plugins.lookup import LookupBase # noqa: F401
|
from ansible.plugins.lookup import LookupBase # noqa: F401
|
||||||
|
|||||||
@@ -5,13 +5,39 @@ __metaclass__ = type
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from ansible.module_utils.ansible_release import __version__ as ansible_version
|
||||||
from ansible.module_utils.common.validation import check_type_bool
|
from ansible.module_utils.common.validation import check_type_bool
|
||||||
|
from ansible.module_utils.common.warnings import deprecate, warn
|
||||||
|
from ansible_collections.kubernetes.core.plugins.module_utils.version import (
|
||||||
|
LooseVersion,
|
||||||
|
)
|
||||||
|
|
||||||
|
# cloud.common declares requires_ansible '>=2.15.0,<2.19'. On newer ansible-core the
|
||||||
|
# import still succeeds, so the version has to be checked explicitly: relying on
|
||||||
|
# ImportError alone lets turbo mode fail later with an unrelated traceback.
|
||||||
|
TURBO_UNSUPPORTED_CORE = "2.19.0"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
enable_turbo_mode = check_type_bool(os.environ.get("ENABLE_TURBO_MODE"))
|
enable_turbo_mode = check_type_bool(os.environ.get("ENABLE_TURBO_MODE"))
|
||||||
except TypeError:
|
except TypeError:
|
||||||
enable_turbo_mode = False
|
enable_turbo_mode = False
|
||||||
|
|
||||||
|
if enable_turbo_mode:
|
||||||
|
deprecate(
|
||||||
|
"ENABLE_TURBO_MODE is deprecated, as it relies on the cloud.common collection "
|
||||||
|
"which is being retired. Setting this environment variable will have no effect "
|
||||||
|
"once support is removed.",
|
||||||
|
version="8.0.0",
|
||||||
|
collection_name="kubernetes.core",
|
||||||
|
)
|
||||||
|
if LooseVersion(ansible_version) >= LooseVersion(TURBO_UNSUPPORTED_CORE):
|
||||||
|
warn(
|
||||||
|
"ENABLE_TURBO_MODE is ignored on ansible-core %s: Ansible Turbo mode requires "
|
||||||
|
"the cloud.common collection, which supports ansible-core < %s only. "
|
||||||
|
"Continuing without Turbo mode." % (ansible_version, TURBO_UNSUPPORTED_CORE)
|
||||||
|
)
|
||||||
|
enable_turbo_mode = False
|
||||||
|
|
||||||
if enable_turbo_mode:
|
if enable_turbo_mode:
|
||||||
try:
|
try:
|
||||||
from ansible_collections.cloud.common.plugins.module_utils.turbo.module import ( # noqa: F401
|
from ansible_collections.cloud.common.plugins.module_utils.turbo.module import ( # noqa: F401
|
||||||
@@ -20,6 +46,10 @@ if enable_turbo_mode:
|
|||||||
|
|
||||||
AnsibleModule.collection_name = "kubernetes.core"
|
AnsibleModule.collection_name = "kubernetes.core"
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
warn(
|
||||||
|
"ENABLE_TURBO_MODE is set but the cloud.common collection is not installed. "
|
||||||
|
"Continuing without Turbo mode."
|
||||||
|
)
|
||||||
from ansible.module_utils.basic import AnsibleModule # noqa: F401
|
from ansible.module_utils.basic import AnsibleModule # noqa: F401
|
||||||
else:
|
else:
|
||||||
from ansible.module_utils.basic import AnsibleModule # noqa: F401
|
from ansible.module_utils.basic import AnsibleModule # noqa: F401
|
||||||
|
|||||||
+18
-3
@@ -183,7 +183,7 @@ options:
|
|||||||
wait_timeout:
|
wait_timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout when wait option is enabled (helm2 is a number of seconds, helm3 is a duration).
|
- Timeout when wait option is enabled (helm2 is a number of seconds, helm3 is a duration).
|
||||||
- The use of I(wait_timeout) to wait for kubernetes commands to complete has been deprecated and will be removed after 2022-12-01.
|
- The use of I(wait_timeout) to wait for kubernetes commands to complete has been deprecated and will be removed in version 7.0.0. Use O(timeout) instead.
|
||||||
type: str
|
type: str
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
@@ -396,8 +396,8 @@ status:
|
|||||||
returned: always
|
returned: always
|
||||||
description:
|
description:
|
||||||
- Dict of Values used to deploy.
|
- Dict of Values used to deploy.
|
||||||
- This return value has been deprecated and will be removed in a release after
|
- This return value has been deprecated and will be removed in version 8.0.0.
|
||||||
2027-01-08. Use RV(status.release_values) instead.
|
Use RV(status.release_values) instead.
|
||||||
release_values:
|
release_values:
|
||||||
type: dict
|
type: dict
|
||||||
returned: always
|
returned: always
|
||||||
@@ -486,6 +486,13 @@ def get_release_status(module, release_name, all_status=False):
|
|||||||
release["release_values"] = module.get_values(release_name)
|
release["release_values"] = module.get_values(release_name)
|
||||||
release["values"] = release["release_values"]
|
release["values"] = release["release_values"]
|
||||||
|
|
||||||
|
# Add deprecation warning for status.values
|
||||||
|
module.deprecate(
|
||||||
|
"The 'status.values' return value is deprecated and will be removed in version 8.0.0. Use 'status.release_values' instead.",
|
||||||
|
version="8.0.0",
|
||||||
|
collection_name="kubernetes.core",
|
||||||
|
)
|
||||||
|
|
||||||
return release
|
return release
|
||||||
|
|
||||||
|
|
||||||
@@ -839,6 +846,14 @@ def main():
|
|||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Add deprecation warning for wait_timeout
|
||||||
|
if module.params.get("wait_timeout") is not None:
|
||||||
|
module.deprecate(
|
||||||
|
"The 'wait_timeout' parameter is deprecated and will be removed in version 7.0.0. Use 'timeout' instead.",
|
||||||
|
version="7.0.0",
|
||||||
|
collection_name="kubernetes.core",
|
||||||
|
)
|
||||||
|
|
||||||
if not IMP_YAML:
|
if not IMP_YAML:
|
||||||
module.fail_json(msg=missing_required_lib("yaml"), exception=IMP_YAML_ERR)
|
module.fail_json(msg=missing_required_lib("yaml"), exception=IMP_YAML_ERR)
|
||||||
|
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ status:
|
|||||||
returned: always
|
returned: always
|
||||||
description:
|
description:
|
||||||
- Dict of Values used to deploy
|
- Dict of Values used to deploy
|
||||||
- This return value has been deprecated and will be removed in a release after
|
- This return value has been deprecated and will be removed in version 8.0.0.
|
||||||
2027-01-08. Use RV(status.release_values) instead.
|
Use RV(status.release_values) instead.
|
||||||
release_values:
|
release_values:
|
||||||
type: dict
|
type: dict
|
||||||
returned: always
|
returned: always
|
||||||
@@ -213,6 +213,14 @@ def get_release_status(module, release_name, release_state, get_all_values=False
|
|||||||
|
|
||||||
release["release_values"] = module.get_values(release_name, get_all_values)
|
release["release_values"] = module.get_values(release_name, get_all_values)
|
||||||
release["values"] = release["release_values"]
|
release["values"] = release["release_values"]
|
||||||
|
|
||||||
|
# Add deprecation warning for status.values
|
||||||
|
module.deprecate(
|
||||||
|
"The 'status.values' return value is deprecated and will be removed in version 8.0.0. Use 'status.release_values' instead.",
|
||||||
|
version="8.0.0",
|
||||||
|
collection_name="kubernetes.core",
|
||||||
|
)
|
||||||
|
|
||||||
release["manifest"] = module.get_manifest(release_name)
|
release["manifest"] = module.get_manifest(release_name)
|
||||||
release["notes"] = module.get_notes(release_name)
|
release["notes"] = module.get_notes(release_name)
|
||||||
release["hooks"] = module.get_hooks(release_name)
|
release["hooks"] = module.get_hooks(release_name)
|
||||||
|
|||||||
@@ -302,6 +302,8 @@ def main():
|
|||||||
|
|
||||||
repo_name = module.params.get("repo_name")
|
repo_name = module.params.get("repo_name")
|
||||||
repo_url = module.params.get("repo_url")
|
repo_url = module.params.get("repo_url")
|
||||||
|
if repo_url:
|
||||||
|
repo_url = repo_url.rstrip("/")
|
||||||
repo_username = module.params.get("repo_username")
|
repo_username = module.params.get("repo_username")
|
||||||
repo_password = module.params.get("repo_password")
|
repo_password = module.params.get("repo_password")
|
||||||
repo_state = module.params.get("repo_state")
|
repo_state = module.params.get("repo_state")
|
||||||
@@ -329,7 +331,7 @@ def main():
|
|||||||
insecure_skip_tls_verify,
|
insecure_skip_tls_verify,
|
||||||
)
|
)
|
||||||
changed = True
|
changed = True
|
||||||
elif repository_status["url"] != repo_url:
|
elif repository_status["url"].rstrip("/") != repo_url:
|
||||||
module.fail_json(
|
module.fail_json(
|
||||||
msg="Repository already have a repository named {0}".format(repo_name)
|
msg="Repository already have a repository named {0}".format(repo_name)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -214,21 +214,21 @@ def filter_pods(pods, force, ignore_daemonset, delete_emptydir_data):
|
|||||||
to_delete.append((pod.metadata.namespace, pod.metadata.name))
|
to_delete.append((pod.metadata.namespace, pod.metadata.name))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Pod with local storage cannot be deleted
|
|
||||||
if pod.spec.volumes and any(vol.empty_dir for vol in pod.spec.volumes):
|
|
||||||
localStorage.append((pod.metadata.namespace, pod.metadata.name))
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Check replicated Pod
|
# Check replicated Pod
|
||||||
owner_ref = pod.metadata.owner_references
|
owner_ref = pod.metadata.owner_references or []
|
||||||
if not owner_ref:
|
has_local_storage = bool(
|
||||||
|
pod.spec.volumes and any(vol.empty_dir for vol in pod.spec.volumes)
|
||||||
|
)
|
||||||
|
is_daemonset_managed = any(owner.kind == "DaemonSet" for owner in owner_ref)
|
||||||
|
|
||||||
|
if is_daemonset_managed:
|
||||||
|
daemonSet.append((pod.metadata.namespace, pod.metadata.name))
|
||||||
|
elif has_local_storage:
|
||||||
|
localStorage.append((pod.metadata.namespace, pod.metadata.name))
|
||||||
|
elif not owner_ref:
|
||||||
unmanaged.append((pod.metadata.namespace, pod.metadata.name))
|
unmanaged.append((pod.metadata.namespace, pod.metadata.name))
|
||||||
else:
|
else:
|
||||||
for owner in owner_ref:
|
to_delete.append((pod.metadata.namespace, pod.metadata.name))
|
||||||
if owner.kind == "DaemonSet":
|
|
||||||
daemonSet.append((pod.metadata.namespace, pod.metadata.name))
|
|
||||||
else:
|
|
||||||
to_delete.append((pod.metadata.namespace, pod.metadata.name))
|
|
||||||
|
|
||||||
warnings, errors = [], []
|
warnings, errors = [], []
|
||||||
if unmanaged:
|
if unmanaged:
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ result:
|
|||||||
type: int
|
type: int
|
||||||
version_added: 2.2.0
|
version_added: 2.2.0
|
||||||
return_code:
|
return_code:
|
||||||
description: The command status code. This attribute is deprecated and will be removed in a future release. Please use rc instead.
|
description: The command status code. This attribute is deprecated and will be removed in version 7.0.0. Use RV(result.rc) instead.
|
||||||
type: int
|
type: int
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -219,6 +219,13 @@ def execute_module(module, client):
|
|||||||
else:
|
else:
|
||||||
rc = int(err["details"]["causes"][0]["message"])
|
rc = int(err["details"]["causes"][0]["message"])
|
||||||
|
|
||||||
|
# Add deprecation warning for return_code return value
|
||||||
|
module.deprecate(
|
||||||
|
"The 'return_code' return value is deprecated and will be removed in version 7.0.0. Use 'rc' instead.",
|
||||||
|
version="7.0.0",
|
||||||
|
collection_name="kubernetes.core",
|
||||||
|
)
|
||||||
|
|
||||||
module.exit_json(
|
module.exit_json(
|
||||||
# Some command might change environment, but ultimately failing at end
|
# Some command might change environment, but ultimately failing at end
|
||||||
changed=True,
|
changed=True,
|
||||||
|
|||||||
@@ -120,6 +120,21 @@ EXAMPLES = r"""
|
|||||||
namespace: default
|
namespace: default
|
||||||
wait_sleep: 10
|
wait_sleep: 10
|
||||||
wait_timeout: 360
|
wait_timeout: 360
|
||||||
|
|
||||||
|
- name: Wait for OpenShift bootstrap to complete
|
||||||
|
kubernetes.core.k8s_info:
|
||||||
|
api_version: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
name: bootstrap
|
||||||
|
namespace: kube-system
|
||||||
|
register: ocp_bootstrap_status
|
||||||
|
until: >
|
||||||
|
ocp_bootstrap_status.resources is defined and
|
||||||
|
(ocp_bootstrap_status.resources | length > 0) and
|
||||||
|
(ocp_bootstrap_status.resources[0].data.status is defined) and
|
||||||
|
(ocp_bootstrap_status.resources[0].data.status == 'complete')
|
||||||
|
retries: 60
|
||||||
|
delay: 15
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = r"""
|
RETURN = r"""
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ options:
|
|||||||
- If more than one C(merge_type) is given, the merge_types will be tried in order
|
- If more than one C(merge_type) is given, the merge_types will be tried in order
|
||||||
- This defaults to C(['strategic-merge', 'merge']), which is ideal for using the same parameters
|
- This defaults to C(['strategic-merge', 'merge']), which is ideal for using the same parameters
|
||||||
on resource kinds that combine Custom Resources and built-in resources.
|
on resource kinds that combine Custom Resources and built-in resources.
|
||||||
|
- I(merge_type=json) has been deprecated and will be removed in version 7.0.0. Use M(kubernetes.core.k8s_json_patch) instead.
|
||||||
choices:
|
choices:
|
||||||
- json
|
- json
|
||||||
- merge
|
- merge
|
||||||
@@ -251,6 +252,15 @@ def main():
|
|||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Add deprecation warning for merge_type=json
|
||||||
|
merge_type = module.params.get("merge_type")
|
||||||
|
if merge_type and "json" in merge_type:
|
||||||
|
module.deprecate(
|
||||||
|
"The 'merge_type=json' option is deprecated and will be removed in version 7.0.0. Use the 'kubernetes.core.k8s_json_patch' module instead.",
|
||||||
|
version="7.0.0",
|
||||||
|
collection_name="kubernetes.core",
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
client = get_api_client(module=module)
|
client = get_api_client(module=module)
|
||||||
svc = K8sService(client, module)
|
svc = K8sService(client, module)
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
# SonarCloud project configuration for kubernetes.core
|
||||||
|
# Parameters: https://docs.sonarqube.org/latest/analysis/analysis-parameters/
|
||||||
|
|
||||||
|
sonar.projectKey=ansible-collections_kubernetes.core
|
||||||
|
sonar.organization=ansible-collections
|
||||||
|
sonar.sources=.
|
||||||
|
sonar.projectName=kubernetes.core
|
||||||
|
sonar.python.coverage.reportPaths=coverage.xml
|
||||||
|
|
||||||
|
sonar.tests=tests/unit,tests/integration
|
||||||
|
sonar.python.version=3.12
|
||||||
|
sonar.newCode.referenceBranch=stable-5
|
||||||
|
|
||||||
|
sonar.exclusions=tests/**,.tox/**
|
||||||
|
|
||||||
|
# Exclude test code from copy/paste detection. 'sonar.exclusions' above only
|
||||||
|
# filters the *source* set (it disambiguates 'sonar.sources=.' from
|
||||||
|
# 'sonar.tests'), so test files are still indexed as tests and still scored for
|
||||||
|
# duplication. Unit tests here are unittest.TestCase classes: every class needs
|
||||||
|
# its own setUp, and per-case arrange/assert blocks are deliberately repeated so
|
||||||
|
# a failing test reads on its own. Because SonarCloud scores only *new code* on
|
||||||
|
# a pull request, any PR adding cases to an already-repetitive test module
|
||||||
|
# inherits duplication accrued across earlier PRs. Production code under
|
||||||
|
# plugins/ stays fully covered by duplication analysis.
|
||||||
|
sonar.cpd.exclusions=tests/**
|
||||||
|
|
||||||
|
# Ansible module argument_spec is conventionally defined with the dict(...)
|
||||||
|
# constructor (not {...} literals) for readability and consistency across the
|
||||||
|
# collection. Suppress python:S7498 ("prefer literal syntax"), which conflicts
|
||||||
|
# with that convention and otherwise re-fires on every new module argument.
|
||||||
|
sonar.issue.ignore.multicriteria=e1,e2,e3
|
||||||
|
sonar.issue.ignore.multicriteria.e1.ruleKey=python:S7498
|
||||||
|
sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.py
|
||||||
|
|
||||||
|
# Unit tests pass hardcoded '/tmp/...' strings as fake module arguments (e.g.
|
||||||
|
# chart_ref) to fully mocked commands; no file is ever created there. Suppress
|
||||||
|
# python:S5443 ("temporary files in publicly writable directories") for test
|
||||||
|
# code only. Production code creates temp files via tempfile.mkstemp /
|
||||||
|
# NamedTemporaryFile and stays covered by the rule.
|
||||||
|
sonar.issue.ignore.multicriteria.e2.ruleKey=python:S5443
|
||||||
|
sonar.issue.ignore.multicriteria.e2.resourceKey=tests/**/*.py
|
||||||
|
|
||||||
|
# GitHub Actions workflows in this repo use @main for internal reusable actions
|
||||||
|
# (ansible-network/github_actions, ansible-collections/cloud-content-ci-automation)
|
||||||
|
# to simplify maintenance. Suppress githubactions:S7637 ("use full commit SHA").
|
||||||
|
sonar.issue.ignore.multicriteria.e3.ruleKey=githubactions:S7637
|
||||||
|
sonar.issue.ignore.multicriteria.e3.resourceKey=.github/workflows/**/*.yaml
|
||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
modules:
|
modules:
|
||||||
python_requires: ">=3.6"
|
python_requires: ">=3.9"
|
||||||
|
|||||||
@@ -239,6 +239,7 @@
|
|||||||
vars:
|
vars:
|
||||||
chart_local_path: '{{ _tmpd.path }}/test-chart-deployment-time'
|
chart_local_path: '{{ _tmpd.path }}/test-chart-deployment-time'
|
||||||
chart_repo_path: 'testing'
|
chart_repo_path: 'testing'
|
||||||
|
helm_binary_path: "{{ helm_binary }}"
|
||||||
always:
|
always:
|
||||||
- name: Delete temporary directory
|
- name: Delete temporary directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
username: testuser
|
username: testuser
|
||||||
password: testpassword
|
password: testpassword
|
||||||
wrong_password: 'WrongPassword'
|
wrong_password: 'WrongPassword'
|
||||||
|
# Use the helm binary installed by the install_helm role rather than the one
|
||||||
|
# shipped with the CI image, whose version is outside of our control.
|
||||||
|
helm_binary: "/tmp/helm/{{ ansible_system | lower }}-amd64/helm"
|
||||||
registry_name: oci_registry
|
registry_name: oci_registry
|
||||||
registry_port: 5000
|
registry_port: 5000
|
||||||
test_chart: https://github.com/grafana/helm-charts/releases/download/k8s-monitoring-1.6.8/k8s-monitoring-1.6.8.tgz
|
test_chart: https://github.com/grafana/helm-charts/releases/download/k8s-monitoring-1.6.8/k8s-monitoring-1.6.8.tgz
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# and it allow to not install any additional dependencies
|
# and it allow to not install any additional dependencies
|
||||||
block:
|
block:
|
||||||
- name: Ensure that helm is installed
|
- name: Ensure that helm is installed
|
||||||
ansible.builtin.shell: helm version --client --short | grep v3
|
ansible.builtin.shell: "{{ helm_binary }} version --client --short | grep v3"
|
||||||
register: _helm_version
|
register: _helm_version
|
||||||
failed_when: _helm_version.rc != 0
|
failed_when: _helm_version.rc != 0
|
||||||
|
|
||||||
@@ -44,14 +44,14 @@
|
|||||||
|
|
||||||
- name: Test the registry with correct credentials to ensure that the registry is running
|
- name: Test the registry with correct credentials to ensure that the registry is running
|
||||||
ansible.builtin.shell: >-
|
ansible.builtin.shell: >-
|
||||||
echo {{ password | quote }} | helm registry login localhost:{{ registry_port }}
|
echo {{ password | quote }} | {{ helm_binary }} registry login localhost:{{ registry_port }}
|
||||||
-u {{ username }} --password-stdin
|
-u {{ username }} --password-stdin
|
||||||
register: _login_correct
|
register: _login_correct
|
||||||
failed_when: _login_correct.rc != 0
|
failed_when: _login_correct.rc != 0
|
||||||
|
|
||||||
- name: Clean up credentials to run test on clean environment
|
- name: Clean up credentials to run test on clean environment
|
||||||
ansible.builtin.shell: >-
|
ansible.builtin.shell: >-
|
||||||
helm registry logout localhost:{{ registry_port }}
|
{{ helm_binary }} registry logout localhost:{{ registry_port }}
|
||||||
register: _logout
|
register: _logout
|
||||||
failed_when: _logout.rc != 0
|
failed_when: _logout.rc != 0
|
||||||
|
|
||||||
@@ -70,6 +70,7 @@
|
|||||||
|
|
||||||
- name: Test module helm_registry_auth with correct credentials
|
- name: Test module helm_registry_auth with correct credentials
|
||||||
helm_registry_auth:
|
helm_registry_auth:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
username: "{{ username }}"
|
username: "{{ username }}"
|
||||||
password: "{{ password }}"
|
password: "{{ password }}"
|
||||||
host: localhost:{{ registry_port }}
|
host: localhost:{{ registry_port }}
|
||||||
@@ -87,7 +88,7 @@
|
|||||||
|
|
||||||
- name: Ensure that push to the registry is working
|
- name: Ensure that push to the registry is working
|
||||||
ansible.builtin.shell: >-
|
ansible.builtin.shell: >-
|
||||||
helm push "{{ _destination.path }}/k8s-monitoring-1.6.8.tgz" oci://localhost:{{ registry_port }}/test/
|
{{ helm_binary }} push "{{ _destination.path }}/k8s-monitoring-1.6.8.tgz" oci://localhost:{{ registry_port }}/test/
|
||||||
register: _save_chart
|
register: _save_chart
|
||||||
failed_when: _save_chart.rc != 0
|
failed_when: _save_chart.rc != 0
|
||||||
|
|
||||||
@@ -99,6 +100,7 @@
|
|||||||
|
|
||||||
- name: Test logout
|
- name: Test logout
|
||||||
helm_registry_auth:
|
helm_registry_auth:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
host: localhost:{{ registry_port }}
|
host: localhost:{{ registry_port }}
|
||||||
state: absent
|
state: absent
|
||||||
register: _helm_registry_auth_logout
|
register: _helm_registry_auth_logout
|
||||||
@@ -114,6 +116,7 @@
|
|||||||
|
|
||||||
- name: Test logout idempotency
|
- name: Test logout idempotency
|
||||||
helm_registry_auth:
|
helm_registry_auth:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
host: localhost:{{ registry_port }}
|
host: localhost:{{ registry_port }}
|
||||||
state: absent
|
state: absent
|
||||||
register: _helm_registry_auth_logout_idempotency
|
register: _helm_registry_auth_logout_idempotency
|
||||||
@@ -124,7 +127,7 @@
|
|||||||
|
|
||||||
- name: Ensure that not able to push to the registry
|
- name: Ensure that not able to push to the registry
|
||||||
ansible.builtin.shell: >-
|
ansible.builtin.shell: >-
|
||||||
helm push "{{ _destination.path }}/k8s-monitoring-1.6.8.tgz" oci://localhost:{{ registry_port }}/test/
|
{{ helm_binary }} push "{{ _destination.path }}/k8s-monitoring-1.6.8.tgz" oci://localhost:{{ registry_port }}/test/
|
||||||
register: _save_chart
|
register: _save_chart
|
||||||
failed_when: _save_chart.rc == 0
|
failed_when: _save_chart.rc == 0
|
||||||
|
|
||||||
@@ -143,6 +146,7 @@
|
|||||||
|
|
||||||
- name: Test module helm_registry_auth with wrong credentials
|
- name: Test module helm_registry_auth with wrong credentials
|
||||||
helm_registry_auth:
|
helm_registry_auth:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
username: "{{ username }}"
|
username: "{{ username }}"
|
||||||
password: "{{ wrong_password }}"
|
password: "{{ wrong_password }}"
|
||||||
host: localhost:{{ registry_port }}
|
host: localhost:{{ registry_port }}
|
||||||
|
|||||||
@@ -99,3 +99,81 @@
|
|||||||
binary_path: "{{ helm_binary }}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test_helm_repo
|
name: test_helm_repo
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
# https://github.com/ansible-collections/kubernetes.core/issues/1235
|
||||||
|
- name: Ensure the trailing slash test repositories don't exist
|
||||||
|
helm_repository:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop:
|
||||||
|
- test_helm_repo_slash
|
||||||
|
- test_helm_repo_noslash
|
||||||
|
|
||||||
|
- name: Register test_helm_repo_slash directly through helm, keeping the trailing slash
|
||||||
|
ansible.builtin.command: "{{ helm_binary }} repo add test_helm_repo_slash {{ chart_test_repo }}/"
|
||||||
|
changed_when: true
|
||||||
|
|
||||||
|
- name: Add test_helm_repo_noslash chart repository without a trailing slash
|
||||||
|
helm_repository:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
|
name: test_helm_repo_noslash
|
||||||
|
repo_url: "{{ chart_test_repo }}"
|
||||||
|
|
||||||
|
- name: Check idempotency when the stored and the requested URL both have a trailing slash
|
||||||
|
helm_repository:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
|
name: test_helm_repo_slash
|
||||||
|
repo_url: "{{ chart_test_repo }}/"
|
||||||
|
register: repository
|
||||||
|
|
||||||
|
- name: Assert idempotency when the stored and the requested URL both have a trailing slash
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- repository is not changed
|
||||||
|
|
||||||
|
- name: Check idempotency when only the stored URL has a trailing slash
|
||||||
|
helm_repository:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
|
name: test_helm_repo_slash
|
||||||
|
repo_url: "{{ chart_test_repo }}"
|
||||||
|
register: repository
|
||||||
|
|
||||||
|
- name: Assert idempotency when only the stored URL has a trailing slash
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- repository is not changed
|
||||||
|
|
||||||
|
- name: Check idempotency when only the requested URL has a trailing slash
|
||||||
|
helm_repository:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
|
name: test_helm_repo_noslash
|
||||||
|
repo_url: "{{ chart_test_repo }}/"
|
||||||
|
register: repository
|
||||||
|
|
||||||
|
- name: Assert idempotency when only the requested URL has a trailing slash
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- repository is not changed
|
||||||
|
|
||||||
|
- name: Failed to add repository with the same name and a different URL, trailing slash aside
|
||||||
|
helm_repository:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
|
name: test_helm_repo_slash
|
||||||
|
repo_url: "https://other-charts.url/"
|
||||||
|
register: repository_errors
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: Assert that adding repository with the same name and a different URL failed
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- repository_errors is failed
|
||||||
|
|
||||||
|
- name: Clean the trailing slash test repositories
|
||||||
|
helm_repository:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop:
|
||||||
|
- test_helm_repo_slash
|
||||||
|
- test_helm_repo_noslash
|
||||||
|
|||||||
@@ -238,7 +238,55 @@
|
|||||||
- resource.result.results | selectattr('changed') | list | length == 1
|
- resource.result.results | selectattr('changed') | list | length == 1
|
||||||
- resource.result.results | selectattr('error', 'defined') | list | length == 1
|
- resource.result.results | selectattr('error', 'defined') | list | length == 1
|
||||||
|
|
||||||
|
- name: Apply template where all items are disabled (empty output)
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
state: present
|
||||||
|
template:
|
||||||
|
path: "conditional_empty.j2"
|
||||||
|
vars:
|
||||||
|
items:
|
||||||
|
- name: test1
|
||||||
|
enabled: false
|
||||||
|
- name: test2
|
||||||
|
enabled: false
|
||||||
|
k8s_pod_namespace: "{{ template_namespace }}"
|
||||||
|
register: r
|
||||||
|
|
||||||
|
- name: Check that empty template succeeds with no changes
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- r is successful
|
||||||
|
- r is not changed
|
||||||
|
|
||||||
|
- name: Apply template where some items are enabled
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
state: present
|
||||||
|
template:
|
||||||
|
path: "conditional_empty.j2"
|
||||||
|
vars:
|
||||||
|
items:
|
||||||
|
- name: conditional-configmap-1
|
||||||
|
enabled: true
|
||||||
|
- name: conditional-configmap-2
|
||||||
|
enabled: false
|
||||||
|
k8s_pod_namespace: "{{ template_namespace }}"
|
||||||
|
register: r
|
||||||
|
|
||||||
|
- name: Check that partial template creates resources
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- r is successful
|
||||||
|
- r is changed
|
||||||
|
|
||||||
always:
|
always:
|
||||||
|
- name: Cleanup conditional configmap
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
state: absent
|
||||||
|
kind: ConfigMap
|
||||||
|
name: conditional-configmap-1
|
||||||
|
namespace: "{{ template_namespace }}"
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Remove namespace (Cleanup)
|
- name: Remove namespace (Cleanup)
|
||||||
kubernetes.core.k8s:
|
kubernetes.core.k8s:
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{% for item in items %}
|
||||||
|
{% if item.enabled %}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
namespace: "{{ k8s_pod_namespace }}"
|
||||||
|
data:
|
||||||
|
key: value
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
|
plugins/module_utils/client/discovery.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.10!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.11!skip
|
plugins/module_utils/client/discovery.py import-3.11!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.12!skip
|
plugins/module_utils/client/discovery.py import-3.12!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.13!skip
|
plugins/module_utils/client/discovery.py import-3.13!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.10!skip
|
||||||
plugins/module_utils/client/resource.py import-3.11!skip
|
plugins/module_utils/client/resource.py import-3.11!skip
|
||||||
plugins/module_utils/client/resource.py import-3.12!skip
|
plugins/module_utils/client/resource.py import-3.12!skip
|
||||||
plugins/module_utils/client/resource.py import-3.13!skip
|
plugins/module_utils/client/resource.py import-3.13!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.9!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.10!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
|
plugins/module_utils/client/discovery.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.10!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.11!skip
|
plugins/module_utils/client/discovery.py import-3.11!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.12!skip
|
plugins/module_utils/client/discovery.py import-3.12!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.13!skip
|
plugins/module_utils/client/discovery.py import-3.13!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.10!skip
|
||||||
plugins/module_utils/client/resource.py import-3.11!skip
|
plugins/module_utils/client/resource.py import-3.11!skip
|
||||||
plugins/module_utils/client/resource.py import-3.12!skip
|
plugins/module_utils/client/resource.py import-3.12!skip
|
||||||
plugins/module_utils/client/resource.py import-3.13!skip
|
plugins/module_utils/client/resource.py import-3.13!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.9!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.10!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
|
plugins/module_utils/client/discovery.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.10!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.11!skip
|
plugins/module_utils/client/discovery.py import-3.11!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.12!skip
|
plugins/module_utils/client/discovery.py import-3.12!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.13!skip
|
plugins/module_utils/client/discovery.py import-3.13!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.14!skip
|
plugins/module_utils/client/discovery.py import-3.14!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.10!skip
|
||||||
plugins/module_utils/client/resource.py import-3.11!skip
|
plugins/module_utils/client/resource.py import-3.11!skip
|
||||||
plugins/module_utils/client/resource.py import-3.12!skip
|
plugins/module_utils/client/resource.py import-3.12!skip
|
||||||
plugins/module_utils/client/resource.py import-3.13!skip
|
plugins/module_utils/client/resource.py import-3.13!skip
|
||||||
plugins/module_utils/client/resource.py import-3.14!skip
|
plugins/module_utils/client/resource.py import-3.14!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.9!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.10!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
|
plugins/module_utils/client/discovery.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.10!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.11!skip
|
plugins/module_utils/client/discovery.py import-3.11!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.12!skip
|
plugins/module_utils/client/discovery.py import-3.12!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.13!skip
|
plugins/module_utils/client/discovery.py import-3.13!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.14!skip
|
plugins/module_utils/client/discovery.py import-3.14!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.10!skip
|
||||||
plugins/module_utils/client/resource.py import-3.11!skip
|
plugins/module_utils/client/resource.py import-3.11!skip
|
||||||
plugins/module_utils/client/resource.py import-3.12!skip
|
plugins/module_utils/client/resource.py import-3.12!skip
|
||||||
plugins/module_utils/client/resource.py import-3.13!skip
|
plugins/module_utils/client/resource.py import-3.13!skip
|
||||||
plugins/module_utils/client/resource.py import-3.14!skip
|
plugins/module_utils/client/resource.py import-3.14!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.9!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.10!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
plugins/module_utils/client/discovery.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.10!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.11!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.12!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.13!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.14!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.15!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.9!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.10!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.11!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.12!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.13!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.14!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.15!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.9!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.10!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.14!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.15!skip
|
||||||
|
plugins/module_utils/version.py pylint!skip
|
||||||
|
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
||||||
|
plugins/modules/k8s_scale.py validate-modules:parameter-type-not-in-doc
|
||||||
|
plugins/modules/k8s_service.py validate-modules:parameter-type-not-in-doc
|
||||||
|
tests/unit/module_utils/fixtures/clusteroperator.yml yamllint!skip
|
||||||
|
tests/unit/module_utils/fixtures/definitions.yml yamllint!skip
|
||||||
|
tests/unit/module_utils/fixtures/deployments.yml yamllint!skip
|
||||||
|
tests/integration/targets/k8s_delete/files/deployments.yaml yamllint!skip
|
||||||
|
tests/unit/module_utils/fixtures/pods.yml yamllint!skip
|
||||||
|
tests/integration/targets/helm/files/appversionless-chart-v2/templates/configmap.yaml yamllint!skip
|
||||||
|
tests/integration/targets/helm/files/appversionless-chart/templates/configmap.yaml yamllint!skip
|
||||||
|
tests/integration/targets/helm/files/test-chart-v2/templates/configmap.yaml yamllint!skip
|
||||||
|
tests/integration/targets/helm/files/test-chart/templates/configmap.yaml yamllint!skip
|
||||||
|
tests/integration/targets/helm_diff/files/test-chart/templates/configmap.yaml yamllint!skip
|
||||||
|
tests/integration/targets/k8s_scale/files/deployment.yaml yamllint!skip
|
||||||
|
plugins/modules/k8s.py validate-modules:return-syntax-error
|
||||||
|
plugins/modules/k8s_scale.py validate-modules:return-syntax-error
|
||||||
|
plugins/modules/k8s_service.py validate-modules:return-syntax-error
|
||||||
|
plugins/modules/k8s_taint.py validate-modules:return-syntax-error
|
||||||
|
tests/integration/targets/helm_diff/files/test-chart-reuse-values/templates/configmap.yaml yamllint!skip
|
||||||
|
tests/integration/targets/helm_diff/files/test-chart-deployment-time/templates/configmap.yaml yamllint!skip
|
||||||
|
plugins/modules/helm.py validate-modules:bad-return-value-key
|
||||||
|
plugins/modules/helm_info.py validate-modules:bad-return-value-key
|
||||||
@@ -57,6 +57,11 @@ def _create_temp_file(content=""):
|
|||||||
return name
|
return name
|
||||||
|
|
||||||
|
|
||||||
|
def _assert_configuration(actual, expected):
|
||||||
|
for key, value in expected.items():
|
||||||
|
assert getattr(actual, key) == value
|
||||||
|
|
||||||
|
|
||||||
def test_create_auth_spec_ssl_no_options():
|
def test_create_auth_spec_ssl_no_options():
|
||||||
module = MagicMock()
|
module = MagicMock()
|
||||||
module.params = {}
|
module.params = {}
|
||||||
@@ -138,13 +143,14 @@ def test_load_kube_config_from_file_path():
|
|||||||
auth = {"kubeconfig": config_file, "context": "simple_token"}
|
auth = {"kubeconfig": config_file, "context": "simple_token"}
|
||||||
actual_configuration = _create_configuration(auth)
|
actual_configuration = _create_configuration(auth)
|
||||||
|
|
||||||
expected_configuration = {
|
_assert_configuration(
|
||||||
"host": TEST_HOST,
|
actual_configuration,
|
||||||
"kubeconfig": config_file,
|
{
|
||||||
"context": "simple_token",
|
"host": TEST_HOST,
|
||||||
}
|
"kubeconfig": config_file,
|
||||||
|
"context": "simple_token",
|
||||||
assert expected_configuration.items() <= actual_configuration.__dict__.items()
|
},
|
||||||
|
)
|
||||||
_remove_temp_file()
|
_remove_temp_file()
|
||||||
|
|
||||||
|
|
||||||
@@ -152,13 +158,14 @@ def test_load_kube_config_from_dict():
|
|||||||
auth_spec = {"kubeconfig": TEST_KUBE_CONFIG, "context": "simple_token"}
|
auth_spec = {"kubeconfig": TEST_KUBE_CONFIG, "context": "simple_token"}
|
||||||
actual_configuration = _create_configuration(auth_spec)
|
actual_configuration = _create_configuration(auth_spec)
|
||||||
|
|
||||||
expected_configuration = {
|
_assert_configuration(
|
||||||
"host": TEST_HOST,
|
actual_configuration,
|
||||||
"kubeconfig": TEST_KUBE_CONFIG,
|
{
|
||||||
"context": "simple_token",
|
"host": TEST_HOST,
|
||||||
}
|
"kubeconfig": TEST_KUBE_CONFIG,
|
||||||
|
"context": "simple_token",
|
||||||
assert expected_configuration.items() <= actual_configuration.__dict__.items()
|
},
|
||||||
|
)
|
||||||
_remove_temp_file()
|
_remove_temp_file()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from ansible.plugins.lookup import LookupBase as StandardLookupBase
|
||||||
|
|
||||||
|
|
||||||
|
class TestK8sTurboMode:
|
||||||
|
"""Test turbo mode version checking in k8s lookup plugin."""
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def cleanup_k8s_module(self):
|
||||||
|
"""Ensure clean module state before each test."""
|
||||||
|
sys.modules.pop("ansible_collections.kubernetes.core.plugins.lookup.k8s", None)
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("ansible_version", ["2.19.0", "2.21.4"])
|
||||||
|
def test_turbo_mode_disabled_on_newer_ansible(self, monkeypatch, ansible_version):
|
||||||
|
"""Test that turbo mode is disabled on ansible-core >= 2.19.0."""
|
||||||
|
monkeypatch.setenv("ENABLE_TURBO_MODE", "true")
|
||||||
|
mock_display = MagicMock()
|
||||||
|
|
||||||
|
with patch.dict(
|
||||||
|
"sys.modules",
|
||||||
|
{
|
||||||
|
"ansible.module_utils.ansible_release": MagicMock(
|
||||||
|
__version__=ansible_version
|
||||||
|
),
|
||||||
|
"ansible.utils.display": MagicMock(Display=lambda: mock_display),
|
||||||
|
},
|
||||||
|
):
|
||||||
|
from ansible_collections.kubernetes.core.plugins.lookup import k8s
|
||||||
|
|
||||||
|
mock_display.deprecated.assert_called()
|
||||||
|
assert (
|
||||||
|
"ENABLE_TURBO_MODE is deprecated"
|
||||||
|
in mock_display.deprecated.call_args[0][0]
|
||||||
|
)
|
||||||
|
|
||||||
|
mock_display.warning.assert_called()
|
||||||
|
assert (
|
||||||
|
f"ENABLE_TURBO_MODE is ignored on ansible-core {ansible_version}"
|
||||||
|
in mock_display.warning.call_args[0][0]
|
||||||
|
)
|
||||||
|
assert "ansible-core < 2.19.0 only" in mock_display.warning.call_args[0][0]
|
||||||
|
|
||||||
|
assert k8s.LookupBase == StandardLookupBase
|
||||||
|
|
||||||
|
def test_turbo_mode_enabled_on_ansible_core_2_18(self, monkeypatch):
|
||||||
|
"""Test that turbo mode is still enabled on ansible-core < 2.19.0."""
|
||||||
|
monkeypatch.setenv("ENABLE_TURBO_MODE", "true")
|
||||||
|
mock_display = MagicMock()
|
||||||
|
mock_turbo_lookup = MagicMock()
|
||||||
|
|
||||||
|
with patch.dict(
|
||||||
|
"sys.modules",
|
||||||
|
{
|
||||||
|
"ansible.module_utils.ansible_release": MagicMock(__version__="2.18.0"),
|
||||||
|
"ansible.utils.display": MagicMock(Display=lambda: mock_display),
|
||||||
|
"ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup": mock_turbo_lookup,
|
||||||
|
},
|
||||||
|
):
|
||||||
|
from ansible_collections.kubernetes.core.plugins.lookup import ( # noqa: F401
|
||||||
|
k8s,
|
||||||
|
)
|
||||||
|
|
||||||
|
mock_display.deprecated.assert_called()
|
||||||
|
assert not mock_display.warning.called
|
||||||
|
|
||||||
|
def test_turbo_mode_disabled_when_env_not_set(self, monkeypatch):
|
||||||
|
"""Test that turbo mode is disabled when ENABLE_TURBO_MODE is not set."""
|
||||||
|
monkeypatch.delenv("ENABLE_TURBO_MODE", raising=False)
|
||||||
|
mock_display = MagicMock()
|
||||||
|
|
||||||
|
with patch.dict(
|
||||||
|
"sys.modules",
|
||||||
|
{
|
||||||
|
"ansible.module_utils.ansible_release": MagicMock(__version__="2.18.0"),
|
||||||
|
"ansible.utils.display": MagicMock(Display=lambda: mock_display),
|
||||||
|
},
|
||||||
|
):
|
||||||
|
from ansible_collections.kubernetes.core.plugins.lookup import k8s
|
||||||
|
|
||||||
|
mock_display.deprecated.assert_not_called()
|
||||||
|
mock_display.warning.assert_not_called()
|
||||||
|
assert k8s.LookupBase == StandardLookupBase
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
pytest
|
pytest
|
||||||
|
pytest-cov
|
||||||
PyYAML
|
PyYAML
|
||||||
kubernetes
|
kubernetes
|
||||||
|
|||||||
Reference in New Issue
Block a user