Start a Conversation

Solved!

Go to Solution

Closed

1 Rookie

 • 

17 Posts

654

June 19th, 2023 10:00

dellemc.powerscale.nfs not getting option to make it MAP_ROOT user as "ROOT"

- name: "Create NFS Share(read_write_clients) With quota_full_path_dev_source -> { { quota_full_path_dev_source }}"
dellemc.powerscale.nfs:
onefs_host: "{ { isilon_ip_address_p }}"
verify_ssl: "false"
api_user: "{ { isilon_api_user }}"
api_password: "{ { isilon_api_password }}"
path: "{ { quota_full_path_dev_source }}"
description: "{ { description }}"
access_zone: "System"
read_write_clients:
- "{ { item }}"
sub_directories_mountable: true # --all-dirs yes
client_state: 'present-in-export'
state: 'present'
loop: "{ { client_nfs_export_server_list }}"


===============

we noticed that by above code we are getting

"map_root":
{
"groups": [""],
"user": "nobody" -----------> nobody should be replaced with root
}

 

how to achieve this.

1 Rookie

 • 

79 Posts

June 23rd, 2023 03:00

Hi @Javed Khan Siddque 

Currently this is not supported through ansible module. We will look into adding support through the module. You could raise a ticket https://github.com/dell/ansible-powerscale/issues to track the same

Meanwhile you could also use the ansible uri module to achieve setting the map_root user. Attaching sample playbook for the same below 

---
- hosts : localhost

  vars :
    onefs_ip : 10.*.*.*
    username : " ** "
    password : " ** "
    port : 8080

  tasks :
    - name : Get nfs exports
      uri :
        url : https://{ {onefs_ip}}:{ {port}}/platform/4/protocols/nfs/exports/
        user : " { {username}} "
        password : " { {password}} "
        force_basic_auth : True
        method : GET
        headers :
          Content-Type : ' application/json '
        validate_certs : no

    - name : Modify nfs export details
      uri :
        url : " https://{ {onefs_ip}}:{ {port}}/platform/4/protocols/nfs/exports/< > "
        user : " { {username}} "
        password : " { {password}} "
        force_basic_auth : True
        method : PUT
        body : >
          {"map_root": {"enabled": true, "user": {"name": "root"}}}
        body_format : json
        headers :
          Content-Type : ' application/json '
        validate_certs : no
        status_code : 204
 
Thanks,
Jennifer

1 Rookie

 • 

17 Posts

June 23rd, 2023 11:00

Thanks So much .
i am aware of URI module
and it worked 

======

  - name : "Create NFS Share With quota_full_path_prod_source -> { { quota_full_path_prod_source }} "
        ansible.builtin.uri :
          url : "https:// { { isilon_ip_address_p }} :8080/platform/1/protocols/nfs/exports"
          user : " { { isilon_api_user }} "
          password : " { { isilon_api_password }} "
          method : POST
          force_basic_auth : true
          validate_certs : false
          body_format : json
          status_code : [ 200 , 201 , 202 ]
          body : {
              "all_dirs" : true ,
              "description" : " { { description }} " ,
              "map_root" : {
                "groups" : [ "" ],
                "user" : "root"
              },
              "paths" : [
                  " { { quota_full_path_prod_source }} "
              ],
              "read_write_clients" : " { { client_nfs_export_server_list }} " ,
              "clients" : " { { client_nfs_export_server_list }} " ,
              "root_clients" : " { { client_nfs_export_server_list }} "
          }



No Events found!

Top