#Having issues with netapp.ontap.na_ontap_rest_cli:

1 messages · Page 1 of 1 (latest)

dull shadow
#

I did a check with the following code and it ran ok
- name: System Services Web HTTP-enabled
netapp.ontap.na_ontap_rest_cli:
command: 'set-privelege advanced;system services web modify -http-enabled true'
#privilege: advanced
#return_dict: false
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
verb: PATCH
validate_certs: false
#https: true

However when I ran it with I got an api not found error

#

I am trying to run command lines for some things in ontap. I thought above would work from what I had seen in examples

dull shadow
#
  • name: System Services Web HTTP-enabled
    netapp.ontap.na_ontap_rest_cli:
    command: 'api/private/cli/system/services/web/modify '
    #privilege: advanced
    #return_dict: false
    hostname: "{{ hostname }}"
    username: "{{ username }}"
    password: "{{ password }}"
    verb: PATCH
    params: {"http_enabled" : 'true'}
    validate_certs: false
    #https: true
#

I tried to break it out to the REST CLI method but I am still getting hung up trying to run commands.

thorny wadi
#

The command is incorrect. Leave out "api/private/cli", the module will add that for you. Also leave out "/modify" that is done via the verb: PATCH.
So finally command should look like this (untested) command: 'system/services/web'

#

Also your params: is not used correctly, this should be body: instead. Params is for query parameters, if you want to do a setting on a specific vserver then you use it like this
params: vserver: foo
Body contains the settings that will be modified. So in your case should be
body: http_enabled: true

So here is the full example that should work
- name: System Services Web HTTP-enabled netapp.ontap.na_ontap_rest_cli: hostname: "{{ hostname }}" username: "{{ username }}" password: "{{ password }}" validate_certs: false command: system/services/web verb: PATCH body: http_enabled: true