-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
LXC module uses python2 #5294
Comments
Files identified in the description: If these files are incorrect, please update the |
Files identified in the description: If these files are incorrect, please update the |
@Igorgro the error message is wrong and needs to be updated. The module requires |
This change is mostly just a documentation change which will report the requirements correctly for python3-lxc. I've also removed the use of six which results in us changing `xrange` to `range`. Resolves: ansible-collections#5294 Signed-off-by: Kevin Carter <[email protected]>
@cloudnull that specific message comes from the lxc connection plugin, not from the lxc_container module. See: @Igorgro the plugin does not seem to check specifically for Python 2 or 3, so regardless of any error message and regardless of having installed the package in the Python3, you have to ensure that Ansible is executing Python 3 on the target node - if that's what you want. Please keep in mind that despite thefact that Python 2 itself is no longer supported, that version is still, in theory, supported by Ansible and by this collection. |
Should the docs here https://docs.ansible.com/ansible/latest/collections/community/general/lxc_container_module.html also be fixed? |
Those docs are generated automatically from the source code. ;) |
This change is mostly just a documentation change which will report the requirements correctly for python3-lxc. I've also removed the use of six which results in us changing `xrange` to `range`. Resolves: ansible-collections#5294 Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]>
* chore: Update lxc_container to support py3 This change is mostly just a documentation change which will report the requirements correctly for python3-lxc. I've also removed the use of six which results in us changing `xrange` to `range`. Resolves: #5294 Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Felix Fontein <[email protected]> * Update 5280-lxc_container-py3.yaml * Update 5280-lxc_container-py3.yaml Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
* chore: Update lxc_container to support py3 This change is mostly just a documentation change which will report the requirements correctly for python3-lxc. I've also removed the use of six which results in us changing `xrange` to `range`. Resolves: #5294 Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Felix Fontein <[email protected]> * Update 5280-lxc_container-py3.yaml * Update 5280-lxc_container-py3.yaml Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 2eba5dc)
* chore: Update lxc_container to support py3 This change is mostly just a documentation change which will report the requirements correctly for python3-lxc. I've also removed the use of six which results in us changing `xrange` to `range`. Resolves: #5294 Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Felix Fontein <[email protected]> * Update 5280-lxc_container-py3.yaml * Update 5280-lxc_container-py3.yaml Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 2eba5dc) Co-authored-by: Kevin Carter <[email protected]>
* chore: Update lxc_container to support py3 This change is mostly just a documentation change which will report the requirements correctly for python3-lxc. I've also removed the use of six which results in us changing `xrange` to `range`. Resolves: ansible-collections#5294 Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Felix Fontein <[email protected]> * Update 5280-lxc_container-py3.yaml * Update 5280-lxc_container-py3.yaml Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
* chore: Update lxc_container to support py3 This change is mostly just a documentation change which will report the requirements correctly for python3-lxc. I've also removed the use of six which results in us changing `xrange` to `range`. Resolves: ansible-collections#5294 Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Alexei Znamensky <[email protected]> * Update changelogs/fragments/5280-lxc_container-py3.yaml Co-authored-by: Felix Fontein <[email protected]> * Update 5280-lxc_container-py3.yaml * Update 5280-lxc_container-py3.yaml Signed-off-by: Kevin Carter <[email protected]> Co-authored-by: Alexei Znamensky <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
Summary
LXC related modules use python2, which is EOL since 2020 and is not available in modern linux distros.
Issue Type
Bug Report
Component Name
lxc
lxc_container
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
Arch Linux, but generally it doesn't matter
Steps to Reproduce
Try to connect to LXC host using lxc connection. Sample inventory:
Sample playbook:
Results in error:
which cannot be resolved because python2 no longer available.
The same porblem is related to
lxc_container
module which also requires python2 lxc bindings.Expected Results
It is expected that lxc modue depends on python3 lxc binding rather than python2.
Actual Results
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: