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

Use python3-libselinux on RHEL8/Centos8 #5127

Merged
merged 2 commits into from
Aug 28, 2019
Merged

Use python3-libselinux on RHEL8/Centos8 #5127

merged 2 commits into from
Aug 28, 2019

Conversation

Mosibi
Copy link
Contributor

@Mosibi Mosibi commented Aug 27, 2019

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind flake

/kind feature

What this PR does / why we need it:
RHEL 8 and Centos 8 default to python3 and do not have the libselinux-python package anymore. Instead of that the package python3-libselinux should be used. This ternary filter installs the right version.

Which issue(s) this PR fixes:

Fixes #5046

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot
Copy link
Contributor

Welcome @Mosibi!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 27, 2019
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 27, 2019
@k8s-ci-robot k8s-ci-robot requested review from Miouge1 and mirwan August 27, 2019 15:02
@Mosibi
Copy link
Contributor Author

Mosibi commented Aug 27, 2019

/assign @riverzhang

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 27, 2019
…lder Ansible version.

Default it to 0 in when not present and use libselinux-python as package to get current
default behaviour.
@Mosibi
Copy link
Contributor Author

Mosibi commented Aug 27, 2019

/retest

@k8s-ci-robot
Copy link
Contributor

@Mosibi: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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/test-infra repository.

@Mosibi
Copy link
Contributor Author

Mosibi commented Aug 28, 2019

Build packet_ubuntu-contiv-sep failed because it could not connect to instance-3

fatal: [instance-3 -> localhost]: FAILED! => {"changed": false, "elapsed": 240, "msg": "Timeout when waiting for 172.30.72.13:22"}

I can't think of any reason why this PR could have caused this, so i think it was an error with the test environment that's out of scope of this PR.

@riverzhang
Copy link
Contributor

