cancel
Showing results for 
Search instead for 
Did you mean: 

bigip_device_info errors with - virtual-servers

markbz
Altostratus
Altostratus

I am trying to pull an existing description from an existing virtual server using ansible.

I found bigip_device_info but am running into errors.

 

I have a ansible yaml file facts.yml:

name: Collect BIG-IP information

  bigip_device_info:

    provider: "{{ provider }}"

    gather_subset:

      #- virtual-addresses

      #- ltm-pools

      - virtual-servers

  register: bigip_device_info

  delegate_to: localhost

 

virtual-addresses & ltm-pools both work and return valid information. However virtual-servers always crashes.

Will someone please shed some light on this issue and let me know if the syntax is incorrect, is there a bug, etc?

 

Following is the debug error messages with virtual-servers enabled in the yaml file:

task path: /home/mboster/cloud-infrastructure/cloudops/infrastructure/network/ansible/waf/roles/mq_deployment/tasks/mq_facts.yml:1

<localhost> connection transport is rest

<localhost> ESTABLISH LOCAL CONNECTION FOR USER: mboster

<localhost> EXEC /bin/sh -c 'echo ~mboster && sleep 0'

<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/mboster/.ansible/tmp/ansible-tmp-1591302659.2270741-189006385395292 `" && echo ansible-tmp-1591302659.2270741-189006385395292="` echo /home/mboster/.ansible/tmp/ansible-tmp-1591302659.2270741-189006385395292 `" ) && sleep 0'

Using module file /usr/local/lib/python3.6/site-packages/ansible/modules/network/f5/bigip_device_info.py

<localhost> PUT /home/mboster/.ansible/tmp/ansible-local-73580ev1lcolg/tmphdp8u7ap TO /home/mboster/.ansible/tmp/ansible-tmp-1591302659.2270741-189006385395292/AnsiballZ_bigip_device_info.py

<localhost> EXEC /bin/sh -c 'chmod u+x /home/mboster/.ansible/tmp/ansible-tmp-1591302659.2270741-189006385395292/ /home/mboster/.ansible/tmp/ansible-tmp-1591302659.2270741-189006385395292/AnsiballZ_bigip_device_info.py && sleep 0'

<localhost> EXEC /bin/sh -c '/usr/bin/python3 /home/mboster/.ansible/tmp/ansible-tmp-1591302659.2270741-189006385395292/AnsiballZ_bigip_device_info.py && sleep 0'

<localhost> EXEC /bin/sh -c 'rm -f -r /home/mboster/.ansible/tmp/ansible-tmp-1591302659.2270741-189006385395292/ > /dev/null 2>&1 && sleep 0'

The full traceback is:

 File "/tmp/ansible_bigip_device_info_payload_b_s1s_gf/ansible_bigip_device_info_payload.zip/ansible/modules/network/f5/bigip_device_info.py", line 16259, in main

 File "/tmp/ansible_bigip_device_info_payload_b_s1s_gf/ansible_bigip_device_info_payload.zip/ansible/modules/network/f5/bigip_device_info.py", line 15999, in exec_module

 File "/tmp/ansible_bigip_device_info_payload_b_s1s_gf/ansible_bigip_device_info_payload.zip/ansible/modules/network/f5/bigip_device_info.py", line 16078, in execute_managers

 File "/tmp/ansible_bigip_device_info_payload_b_s1s_gf/ansible_bigip_device_info_payload.zip/ansible/modules/network/f5/bigip_device_info.py", line 15674, in exec_module

 File "/tmp/ansible_bigip_device_info_payload_b_s1s_gf/ansible_bigip_device_info_payload.zip/ansible/modules/network/f5/bigip_device_info.py", line 15682, in _exec_module

 File "/tmp/ansible_bigip_device_info_payload_b_s1s_gf/ansible_bigip_device_info_payload.zip/ansible/modules/network/f5/bigip_device_info.py", line 7092, in to_return

 File "/tmp/ansible_bigip_device_info_payload_b_s1s_gf/ansible_bigip_device_info_payload.zip/ansible/modules/network/f5/bigip_device_info.py", line 15253, in destination_address

 File "/tmp/ansible_bigip_device_info_payload_b_s1s_gf/ansible_bigip_device_info_payload.zip/ansible/modules/network/f5/bigip_device_info.py", line 15634, in destination_tuple

 

fatal: [ftbc-f5-dev1 -> localhost]: FAILED! => {

   "changed": false,

   "invocation": {

       "module_args": {

           "gather_subset": [

               "virtual-servers"

           ],

           "provider": {

               "auth_provider": null,

               "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",

               "server": "ftbc-f5-dev1",

               "server_port": 443,

               "ssh_keyfile": null,

               "timeout": null,

               "transport": "rest",

               "user": "mboster",

               "validate_certs": false

           }

       }

   },

   "msg": "The provided destination is not a valid IP address"

 

 

5 REPLIES 5

Sachin-Garg
Altostratus
Altostratus

Can you please share your

 

BIG-IP software version & Ansible Version & Python version

 

I can see python3.6

 

bigip_gather_facts has been deprecated /Removed in Ansible version 2.11 (This module has ben removed in version 2.11. [deprecated])

 

The bigip_facts module relies on SOAP to communicate with the BIG-IP, and has a large amount of code that does not conform to existing F5 standards.

 

The bigip_device_info module (Requires BIG-IP software version >= 12) is easier to maintain and use. This module was called  bigip_device_facts  before Ansible 2.9. The usage did not change.

 

 

can you provide the output of curling these two APIs

https://IP_ADDRESS/mgmt/tm/sys/software/image

https://IP_ADDRESS/mgmt/tm/sys/software/hotfix

 

Please see this section:

 

fatal: [ftbc-f5-dev1 -> localhost]: FAILED! => {

   "changed": false,

   "invocation": {

       "module_args": {

           "gather_subset": [

               "virtual-servers"

           ],

           "provider": {

               "auth_provider": null,

               "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",

               "server": "ftbc-f5-dev1",

               "server_port": 443,

               "ssh_keyfile": null,

               "timeout": null,

               "transport": "rest",

               "user": "mboster",

               "validate_certs": false

           }

       }

   },

   "msg": "The provided destination is not a valid IP address"

 

  1.  this is the error you're receiving?

fatal: [ftbc-f5-dev1 -> localhost]: FAILED! => {

"msg": "The provided destination is not a valid IP address"}

 

It Seems that the partition is not striped correctly since the regex doesn't match numbers and your partition name may contains numbers. Can you please share the names of the partitions.

 

2. validate_certs must be one of: yes,no

validate_certs: False

 

Can you try the latest version:

Minimum Ansible Version 2.8

 

https://galaxy.ansible.com/f5devcentral/f5ansible

 

 

Try these links

https://github.com/F5Networks/f5-ansible/issues/1124

https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return...

https://clouddocs.f5.com/training/fas-ansible-workshop-101/1.8-virtual-server-facts.html

https://clouddocs.f5.com/products/orchestration/ansible/devel/modules/bigip_device_facts_module.html

https://clouddocs.f5.com/products/orchestration/ansible/devel/modules/bigip_virtual_server_module.ht...

markbz
Altostratus
Altostratus

ansible --version

ansible 2.9.0

 config file = /etc/ansible/ansible.cfg

 configured module search path = ['/home/mboster/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']

 ansible python module location = /usr/local/lib/python3.6/site-packages/ansible

 executable location = /usr/local/bin/ansible

 python version = 3.6.8 (default, Apr 2 2020, 13:34:55) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

 

[mboster@fthc-ctrl-net1 ~]$ python --version

Python 2.7.5

 

target partitiion is /Common

 

list auth partition default-route-domain

auth partition AC-PROD {

   default-route-domain 0

}

auth partition Common {

   default-route-domain 0

}

auth partition test_partition {

   default-route-domain 0

}

 

see attached png file for image. There isn't any hotfix.

 

1. Yes that is the error I am receiving

 

2. validate_certs: no is set in the master_playbook.yml

 

 

markbz
Altostratus
Altostratus

From the master playbook, validate_certs is no, which is where the reported false comes from.

 

 vars:

    provider:

      password: "{{ password }}"

      server: "{{ inventory_hostname }}"

      user: "{{ username }}"

      validate_certs: no

      server_port: 443

 

 

Darius
Nimbostratus
Nimbostratus

markbz,

So are you saying that you can take the exact same playbook and change the information in gather_subset and you get an error ONLY when trying to use "virtual-servers"?

 

This works

... ... gather_subset: - virtual-addresses ... ...

but this doesn't?

... ... gather_subset: - virtual-servers ... ...

 

markbz
Altostratus
Altostratus

Darius,

Yes that is exactly what happens.

using - virtual-servers results in a crash.