-
Notifications
You must be signed in to change notification settings - Fork 229
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
Playbook fails with ImportError: No module named http.client #2366
Comments
Hi @m-kratochvil, I tested the following playbook with f5networks.f5_modules version 1.26.0 on device using BIG-IP v17.1 with success.
|
Hi @pgouband thanks for the feedback. I believe it's working for you because you are using the |
Hi @m-kratochvil, Can you check you are using python3 because the error looks like python2 is used? |
I am using python |
I think the problem is indeed that you try to run the task on the BIGIP itself. The python on the BIGIP is quite limited, and is probably missing the http.client. Easiest way to fix the issue is to add the delegate_to: localhost to the task, as adding python modules to BIGIP is not a good idea. I had the same issue on bigip_routedomain module because I forgot to add delegate_to... |
Hi @m-kratochvil, Can you test adding delegate_to? When you said "I execute the module on the Big-IP itself", that means you have installed ansible on the device? |
Appreciate your feedback @jussisjostrom @pgouband
No, that was just poor choice of words, I meant I execute the module without If I add I understand your suggestion to run with The obvious question is what has recently changed - and nothing comes to my mind, we run same ansible version, same python version on the controller, same f5 collection version. The playbook fails against both our TMOS versions 15.1.3 and 17.1.0.1 I am really out of any ideas why this has suddenly started to fail. |
Hi @m-kratochvil, Adding delegate_to is impossible in your environment? |
@pgouband It is technically possible but we really want to avoid that. Reason is that we currently store the AS3 rpm packages in central, controlled storage and each Big-IP downloads it from there during installation. |
Hi @m-kratochvil, The answer is to use delegate_to and the file needs to be on the ansible client. |
Hi @pgouband the fix/feature for Issue 1717 was implemented via 7257354 and if you look in the diff at a file
That is for sure one option to install AS3 with Ansible, and then there is the other option, without having to upload the AS3 package from the ansible client, and that's what I am after, as it is much better fit to our environment. We are a team of 20 people, managing well over 500 Big-IPs, it is way more practical and safe for use to use central storage for such files. I hope it clarifies things, and thanks for looking into it. |
Hi @m-kratochvil , the |
Hi @urohit011 thanks for the hint, I have missed that. But I can also see that in If Anyway, I stress again, it was working for us fine for several years, the question is why it suddenly stopped. Plus, it actually still works without the I realized I didn't share the actual playbook we have used, so here it is: Role entry point:
Role
|
In the |
@urohit011 I respectfully disagree. The
Regarding |
@m-kratochvil , yes I agree that |
I have tested my original playbook with various older version of the It would perhaps suggest that support for python2.7 was dropped in that collection version, can anybody confirm? The release notes of collection version For now, I downgraded to collection version |
Same issue here when upgrading to 1.25.1 |
Ended up adding
|
COMPONENT NAME
f5networks.f5_modules.bigip_lx_package
Environment
ANSIBLE VERSION
BIGIP VERSION
OS / ENVIRONMENT
Ubuntu 22.04 VM
Python 3.10.6
SUMMARY
Playbook to install AS3 plugin used to work, suddenly it fails. Other playbooks/modules might be affected, I only ran into this issue with the particular module specified below.
STEPS TO REPRODUCE
Run a playbook to install an AS3 package, using following module:
EXPECTED RESULTS
Playbook should run and complete without failure, installing the AS3 package.
ACTUAL RESULTS
The playbook failed with following error:
To resolve on short-term, I went into the following file:
and removed references to
http.client
Then the playbook failed with different error:
I went into the following file:
and removed references to
packaging.version
After that the playbook executed correctly.
The text was updated successfully, but these errors were encountered: