#Create Cluster User Account with REST API

1 messages · Page 1 of 1 (latest)

silent urchin
#

Hi all, I'm trying to create the correct commands for an Ansible playbook to create cluster user:

How can I translate this curl command in a correct ansible playbook syntax?

"curl -k -u <cluster_admin>:<password> -X POST "https://<mgmt-ip>/api/security/accounts" -d '{"name":"cluster_user1","applications":[{"application":"ssh","authentication_methods":["password"],"second_authentication_method":"none"},{"application":"http","authentication_methods":["password"]}],"role":"admin","password":"p@ssw@rd123"}'"

Thank you for your help.

Regards,
Patrick

uneven harness
#

Using module defaults of username and password, here's how my task for it looks:

  • name: Creating local user on cluster
    netapp.ontap.na_ontap_user:
    hostname: "{{ hostname }}"
    state: present
    vserver: "{{ hostname }}"
    name: "cluster_user1"
    applications: http
    authentication_method: password
    set_password: 'p@ssw@rd123'
    role_name: "admin"