@Mosibi Thanks
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 28, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Mosibi, riverzhang

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:

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 28, 2019
@k8s-ci-robot k8s-ci-robot merged commit 4d95bb1 into kubernetes-sigs:master Aug 28, 2019
erulabs added a commit to kubesail/kubespray that referenced this pull request Sep 18, 2019
* 'master' of https://github.com/kubernetes-sigs/kubespray:
  Add support for k8s v1.14.6 (kubernetes-sigs#5182)
  Parameterize gcr, quay, and docker image repo defines (kubernetes-sigs#5146)
  use hyperkubeimage to run controlplane containers (kubernetes-sigs#5178)
  Update main.yml (kubernetes-sigs#5166)
  Fixes issue kubernetes-sigs#5160 (kubernetes-sigs#5171)
  Use more native way to update kubeconfigs using kubeadm (kubernetes-sigs#5165)
  Fix macro on local_volume_provisioner (kubernetes-sigs#5168)
  Move cri_socket var to kubespray-defaults (kubernetes-sigs#5149)
  Add support for k8s v1.16.0-beta.2 (kubernetes-sigs#5148)
  Fix ansible task titles (kubernetes-sigs#5154)
  Adjust endpoints for kube-proxy,controller,scheduler to proper ip (kubernetes-sigs#5150)
  Documenting Terraform variable `az_list` explicitly (kubernetes-sigs#5132)
  Make haproxy/nginx client timeout configurable (kubernetes-sigs#5140)
  print hostnames (kubernetes-sigs#5110)
  Cleanup: fix typo in doc (kubernetes-sigs#5105)
  Use python3-libselinux on RHEL8/Centos8 (kubernetes-sigs#5127)
@champtar
Copy link
Contributor

champtar commented Sep 25, 2019

Just tried it on CentOS 8 and this is not working because bootstrap-os is running with gather_facts: false

TASK [bootstrap-os : debug] ******************************************************************************************************************************************************************************************************************
Tuesday 24 September 2019  17:15:08 -0700 (0:00:00.039)       0:00:01.862 ***** 
ok: [etienne-ks147] => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    }
}

TASK [bootstrap-os : Install libselinux python package] **************************************************************************************************************************************************************************************
Tuesday 24 September 2019  17:15:08 -0700 (0:00:00.044)       0:00:01.906 ***** 
fatal: [etienne-ks147]: FAILED! => {"changed": false, "failures": ["No package libselinux-python available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}

gather_facts: false

champtar added a commit to champtar/kubespray that referenced this pull request Sep 27, 2019
In bootstrap-centos.yml we haven't gathered the facts,
so kubernetes-sigs#5127 couldn't work

Minimum ansible version to run kubespray is 2.7.8,
so ansible_distribution_major_version is defined an there is no need to default it

Signed-off-by: Etienne Champetier <[email protected]>
jamescassell added a commit to ansible-lockdown/RHEL7-STIG that referenced this pull request Nov 12, 2019
jamescassell added a commit to ansible-lockdown/RHEL7-STIG that referenced this pull request Nov 13, 2019
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Dec 8, 2019
* Use python3-libselinux on RHEL8/Centos8

* The fact ansible_facts.distribution_major_version is not present on older Ansible version.
Default it to 0 in when not present and use libselinux-python as package to get current
default behaviour.
k8s-ci-robot pushed a commit that referenced this pull request Dec 9, 2019
* Fix python3-libselinux installation for RHEL/CentOS 8

In bootstrap-centos.yml we haven't gathered the facts,
so #5127 couldn't work

Minimum ansible version to run kubespray is 2.7.8,
so ansible_distribution_major_version is defined an there is no need to default it

Signed-off-by: Etienne Champetier <[email protected]>

* Restart NetworkManager for RHEL/CentOS 8

network.service doesn't exist anymore
 # systemctl status network
 Unit network.service could not be found.

Signed-off-by: Etienne Champetier <[email protected]>

* Add module_hotfixes=True to docker / containerd yum repo config

https://bugzilla.redhat.com/show_bug.cgi?id=1734081
https://bugzilla.redhat.com/show_bug.cgi?id=1756473
Without this setting you end up with the following error:
 # yum install docker-ce
 Failed to set locale, defaulting to C
 Last metadata expiration check: 0:03:21 ago on Thu Sep 26 22:00:05 2019.
 Error:
  Problem: package docker-ce-3:19.03.2-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
   - cannot install the best candidate for the job
   - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
   - package containerd.io-1.2.2-3.el7.x86_64 is excluded
   - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
   - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
   - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
 (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Signed-off-by: Etienne Champetier <[email protected]>
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jan 20, 2020
* Fix python3-libselinux installation for RHEL/CentOS 8

In bootstrap-centos.yml we haven't gathered the facts,
so kubernetes-sigs#5127 couldn't work

Minimum ansible version to run kubespray is 2.7.8,
so ansible_distribution_major_version is defined an there is no need to default it

Signed-off-by: Etienne Champetier <[email protected]>

* Restart NetworkManager for RHEL/CentOS 8

network.service doesn't exist anymore
 # systemctl status network
 Unit network.service could not be found.

Signed-off-by: Etienne Champetier <[email protected]>

* Add module_hotfixes=True to docker / containerd yum repo config

https://bugzilla.redhat.com/show_bug.cgi?id=1734081
https://bugzilla.redhat.com/show_bug.cgi?id=1756473
Without this setting you end up with the following error:
 # yum install docker-ce
 Failed to set locale, defaulting to C
 Last metadata expiration check: 0:03:21 ago on Thu Sep 26 22:00:05 2019.
 Error:
  Problem: package docker-ce-3:19.03.2-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
   - cannot install the best candidate for the job
   - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
   - package containerd.io-1.2.2-3.el7.x86_64 is excluded
   - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
   - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
   - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
 (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Signed-off-by: Etienne Champetier <[email protected]>
jamescassell added a commit to ansible-lockdown/RHEL7-STIG that referenced this pull request May 20, 2020
uk-bolly pushed a commit to ansible-lockdown/RHEL7-STIG that referenced this pull request Feb 24, 2021
uk-bolly pushed a commit to ansible-lockdown/RHEL7-STIG that referenced this pull request Feb 25, 2021
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On RHEL8/Centos8 python3-libselinux should be installed instead of libselinux-python
4 participants