Skip to content

Upgrade Ansible 12.3.0#13282

Open
tico88612 wants to merge 8 commits into
kubernetes-sigs:masterfrom
tico88612:feat/ansible-12
Open

Upgrade Ansible 12.3.0#13282
tico88612 wants to merge 8 commits into
kubernetes-sigs:masterfrom
tico88612:feat/ansible-12

Conversation

@tico88612

@tico88612 tico88612 commented May 28, 2026

Copy link
Copy Markdown
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

Ansible 11.x was EOL. Let's upgrade this.

Special notes for your reviewer:

The support matrix does not change between 11 and 12; maybe we can safely upgrade this.

I used AI to fix and upgrade Ansible 12.

Does this PR introduce a user-facing change?:

Upgrade Ansible 12

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels May 28, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tico88612

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested a review from cyclinder May 28, 2026 15:38
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 28, 2026
@k8s-ci-robot k8s-ci-robot requested a review from guoard May 28, 2026 15:38
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 28, 2026
@tico88612

Copy link
Copy Markdown
Member Author

/label tide/merge-method-merge

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-merge Denotes a PR that should use a standard merge by tide when it merges. label May 28, 2026
@tico88612 tico88612 changed the title Upgrade Ansible 12.3.0 [WIP] Upgrade Ansible 12.3.0 May 28, 2026
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 28, 2026
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 28, 2026
@tico88612 tico88612 force-pushed the feat/ansible-12 branch 2 times, most recently from b24edee to 9072108 Compare May 29, 2026 06:48
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 29, 2026
@tico88612 tico88612 force-pushed the feat/ansible-12 branch 2 times, most recently from 86051ce to e819c6a Compare May 29, 2026 07:08
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 29, 2026
@tico88612 tico88612 changed the title [WIP] Upgrade Ansible 12.3.0 Upgrade Ansible 12.3.0 Jun 8, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 8, 2026
@tico88612

Copy link
Copy Markdown
Member Author

@VannTen @yankay I've been trying to upgrade to Ansible 12, and it looks like there are some breaking changes in its behavior. I'm considering whether I should split this into multiple PRs. What do you think?

@tico88612

Copy link
Copy Markdown
Member Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 8, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 16, 2026
@yankay yankay requested a review from Copilot June 17, 2026 01:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades Kubespray’s Ansible dependency from 11.x to 12.3.0 (and updates the supported ansible-core range accordingly), with a handful of playbook/template adjustments to stay compatible with ansible-core 2.19 behavior.

Changes:

  • Bump ansible to 12.3.0 and update the supported ansible-core range to >=2.19.0,<2.20.0 across runtime checks, docs, and pre-commit.
  • Refactor several Calico resources from hand-built JSON strings to native YAML dicts serialized via to_json.
  • Refactor etcd OpenSSL SAN generation and cert slurp item lists for cleaner templating.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/ansible.cfg Enables allow_broken_conditionals for test runs under ansible-core 2.19+.
roles/system_packages/tasks/main.yml Removes Fedora-specific raw dnf workaround that was gated on older ansible-core behavior.
roles/network_plugin/calico/tasks/install.yml Refactors Felix/IPPool/BGP config generation to YAML structures + to_json.
roles/kubespray_defaults/defaults/main/main.yml Simplifies ssl_ca_dirs default selection logic using a dict lookup.
roles/kubespray_defaults/defaults/main/download.yml Changes file modes to quoted strings (e.g., "0755") for YAML correctness.
roles/etcd/templates/openssl.conf.j2 Reworks SAN generation to accumulate DNS/IP lists and render with loop indices.
roles/etcd/tasks/gen_certs_script.yml Replaces stringified list construction with explicit list concatenation.
requirements.txt Pins Ansible to 12.3.0.
playbooks/ansible_version.yml Updates version guard to 2.19.0 <= ansible-core < 2.20.0.
meta/runtime.yml Updates collection runtime requirement to >=2.19.0,<2.20.0.
docs/ansible/ansible.md Updates the documented supported Ansible/ansible-core range.
ansible.cfg Enables allow_broken_conditionals globally for users/runs.
.pre-commit-config.yaml Updates hook dependencies to ansible-core>=2.19.0,<2.20.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +325 to +329
set_fact:
_bgp_config: "{{ _bgp_config | combine({'spec': {'serviceClusterIPs': [{'cidr': _cluster_ip_cidr}]}}, recursive=True) }}"
vars:
_cluster_ip_cidr: "{{ kube_service_addresses_ipv6 if ipv6_stack | bool else kube_service_addresses }}"
when: calico_advertise_cluster_ips | default(false)
Comment thread ansible.cfg
Comment on lines +22 to +23
# TODO: Review our conditions, and set this to false.
allow_broken_conditionals=True
Comment thread tests/ansible.cfg
Comment on lines +17 to +18
# TODO: Review our conditions, and set this to false.
allow_broken_conditionals=True
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tico88612

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 6, 2026
tico88612 added 8 commits July 6, 2026 22:32
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
…ted string

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
…ne Jinja loops

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
…ative Jinja

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
…rings

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
@kubernetes-prow kubernetes-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-merge Denotes a PR that should use a standard merge by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants