f5-ansible icon indicating copy to clipboard operation
f5-ansible copied to clipboard

bigip_file_copy feature request to support an iRule reference

Open Sam-Hall opened this issue 5 years ago • 3 comments

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

bigip_file_copy

ANSIBLE VERSION
ansible 2.9.0.dev0
  config file = /home/shall/application-delivery/ansible/ansible.cfg
  configured module search path = [u'/home/shall/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/shall/venv/local/lib/python2.7/site-packages/ansible
  executable location = /home/shall/venv/bin/ansible
  python version = 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609]
PYTHON VERSION
Python 2.7.12
BIGIP VERSION

N/A

ROLE VERSION
Role: f5devcentral.f5ansible
        description: Ansible role that allows use of the F5 Ansible Modules
        active: True
        commit: d8a64711cf8311c0f4dd5c6703606003fc6c0c90
        commit_message: Merging upstream changes - 2019-06-18T07:00:37Z
        commit_url: https://api.github.com/repos/f5devcentral/ansible-role-f5ansible/git/commits/d8a64711cf8311c0f4dd5c6703606003fc6
        company: F5 Networks
        created: 2018-10-04T16:14:10.510085Z
        dependencies: []
        download_count: 7499
        forks_count: 0
        galaxy_info:
                author: caphrim007
                company: F5 Networks
                galaxy_tags: ['f5', 'networking', 'bigip', 'bigiq']
                license: GPLv3
                min_ansible_version: 2.8
                platforms: [{'name': 'EL', 'versions': ['all']}, {'name': 'Fedora', 'versions': ['all']}, {'name': 'Ubuntu', 'versio
                role_name: f5ansible
        github_branch: master
        github_repo: ansible-role-f5ansible
        github_user: f5devcentral
        id: 30341
        imported: 2019-06-18T03:04:45.679606-04:00
        install_date: Fri May 31 01:23:49 2019
        installed_version: v2019.5.24
        is_valid: True
        issue_tracker_url:
        license: GPLv3
        min_ansible_version: 2.8
        modified: 2019-06-18T07:04:45.687011Z
        open_issues_count: 0
        path: (u'/home/shall/.ansible/roles', u'/usr/share/ansible/roles', u'/etc/ansible/roles')
        role_type: ANS
        stargazers_count: 4
        travis_status_url: https://travis-ci.org/f5devcentral/ansible-role-f5ansible.svg?branch=master
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

Correct me if I'm wrong, but currently it seems there's no way to create the iRule reference required to use an iFile uploaded via bigip_file_copy. I have to use bigip_command with something like "create ltm ifile {{ item }} { file-name {{ item }} }". The problem I'm facing later is that if an iFile changes, the reference created using this command prevents bigip_file_copy module from updating the iFile.

LTM supports creating many iRule references to a given iFile with a wide variety of names. However, I can't think of any sane application of this in the real world other than simply creating a single reference with the same name that the iFile has. We don't use partitions at all, other than Common though. So maybe I'm missing something that may have to do with partitions.

To meet my own needs, and for simplicity sake, I propose adding "irule_reference" option of type true/false/yes/no to bigip_file_copy that ensures a reference is maintained accordingly in the same partition as the iFile and having the same name.

  • If the option is false and the file has not changed, simply check the reference doesn't exist and remove it if it does (also flag status as "changed")
  • If the option is true and the file has not changed, check the reference exists and add if it does not (flagging status as "changed")
  • If the file being uploaded is different and option is false, ensure any existing reference is removed before updating the file (avoiding an error that currently occurs)
  • If the file being uploaded is different and option is true, likewise ensure any existing reference is removed before updating the file and recreate the reference after the update (also avoiding existing error states that may occur)

Currently in my playbook I have to use bigip_command to destroy all ifile references before using the bigip_file_copy module to ensure they're all in sync. Otherwise changes throw an error and don't update the changed iFiles. Then it calls bigip_command afterwards to recreate all the references and make them available to iRules again. This causes all our iFiles to be unavailable to iRiles for a few seconds while the playbook is running. It would be better to avoid faffing around with the reference unless required to update a specific iFile so any potential outage of these resources is minimal.

Sam-Hall avatar Jun 18 '19 07:06 Sam-Hall

FMFA-298

wojtek0806 avatar Jul 08 '19 13:07 wojtek0806

I faces same issue. Is that correct a work-around may be to upload file with a different name (including Git commit hash for instance) and to "update" reference to new file before deleting no longer referred original from ifile datastore? Notice you may use following module to manage iFile reference: https://github.com/erjac77/ansible-module-f5bigip/blob/master/library/f5bigip_ltm_ifile.py

ymartin59 avatar Sep 02 '19 14:09 ymartin59

Also interested in this.

dagheyman avatar May 28 '21 11:05 dagheyman

Hi, we are closing this request now. Please re-open if required or send an email to [email protected]. Thanks!

KrithikaChidambaram avatar Feb 17 '23 09:02 KrithikaChidambaram