erjac77 / ansible-module-f5bigip

Ansible module for F5 BIG-IP
Apache License 2.0
6 stars 3 forks source link

F5BigIpUnnamedObject doesn't have a _get_resource_id_from_path method. #127

Closed jonozzz closed 6 years ago

jonozzz commented 6 years ago

https://github.com/erjac77/ansible-module-f5bigip/blob/4f4a179dec4edc2d53536d2c8500c3b0c92a027d/library/f5bigip_ltm_virtual_source_address_translation.py#L81

erjac77 commented 6 years ago

@jonozzz, Thanks for reporting the issue.

Source Address Translation is actually not a "subcollection", but an "array structure", so some refactoring may be needed for this component.

I'll look into it this week.

jonozzz commented 6 years ago

Cool! Thanks.

I was going to write a quick and dirty patch to unblock this, but then I decided to open a new bug. It was getting too hairy too quickly :)

erjac77 commented 6 years ago

@jonozzz, I've just pushed a fix for that. Can you give it a try and let me know if it works as expected?

I removed the Source Address Translation component and added a parameter to Virtual instead, since it is not a subcollection. So to configure a SAT on a Virtual Server, you can do as follow:

- name: Add SNAT Pool to a Virtual
  f5bigip_ltm_virtual:
    f5_hostname: "{{ bigip_host }}"
    f5_username: "{{ bigip_username }}"
    f5_password: "{{ bigip_password }}"
    f5_port: "{{ bigip_port }}"
    name: my_http_vs
    partition: Common
    source_address_translation:
      pool: my_snatpool
      type: snat
    state: present
  delegate_to: localhost
jonozzz commented 6 years ago

I just sync'd your changes. Yes, works like a charm now.

Thanks a bunch!

erjac77 commented 6 years ago

Glad to hear that, I'm gonna close the issue. Please feel free to reopen if needed.