dell / ansible-powerscale

PowerScale (Isilon) Ansible modules
GNU General Public License v3.0
29 stars 21 forks source link

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

Closed fthommen closed 2 months ago

fthommen commented 3 months ago

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"
  2. Check export on Isilon:
    isilon% isi nfs exports view 109 | grep Clients   
                Clients: host1
           Root Clients: -
      Read Only Clients: -
     Read Write Clients: -
    isilon%
  3. 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"
  4. 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):

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)

anupamaloke commented 3 months ago

@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.

fthommen commented 3 months ago

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

fthommen commented 2 months ago

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.