Forum Discussion

TNSOPS's avatar
TNSOPS
Icon for Altostratus rankAltostratus
Jan 18, 2023

Getting error when trying to run Ansible (2.9) playbook using bigip_device_info module

Playbook

(venv) $ cat playtest.yml
---


- name: MY TEST PLAYBOOK
hosts: F5
connection: local
gather_facts: false
collections:
- f5networks.f5_modules

tasks:
- name: Collect BIG IP FACTS
bigip_device_info:
gather_subset:
- system-info
provider:
server: "{{ansible_host}}"
user: "{{ansible_user}}"
password: "{{ansible_password}}"
validate_certs: false
register: device_facts
delegate_to: localhost

- name: Display BIG-IP information
debug:
var: device_facts
delegate_to: localhost

 

 


(venv) $ ansible-playbook playtest.yml

PLAY [MY TEST PLAYBOOK] ******************************************************************************************************************************************************************************************

TASK [Collect BIG IP FACTS] **************************************************************************************************************************************************************************************
fatal: [PP-CAGCC00-CBLBA01.devrns.devfg.rbc.com -> localhost]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (bigip_device_info) module: register Supported parameters include: data_increment, gather_subset, partition, provider"}

PLAY RECAP *******************************************************************************************************************************************************************************************************
PP-CAGCC00-CBLBA01.devrns.devfg.rbc.com : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

 

 

 

(venv) $ ansible --version
ansible 2.9.27
python version = 2.7.5 (default, May 27 2022, 11:27:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

 

(venv) $ ansible-doc -l | grep F5
bigip_gtm_monitor_http Manages F5 BIG-IP GTM http monitors
bigip_gtm_wide_ip Manages F5 BIG-IP GTM wide ip
bigip_pool Manages F5 BIG-IP LTM pools
bigip_gtm_pool Manages F5 BIG-IP GTM pools
bigip_gtm_monitor_https Manages F5 BIG-IP GTM https monitors
bigip_monitor_gateway_icmp Manages F5 BIG-IP LTM gateway ICMP monitors
bigip_monitor_tcp_half_open Manages F5 BIG-IP LTM tcp half-open monitors
bigip_gtm_server Manages F5 BIG-IP GTM servers
bigip_facts Collect facts from F5 BIG-IP devices
bigip_gtm_monitor_tcp Manages F5 BIG-IP GTM tcp monitors
bigip_monitor_tcp Manages F5 BIG-IP LTM tcp monitors
bigip_monitor_http Manages F5 BIG-IP LTM http monitors
bigip_gtm_monitor_tcp_half_open Manages F5 BIG-IP GTM tcp half-open monitors
bigip_node Manages F5 BIG-IP LTM nodes
bigip_device_info Collect information from F5 BIG-IP devices
bigip_gtm_virtual_server Manages F5 BIG-IP GTM virtual servers
bigip_pool_member Manages F5 BIG-IP LTM pool members
bigip_monitor_udp Manages F5 BIG-IP LTM udp monitors
bigip_gtm_facts Collect facts from F5 BIG-IP GTM devices
bigip_gtm_monitor_bigip Manages F5 BIG-IP GTM BIG-IP monitors
bigip_gtm_monitor_firepass Manages F5 BIG-IP GTM FirePass monitors
bigip_command Run TMSH and BASH commands on F5 devices
bigip_monitor_https Manages F5 BIG-IP LTM https monitors
bigiq_device_info Collect information from F5 BIG-IQ devices
bigip_monitor_tcp_echo Manages F5 BIG-IP LTM tcp echo monitors

 

  • i got this working by removing delegate_to: localhost under the task and only keep connection: local at the global level.

     

  • TNSOPS  - did Nikoolayy1's reply help you out? If yes, please click Accept as Solution so future users facing the same problem can easily find the solution they need. 🙂

  • I played around as I got interested in using ansible f5 facts and it worked for me with:

     

    - name: Collect BIG-IP facts
    bigip_device_info:
    provider: "{{ provider }}"
    gather_subset:
    - system-info
    register: device_result

    - name: Display the results
    debug:
    var: device_result.ansible_facts.ansible_net_system_info.product_version

     

  • i got this working by removing delegate_to: localhost under the task and only keep connection: local at the global level.

     

  • Working Playbook

    (venv) $ cat F5_device_info_test.yml
    ---


    - name: MY TEST PLAYBOOK
    hosts: f5
    gather_facts: false
    connection: local
    vars:
    ansible_python_interpreter: $(which python)
    provider:
    server: "{{ansible_host}}"
    user: "{{ansible_user}}"
    password: "{{ansible_password}}"
    validate_certs: false
    server_port: 443
    tasks:
    - name: Collect BIG IP FACTS
    f5networks.f5_modules.bigip_device_info:
    gather_subset:
    - system-info
    provider: "{{provider}}"
    register: device_facts

    - name: Display BIG-IP information
    debug:
    var: device_facts['system_info']['product_version']