F5Networks / f5-ansible

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

Ansible module to associate traffic-group-local-only Traffic Group with a partition created prior (e.g., LOCAL_ONLY) #1901

Closed ghost closed 1 year ago

ghost commented 3 years ago
ISSUE TYPE
COMPONENT NAME

bigip_device_traffic_group

ANSIBLE VERSION
2.9
PYTHON VERSION
2.7.16
BIGIP VERSION
15.1
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

The current module does not allow the 'traffic-group-local-only' to be associated with a partition created prior.

STEPS TO REPRODUCE
- name: Associate local traffic group to LOCAL_ONLY partition
      bigip_device_traffic_group:
        name: traffic-group-local-only
        partition: LOCAL_ONLY
        provider: "{{ bigip_provider }}"
      delegate_to: localhost
EXPECTED RESULTS

traffic-group-local-only to be associated with LOCAL_ONLY partition

ACTUAL RESULTS
TASK [Associate local traffic group to LOCAL_ONLY partition] **************************************************************************************
task path: /Users/chzhang/Documents/abgmbh/halab/bigips.yaml:59
fatal: [x.x.x.x]: FAILED! => {"changed": false, "msg": "Traffic groups can only be created in the /Common partition"}
focrensh commented 3 years ago

Will you please elaborate on the use case here. It is common for a LOCAL_ONLY partition to be created which references the traffiic-group "traffic-group-local-only". This issue is trying to perform the opposite.

ghost commented 3 years ago

It is common for a LOCAL_ONLY partition to be created which references the traffiic-group "traffic-group-local-only".

This is not happening with the Ansible module being tested.

The user case is using Ansible for HA configuration in AWS. The default gateway on each of the F5's cannot be synced to the other as the F5's are on completely different subnets.

focrensh commented 3 years ago

Association to of a traffic-group to a partition is done when creating the partition, not the traffic group. The intent of this module is for creating new traffic-groups which is restricted to Common. After the traffic-group is created, you can then reference it when creating a new partition. I believe that traffic-group-local-only should exist on BIG-IP by default, so that part is already done.

We should highlight that the create user partition LOCAL_ONLY and create folder LOCAL_ONLY are different. This module is associated with the API endpoint for partition and not folder which is what contains the ability to associate traffic-groups.

We do have a module for partition creation: https://clouddocs.f5.com/products/orchestration/ansible/devel/modules/bigip_partition_module.html#bigip-partition-module

This screen shot in the TMUI actually runs

create { folder { folder_name "/LOCAL_ONLY" folder_traffic_group "/Common/traffic-group-local-only" folder_devicegroup "default" folder_description "" } }

image

It seems that we would need to handle the association to the partition behind the scenes based on an RFE or add a new module for folder management which contains the parameter for traffic-group.

Would this logic handle the use case?

KrithikaChidambaram commented 1 year ago

Closing this now. Reopen if you still face the issue. Thanks!