Pure-Storage-Ansible / FlashArray-Collection

Ansible Collection for Pure Storage FlashArray
GNU General Public License v3.0
18 stars 23 forks source link

Network interface configuration shows always "changed" status #382

Closed dbuenoparedes closed 1 year ago

dbuenoparedes commented 1 year ago

Describe the bug When I run a task using purefa_network to configure one or multiple interface addresses I always get the status: changed result even if the interface is already configured with the same settings the task is fed with. Seems idempotence is missing.

To Reproduce Steps to reproduce the behavior:

  1. Configure an interface with some settings (either manually or via Ansible)
  2. Create a task using purefa_network to configure the same interface with the same settings
  3. Ansible shows the output of changed every time the task runs, no matter if you run it a 2nd time or 3rd time...

Expected behavior Ansible report with status: ok instead of status: changed when using purefa_network on an already configured interface with the same settings

Screenshots Ansible output with verbosity 3 (-vvv) every time purefa_network task runs:

changed: [purearray01] => (item={'key': 'vir1', 'value': {'ip': '172.16.0.111/24', 'gw': '172.16.0.1'}}) => changed=true 
  ansible_loop_var: item
  invocation:
    module_args:
      address: 172.16.0.111/24
      api_token: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
      fa_url: <redacted>
      gateway: 172.16.0.1
      mtu: 1500
      name: vir1
      servicelist:
      - management
      state: present
  item:
    key: vir1
    value:
      gw: 172.16.0.1
      ip: 172.16.0.111/24

Ansible verbose output of the same interface when collecting the info of the network interfaces using purefa_info (subset: network):

        vir1:
          address: 172.16.0.111
          enabled: true
          gateway: 172.16.0.1
          hwaddr: <redacted>
          mtu: 1500
          netmask: 255.255.255.0
          services:
          - management
          slaves: []
          speed: 1000000000

Desktop (please complete the following information):

Additional context I have a theory that this might be due to the way we feed the address to the purefa_network module, we provide the IP address in the form of IP/netmask but the output (and the GUI) shows that address is one field and netmask is a different field. Not entirely sure about this though.

sdodsley commented 1 year ago

@dbuenoparedes please check #383 to see if this resolves your issue.