F5Networks / f5-ansible-f5os

Collection for managing F5OS based devices
2 stars 1 forks source link

socket_path must be a value #7

Open benomary opened 4 weeks ago

benomary commented 4 weeks ago
COMPONENT NAME

f5networks.f5os.f5os_config_backup

Environment

ANSIBLE VERSION
ansible 6.7.0
ansible-core 2.13.13
F5OS VERSION
1.7.0-8741
CONFIGURATION
[defaults]
interpreter_python = /usr/bin/env python
forks = 10
host_key_checking = False
gathering = smart
error_on_undefined_vars = True
callbacks_enabled = timer, profile_roles, profile_tasks
retry_files_enabled = False
timeout = 120
OS / ENVIRONMENT
RHEL 7.9
SUMMARY

I m trying to play with this f5os module to backup and export my host configuration. I had an issue using API call and I saw that it was prefered to used ansible. https://community.f5.com/discussions/technicalforum/f5os-api-for-downloading-files-not-working-as-expected/315598

So when I run my playbook i have error saying : socket_path must be a value

STEPS TO REPRODUCE
- name: Create backup config and import it to remote server
  vars:
    ansible_host: "{{ f5_backup_host }}"
    ansible_httpapi_password: "{{ f5_backup_password }}"
    ansible_httpapi_port: "8888" #i also tried 443
    ansible_network_os: f5networks.f5_bigip.bigip
    ansible_httpapi_use_ssl: yes
    ansible_httpapi_validate_certs: "{{ f5_backup_validate_certs }}"
  f5networks.f5os.f5os_config_backup:
    name: test_backup.xml
    state: absent
EXPECTED RESULTS

To delete test_backup.xml from f5os host

ACTUAL RESULTS
The full traceback is:
Traceback (most recent call last):
  File "/home/user/.ansible/tmp/ansible-tmp-1717688947.7444158-34053-207442020276603/AnsiballZ_f5os_config_backup.py", line 107, in <module>
    _ansiballz_main()
  File "/home/user/.ansible/tmp/ansible-tmp-1717688947.7444158-34053-207442020276603/AnsiballZ_f5os_config_backup.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/user/.ansible/tmp/ansible-tmp-1717688947.7444158-34053-207442020276603/AnsiballZ_f5os_config_backup.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.f5networks.f5os.plugins.modules.f5os_config_backup', init_globals=dict(_module_fqn='ansible_collections.f5networks.f5os.plugins.modules.f5os_config_backup', _modlib_path=modlib_path),
  File "/opt/rh/rh-python38/root/usr/lib64/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/opt/rh/rh-python38/root/usr/lib64/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/opt/rh/rh-python38/root/usr/lib64/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_f5networks.f5os.f5os_config_backup_payload_vbowxqpd/ansible_f5networks.f5os.f5os_config_backup_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_config_backup.py", line 441, in <module>
  File "/tmp/ansible_f5networks.f5os.f5os_config_backup_payload_vbowxqpd/ansible_f5networks.f5os.f5os_config_backup_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_config_backup.py", line 433, in main
  File "/tmp/ansible_f5networks.f5os.f5os_config_backup_payload_vbowxqpd/ansible_f5networks.f5os.f5os_config_backup_payload.zip/ansible/module_utils/connection.py", line 124, in __init__
AssertionError: socket_path must be a value
wojtek0806 commented 4 weeks ago

Hello, looks like you are using old version of python and unsupported version of ansible, please upgrade to at least ansible core 2.14: https://github.com/F5Networks/f5-ansible-f5os?tab=readme-ov-file#requirements

Also you need at least python 3.9 as well: https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix

While 3.9 is the minimal version I would recommend to go to version 3.11 of python in your environment.

benomary commented 4 weeks ago

Yes I saw those requirements and I was hoping to get a workarround. My env can't be updated to python 3.9 & ansible 2.14