F5Networks / f5-ansible

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

bigip_ucs_fetch: unsupported parameter only_create_file #2288

Open michael-andretta opened 1 year ago

michael-andretta commented 1 year ago
COMPONENT NAME

bigip_ucs_fetch, only_create_file parameter

Environment

ANSIBLE VERSION
ansible 2.9.27
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.5.3
  Build       0.16.5
  Edition     Engineering Hotfix
  Date        Tue Mar  9 12:02:22 PST 2021

Hotfix List
ID625156-1
CONFIGURATION

None

OS / ENVIRONMENT
SUMMARY

When trying to use the only_create_file parameter in the bigip_ucs_fetch module, you are presented with an error message

"Unsupported parameters for (bigip_ucs_fetch) module: only_create_file Supported parameters include: attributes, backup, content, create_on_missing, delimiter, dest, directory_mode, encryption_password, fail_on_missing, follow, force, group, mode, owner, provider, regexp, remote_src, selevel, serole, setype, seuser, src, unsafe_writes"

Conversation about this issue has been displayed on DevCentral @ https://community.f5.com/t5/technical-forum/bigip-ucs-fetch-unsupported-parameter-only-create-file/m-p/307552/emcs_t/S2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufExDSkJSMzZHVVg0VzBBfDMwNzU1MnxTVUJTQ1JJUFRJT05TfGhL#M264950

STEPS TO REPRODUCE
---
- name: Set Current Time and Date
  command: date "+%m-%d-%y"
  register: date
  delegate_to: localhost
  run_once: True

- name: Set Dynamic Hostname
  set_fact:
    f5_device: "{{ inventory_hostname + '-' + date.stdout + '-backup.ucs' }}"

- name: debug fact
  debug:
    var: f5_device

- name: Create UCS Backup
  bigip_ucs_fetch:
    src: '{{ f5_device }}'
    only_create_file: true
    provider: '{{ provider }}'
  delegate_to: localhost
...
EXPECTED RESULTS

A UCS backup should be created on the local system only.

ACTUAL RESULTS
{
"msg": "Unsupported parameters for (bigip_ucs_fetch) module: only_create_file Supported parameters include: attributes, backup, content, create_on_missing, delimiter, dest, directory_mode, encryption_password, fail_on_missing, follow, force, group, mode, owner, provider, regexp, remote_src, selevel, serole, setype, seuser, src, unsafe_writes",
"invocation": {
"module_args": {
"src": "ltm01a.domain.com-01-04-23-backup.ucs",
"only_create_file": true,
"provider": {
"user": "admin",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"server": "ltm01a.dmain.com",
"validate_certs": false,
"server_port": null,
"ssh_keyfile": null,
"transport": "rest",
"timeout": null,
"auth_provider": null
}
}
},
"_ansible_no_log": false,
"changed": false,
"_ansible_delegated_vars": {
"ansible_host": "localhost",
"ansible_port": null,
"ansible_user": "admin",
"ansible_connection": "local"
}
}
wojtek0806 commented 1 year ago

What version of collection have you got installed? this parameter is available from 1.12.0 collection onwards?

You need to install the current version of the collection and retry, also looks like you are using a dated ansible version to use the latest version of collection we suggest installing the current supported community versions: https://clouddocs.f5.com/products/orchestration/ansible/devel/f5_modules/supported-versions.html

michael-andretta commented 1 year ago

yes it says it available but I have proven in DevCentral link that it does not work as documented. I have collection 1.20 installed. Please look at the dev central link which shows the version of the collection pulled at run time. An F5 individual has ack'ed in the Dev Central link that someone there "sees the issue" all I needed to do was open the Issue.

michael-andretta commented 1 year ago

@wojtek0806 im asking out automation team to get me a venv that will run ansible 4 so this can be applied to the template and run. Will follow up once that is done.

wojtek0806 commented 1 year ago

i suspect if you are using Ansible 2.9 it might be calling to modules that shipped inside 2.9, if i see -vvvv output i would know for sure, another thing you can do is in your playbook, try specifying something like this:

collections:
  - f5networks.f5_modules

or append collection name to the module name when defining it in a task e.g.

f5networks.f5_modules.bigip_ucs_fetch

michael-andretta commented 1 year ago

@wojtek0806 It is version 2.9 although I am using the collection call out like this. The automation team is looking at getting ansible 4 on a venv so we can test it on the newer version.

collections:
  - name: f5networks.f5_modules
    source: https://galaxy.ansible.com
    version: 1.20.0