Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ansible] add support for ansible 5 (ansible-core 2.12) #8512

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

cristicalin
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:
This PR adds support for ansible 5 (ansible-core 2.12) and adds basic coverage for it in the CI.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

[ansible] add support for ansible 5 (ansible-core 2.12)

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 7, 2022
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 7, 2022
@cristicalin
Copy link
Contributor Author

I can't quite explain this error in the CI: https://gitlab.com/kargo-ci/kubernetes-sigs-kubespray/-/jobs/2061094210#L63

On pypi the current ansible version is 5.3.0 (https://pypi.org/project/ansible/5.3.0/) and I successfully tested on a local env. Are we using some sort of cache in the CI that needs to be updated?

@floryut
Copy link
Member

floryut commented Feb 7, 2022

I can't quite explain this error in the CI: https://gitlab.com/kargo-ci/kubernetes-sigs-kubespray/-/jobs/2061094210#L63

On pypi the current ansible version is 5.3.0 (https://pypi.org/project/ansible/5.3.0/) and I successfully tested on a local env. Are we using some sort of cache in the CI that needs to be updated?

Not that I know of, I'll try to check it

@cristicalin cristicalin marked this pull request as draft February 8, 2022 07:40
@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 Feb 8, 2022
@cristicalin
Copy link
Contributor Author

So even with explicit archive for ansible 5.3.0 we still have a failure on the ansible-core package, this is really weird.

/cc @floryut any chance you can take a look at the CI worker and see why pypi is serving us an outdated package index?

@floryut
Copy link
Member

floryut commented Feb 15, 2022

So even with explicit archive for ansible 5.3.0 we still have a failure on the ansible-core package, this is really weird.

/cc @floryut any chance you can take a look at the CI worker and see why pypi is serving us an outdated package index?

I'll do better than that and provide you access to it, as soon as I got time today (maybe tonight or during lunch)

@cristicalin
Copy link
Contributor Author

After some investigation (thanks @floryut!) it turns out this is due to our docker image which is used as the base of our CI jobs. The docker image is based on ubuntu:18.04 which ships with python 3.6. Newer versions of ansible (5+) have dropped support for python < 3.8 and thus we need to rebase the image on ubuntu 20.04 and release an updated 2.18.1 version since the master branch CI jobs use the latest released docker image.

Relevant PRs have been pushed to prepare this change.

@cristicalin cristicalin marked this pull request as ready for review March 26, 2022 18:16
@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 Mar 26, 2022
@k8s-ci-robot k8s-ci-robot requested a review from EppO March 26, 2022 18:17
@cristicalin
Copy link
Contributor Author

Finally this is ready for review.

/cc @floryut @oomichi

@k8s-ci-robot k8s-ci-robot requested review from floryut and oomichi March 26, 2022 18:17
Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

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

Thank you @cristicalin
I can't help but wonder if all those ansible version checks should not be in a dedicated stage during nightly jobs for ex, not sure we need to validate every ansible version for each PR

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cristicalin, floryut

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [cristicalin,floryut]

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

@oomichi
Copy link
Contributor

oomichi commented Mar 28, 2022

The new packet_ubuntu20-calico-aio-ansible-2_12 is succeeded.
It is fine to add the test for me.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2022
@k8s-ci-robot k8s-ci-robot merged commit 113de83 into kubernetes-sigs:master Mar 28, 2022
@cristicalin
Copy link
Contributor Author

Thank you @cristicalin
I can't help but wonder if all those ansible version checks should not be in a dedicated stage during nightly jobs for ex, not sure we need to validate every ansible version for each PR

I would move the ansible 2.9 and 2.10 jobs to nightly and make 2.12 the new default so we can live in the modern age.

Quehenr pushed a commit to Quehenr/unstable-laboratory-infrastructure-kubespray that referenced this pull request Apr 4, 2022
* master: (21 commits)
  Fix quotation of nerdctl_extra_flags (kubernetes-sigs#8668)
  fix: uninstall contailer engine if service is running (kubernetes-sigs#8662)
  fix disk controller type in Vagrantfile (kubernetes-sigs#8656)
  Add ETCD_EXPERIMENTAL_INITIAL_CORRUPT_CHECK flag to etcd config (kubernetes-sigs#8664)
  Update vagrant.md (kubernetes-sigs#8663)
  Add missing 2.10 ansible test (kubernetes-sigs#8665)
  [ansible] make ansible 5.x the new default version (kubernetes-sigs#8660)
  Run 0100-dhclient-hooks if dhcpclient is enabled (kubernetes-sigs#8658)
  terrform/openstack: Fix templating of ansible_ssh_common_args in no_floating.yml if used as TF module (kubernetes-sigs#8646)
  [ansible] add support for ansible 5 (ansible-core 2.12) (kubernetes-sigs#8512)
  [etcd] add 0 hash for arm v3.5.2 to prevent deployment failures
  Update cert-manager to v1.7.2 (kubernetes-sigs#8648)
  fix vagrant parameter (kubernetes-sigs#8650)
  Remove centos7 molecule while opensuse mirror is flaky
  Remove k8s module for ns creation
  Update kubernetes image to 2.18.1
  Vagrantfile: add var to set ansible verbosity level (kubernetes-sigs#8639)
  Have ingress_controller and external_provisioner in upgrade-cluster.yml (kubernetes-sigs#8640)
  [sysctl] set fs.may_detach_mounts=1 even when CRIs don't set it themselves (kubernetes-sigs#8635)
  Fixed cluster roles for openstack cloud controller (kubernetes-sigs#8638)
  ...
sakuraiyuta pushed a commit to sakuraiyuta/kubespray that referenced this pull request Apr 16, 2022
@oomichi oomichi mentioned this pull request May 28, 2022
@tmurakam
Copy link
Contributor

tmurakam commented May 29, 2022

Hmm... I think this will drop RHEL7/CentOS7 support for ansible node, because it does not have Python 3.8.
We need to use software collections to use python 3.8.

LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jun 29, 2023
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Oct 23, 2023
itayporezky added a commit to itayporezky/kubespray that referenced this pull request May 15, 2024
itayporezky added a commit to itayporezky/kubespray that referenced this pull request May 15, 2024
itayporezky added a commit to itayporezky/kubespray that referenced this pull request May 15, 2024
itayporezky added a commit to itayporezky/kubespray that referenced this pull request May 15, 2024
itayporezky added a commit to itayporezky/kubespray that referenced this pull request May 15, 2024
itayporezky added a commit to itayporezky/kubespray that referenced this pull request May 16, 2024
itayporezky added a commit to itayporezky/kubespray that referenced this pull request May 20, 2024
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants