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

[BUG]: nfs module adds clients instead of replacing them by the provided list

Open fthommen opened this issue 1 year ago • 2 comments

Describe the bug When specifying NFS clients in call of the nfs module, these clients will be added to the respective NFS export list instead of replacing the existing host by the provided list.

This can lead to confusing and unwanted setups.

To Reproduce Steps to reproduce the behavior:

  1. Run the following playbook:
- name: "CREATE SHARE 1"
  hosts: localhost
  gather_facts: no
  tasks:
    - name: "DELL PowerScale : Create NFS Export"
      dellemc.powerscale.nfs:
        onefs_host:   "{{onefs_host}}"
        api_user:     "{{api_user}}"
        api_password: "{{api_password}}"
        verify_ssl:   False

        path:         "/ifs/test"
        state:        "present"
        clients:      "host1"
        read_only:    false
        client_state: "present-in-export"
  1. Check export on Isilon:
isilon% isi nfs exports view 109 | grep Clients   
                Clients: host1
           Root Clients: -
      Read Only Clients: -
     Read Write Clients: -
isilon%
  1. Now run the following playbook:
- name: "CREATE SHARE 2"
  hosts: localhost
  gather_facts: no
  tasks:
    - name: "DELL PowerScale : Create NFS Export"
      dellemc.powerscale.nfs:
        onefs_host:   "{{onefs_host}}"
        api_user:     "{{api_user}}"
        api_password: "{{api_password}}"
        verify_ssl:   False

        path:         "/ifs/test"
        state:        "present"
        clients:      "host2"
        read_only:    false
        client_state: "present-in-export"
  1. Check export on Isilon:
isilon% isi nfs exports view 109 | grep Clients   
                Clients: host1, host2
           Root Clients: -
      Read Only Clients: -
     Read Write Clients: -
isilon%

Expected behavior Intuitively and also according to the documentation (https://github.com/dell/ansible-powerscale/blob/main/docs/modules/nfs.rst: "clients: Specifies the clients to the export"), the list of clients should be set to the list which is provided in the playbook.

System Information (please complete the following information):

  • OS/Version: OneFS 9.4.0.11
  • Ansible: 2.16.3
  • Python: 3.12.1
  • PowerScale module: 3.0.0
  • Isilon SDK: 0.3.0.1

Additional context I see this as a design bug, as there doesn't seem to be a way to set the NFS clients based on a list. To have the desired result, one would have to get the list of current clients (for which afaik there is no possibility within the PowerScale modules), parse the output, remove unwanted clients and add wanted clients.

The bug also applies to the other client types (root, read-only, read-write)

fthommen avatar Jul 25 '24 17:07 fthommen

@fthommen, thank you for submitting this feature enhancement. I find merit in having the making this as declarative as possible. I will get this added to the backlog.

anupamaloke avatar Jul 30 '24 16:07 anupamaloke

@anupamaloke I'm not sure I understand your comment correctly. This was posted as a bug report, not a feature enhancement

fthommen avatar Jul 30 '24 21:07 fthommen

Hi @anupamaloke we decided not to use the Powerscale Ansible modules any more. We will instead switch to isi scripts, which give us the full power of the functionalities w/o the limitations of the Powerscale modules. I will therefore close this issue. Of course you are free to continue on your own if you think, that this is a general issue, but I'd rather not be involved with it any more.

fthommen avatar Aug 23 '24 19:08 fthommen