I'm currently having a problem running an Ansible F5 playbook via an SSH Bastion host to configure an F5 Device, not sure where the issue could be at this stage.
BIGSUDS, SUDS, F5-SDK all installed via pip
My Playbook --- f5play.yml ----
---
- hosts: f5_devices
gather_facts: false
connection: local
tasks:
- name: f5 test
bigip_facts:
server: "{{ inventory_hostname }}"
user: "{{ ansible_user }}"
password: "{{ ansible_ssh_pass }}"
include: "interface"
validate_certs: false
delegate_to: localhost
register: out
- debug: msg= "{{ out }}"
I have a "group_vars" directory with an "f5_devices" directory that contains my vault.yml and vars.yml
vars.yml contains my extra proxy info, to jump through an intermediate ssh host before jumping to the f5, It has been successfully used with this setup before to get to Cisco devices.
inventory file = ansible_hosts
[f5_devices]
F5-LTM1 ansible_user=admin
--vars.yml--
ansible_ssh_pass: "{{ vault_ansible_ssh_pass }}"
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -v bastion1" -o
StrictHostKeyChecking=no'
ansible-playbook -i ansible_hosts f5play.yml --ask-vault-pass -vvv
UPDATE - added "delegate_to: localhost" now, still this error
"session": false,
"state": "present",
"user": "admin",
"validate_certs": false
}
},
"msg": "received exception: <urlopen error [Errno -2] Name or service
not known>\ntraceback: Traceback (most recent call last):\n File
\"/tmp/ansible_cdaERk/ansible_module_bigip_facts.py\", line 1664, in main\n
saved_active_folder = f5.get_active_folder()\n File
\"/tmp/ansible_cdaERk/ansible_module_bigip_facts.py\", line 148, in
get_active_folder\n return self.api.System.Session.get_active_folder()\n
File \"/home/mike/Proj/ansible/lib/python2.7/site-packages/bigsuds.py\",
line 360, in __getattr__\n client = self._client_creator('%s.%s' %
(self._name, attr))\n File \"/home/mike/Proj/ansible/lib/python2.7/site-
packages/bigsuds.py\", line 170, in _create_client\n raise
ConnectionError(str(e))\nConnectionError: <urlopen error [Errno -2] Name or
service not known>\n"
}
I forgot to add, this is running in a virtual environment (virtualenv ansible)
Any help would be 'greatly' appreciated