F5Networks / f5-ansible

Imperative Ansible modules for F5 BIG-IP products
GNU General Public License v3.0
376 stars 231 forks source link

bigip_gtm_facts doesnt work after upgrading to 2.5.x #734

Closed mirzawaqasahmed closed 6 years ago

mirzawaqasahmed commented 6 years ago
ISSUE TYPE
COMPONENT NAME

bigip_gtm_facts

ANSIBLE VERSION
2.5.x
PYTHON VERSION
2.7.12
BIGIP VERSION
12.1.2
LIBRARY VERSIONS
bigsuds==1.0.6
f5-sdk==3.0.14
CONFIGURATION
OS / ENVIRONMENT

Ubuntu

SUMMARY

Running a simple old playbook that works in 2.4.x to gather gtm facts but failing in 2.5.x

STEPS TO REPRODUCE
- name: Get facts from GTM
  bigip_gtm_facts:
    server: "{{ inventory_hostname }}"
    user: "{{ F5_USERNAME }}"
    password: "{{ F5_PASSWORD }}"
    validate_certs: false
    include:
      - "wide_ip"
      - "pool"
  register: wip_configs
EXPECTED RESULTS

Should return facts

ACTUAL RESULTS
fatal: [f5-lab]: FAILED! => {"changed": false, "msg": "Unable to connect to f5-lab on port 443. Is \"validate_certs\" preventing this?"}
caphrim007 commented 6 years ago

This is always caused by incorrect login credentials, invalid hostnames/addresses, or incorrect ports.

Is your inventory hostname resolvable in dns?

mirzawaqasahmed commented 6 years ago

Its all set, if i dont change anything and change the environment to 2.4.3.0 it works without any issue.

caphrim007 commented 6 years ago

@mirzawaqasahmed you might want to try the 2.6.0 development code because there were several connection related fixes added.

mirzawaqasahmed commented 6 years ago

@caphrim007 just tried using pip install git+https://github.com/ansible/ansible.git@devel

and got the following error fatal: [f5-lab]: FAILED! => {"changed": false, "msg": "Unable to connect to f5-lab on port None. The reported error was \"Unexpected **kwargs: {'verify': False}\"."}

caphrim007 commented 6 years ago

@mirzawaqasahmed does the following command show successful output?

ping f5-lab

literally that command

caphrim007 commented 6 years ago

btw, there is a bug you've identified with the port not being reported correctly, but it is only cosmetic. It will be fixed before 2.6 is released

mirzawaqasahmed commented 6 years ago

@caphrim007 yes the ping command shows successfull... As mentioned in the beginning it runs with no issue on the same host with another version of ansible.

caphrim007 commented 6 years ago

@mirzawaqasahmed try the updated stable-2.6 branch in the ansible repo where i've added the fixes I mentioned. Do you have a hosts file entry for the f5-lab machine? This is not a normal hostname and would otherwise not resolve unless a DNS search domain or hosts entry existed

mirzawaqasahmed commented 6 years ago

here you go

[waqas@ubuntu:~] $ ping f5-lab
PING f5-lab (192.168.180.6) 56(84) bytes of data.
64 bytes from f5-lab (192.168.180.6): icmp_seq=1 ttl=64 time=20.0 ms
64 bytes from f5-lab (192.168.180.6): icmp_seq=2 ttl=64 time=0.370 ms
64 bytes from f5-lab (192.168.180.6): icmp_seq=3 ttl=64 time=0.324 ms
64 bytes from f5-lab (192.168.180.6): icmp_seq=4 ttl=64 time=0.335 ms
64 bytes from f5-lab (192.168.180.6): icmp_seq=5 ttl=64 time=2.14 ms
64 bytes from f5-lab (192.168.180.6): icmp_seq=6 ttl=64 time=0.339 ms
64 bytes from f5-lab (192.168.180.6): icmp_seq=7 ttl=64 time=0.461 ms

when i use the above branch it throws a new error now.

fatal: [f5-lab]: FAILED! => {"changed": false, "msg": "Unable to connect to f5-lab on port 443. The reported error was \"Unexpected **kwargs: {'verify': True}\"."}

and yes the name is masked...but the pings are true

caphrim007 commented 6 years ago

@mirzawaqasahmed I've only ever see that error manifest when the f5-sdk and its dependencies were out of date.

How is your system set up here? Did you install the f5-sdk via pip? Did you ever install any python dependency using apt? is this a virtual env? is python3 the default python at /usr/bin/python?

mirzawaqasahmed commented 6 years ago

Upgraded to ansible 2.5.4 and having same issue. f5-sdk was installed using pip...

Yes, I am using virtual env.

$ which python
/home/waqas/.virtualenvs/ansible2.5.4/bin/python

Current versions are as below.


bigsuds          1.0.6    
cryptography     2.2.2  
f5-icontrol-rest 1.3.8    
f5-sdk           3.0.15   
ipaddress        1.0.22   
pip              10.0.1   
six              1.11.0   
suds-jurko       0.6 ```
caphrim007 commented 6 years ago

@mirzawaqasahmed are you specifying the ansible_python_interpreter since you're using a virtualenv?

mirzawaqasahmed commented 6 years ago

@caphrim007 Yes I am.

caphrim007 commented 6 years ago

@mirzawaqasahmed can you show me how you're specifying the python interpreter? as well as a full playbook that reproduces the error for you? Not just the task.

mirzawaqasahmed commented 6 years ago

Hey @caphrim007 just to update...I just re-instantiated the python env and clean installed things...after that it seems to be working. Odd but true. Couldnt find out what is causing the problem. Thanks for all the help though

caphrim007 commented 6 years ago

@mirzawaqasahmed good to hear! Thanks for the update!