#Module for enabling LLDP and CDPD

1 messages · Page 1 of 1 (latest)

stray wyvern
#

Is there an Ansible module that will allow you to enable LLDP and CDPD (CLI command: options -option-name lldp.enable -option-value on) other than the REST CLI module? I tried using na_ontap_svm_options, but it doesn't work without specifying a vserver. Since this is really a node level setting, I tried using the admin vserver, which didn't work. Then, I tried looping through the node names as the vservers, but that didn't work either.

stray wyvern
#

So, it appears that this no longer works even with na_ontap_command. It runs, says it changed something, but then nothing is changed.
Is there some way to set this option using Ansible?

limpid pumice
halcyon totem
#

I've used this in the past with na_ontap_command - haven't used it in a while but give it a try...

command: ['node', 'run', '-node', '*', 'options', 'cdpd.enable', 'on']

#

I couldn't tell if you were using node run -node as part of the CLI command

stray wyvern
#

So, interestingly, the problem seems to be that 'na_ontap_command' has to run as the cluster admin account? I have been using a local account with the admin role for all of my other plays, and they work fine, but that seems to be what's not allowing the na_ontap_command. This is the simple play I'm running:

- hosts: localhost
  collections:
    - netapp.ontap
  gather_facts: false
  vars:
    input: &input
      hostname: "cluster01"
      username: "admin"
      password: <nunyabusiness>
      validate_certs: false
      https: true
  tasks:
  - name: Enable LLDP
    netapp.ontap.na_ontap_command:
      <<: *input
      command: ['version']```

When I run it with the admin account, I get back the following (from -vvv output):
```"msg": "<results xmlns=\http://www.netapp.com/filer/admin\ status=\"passed\"><cli-output>NetApp Release 9.8P18: Wed Mar 29 13:19:30 UTC 2023\n\n</cli-output><cli-result-value>1</cli-result-value></results>"```

But, when I run it using a local account that I created, it doesn't give any kind of error, and it shows 1 change, but I get this response:
```"msg": "<results xmlns=\http://www.netapp.com/filer/admin\ status=\"passed\"><cli-output/><cli-result-value>0</cli-result-value></results>"```
limpid pumice
#

It could be a permissions issue. It been a long time since we wrote this (5 years) but it need the following permission to run form the documentation.

Can’t be used with cert authentication and domain authentication accounts.
Requires ontapi and console permissions. Console is not supported for data vservers.
Requires write permissions, even for show commands

#

But i also remember that <results xmlns=\http://www.netapp.com/filer/admin\ status=\"passed\"><cli-output/><cli-result-value>0</cli-result-value></results> would be sent when a command was issued to the zapi and the zapi did nothing and return a 0

stray wyvern
#

Thank you, @limpid pumice! That's what I needed. The account I created didn't have "console" access, so I just added that, and it's working now.
Really would be nice if they would let us do this stuff through REST though. I really don't like having to resort to the na_ontap_command.

leaden blaze
stray wyvern
#

You read the documentation!?!?! That's crazy talk! 😆
Thank you, @leaden blaze!!! That worked!

Still wish there was a module for this though, because the na_ontap_rest_cli still reports that there was a change, even when there isn't.

swift dragon
#

Agreed, I wish there were modules for every command that is available via the CLI. however, Chris and his team are limited to what the ONTAP Devs expose via the APIs. If they don't make an API available for Chris to work with, there isn't much he can do.

Best option is to submit a feature request via your account team. I push all my customers for these. The more requests that engineering see, the better for us!

sleek veldt
#

Using the na_ontap_rest_cli like in the example above...no way to add idempotency right?
I believe the REST API/module returns same HTTP code regardless if changed or not?

Need 1 task to check current option value? Need a 2nd task to set desired param value with a when clause on the task when the option value doesn't match the desired?