Forum Discussion

AHS's avatar
AHS
Icon for Nimbostratus rankNimbostratus
Jun 09, 2023

Re: Connecting to F5 using SSH via Ansible

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.yml

The 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.

No RepliesBe the first to reply