Forum Discussion
Connecting to F5 using SSH via Ansible
AHS This doesn't seem to be specific to F5 but to Ansible itself. The following article seems to have a similar issue and it revolves around the Ansible server not knowing the path for python3.9. If you read through the article it could help you get back on track.
Paulius -- Apologies for the late reply. I was tied up with another engagement. Thank you for the suggestion. I did see that git-hub post & did try the stuff mentioned there before posting here. Unfortunately, it did not help. The issue started happening after I upgraded the f5-collections. I rolled back the f5-collections to 1.22, but that still did not fix the issue. I donot think the issue was with the collections itself but a combination of collection, ansible & python version. To get this working again, I had to create a virtual environment & use that for ansible. Here are the steps
mkdir ~/tmp
mv ~/.ansible ~/tmp
mv ~/.cache ~/tmp
mv ~/.config ~/tmp
mkdir -p ~/workspace/venv
cd ~/workspace/venv
/usr/local/bin/python3.9 -m venv ./ansible-2.9.17
Wait for the virtual environment to get created
source ~/workspace/venv/ansible-2.9.17/bin/activate
pip install --upgrade pip
pip list
This should show you default packages with pip
pip install ansible==2.9.17
pip install paramiko
pip list
ansible-galaxy collection install -r requirements.ymlThe requirements file is as follows
---
collections:
# --- F5 Collections ---
- name: f5networks.f5_modules
version: 1.22.0
- name: f5networks.f5_bigip
# --- Required for clean STDOUT ---
- name: ansible.posix
# --- Required for IP management ---
- name: ansible.utils
# --- Required for json_query ---
- name: community.general
...I also switched to paramiko for ssh connectivity instead of ansible's built in module.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
