#Ansible License Module
1 messages · Page 1 of 1 (latest)
They are in the process of updating the module to support the NLF file format. I was provided a workaround that can apply licenses but not remove them, and the operation is not idempotent until the update is released.
netapp.ontap.na_ontap_license:
state: present
license_codes:
- "{{ lookup('file', nlf_filepath) | string }}"```
@verbal basin thank you for the details. Ill wait for an update on this module.
We're planning to release an update next week. But the work-around should work in the meantime. The updated module will use the same syntax.
DEVOPS-5812
Ok thanks @silent anvil
Adding licenses is failing with below error. Below playbook code worked fine until recently when I updated the collections to latest 22.5.0. ONTAP version is 9.10.1P10. Adding use_rest: never to the code works fine.
- name: "Add Licenses: {{ cluster }}"
netapp.ontap.na_ontap_license:
state: present
license_codes: "{{ item.codes }}"
<<: *clusterlogin
with_items: "{{ license_codes }}"
when: license_codes is defined
tags:- license_codes
failed: [localhost] (item={'codes': 'xyz
ansible_loop_var: item
item:
codes: xyz
msg: 'Error adding license: calling: cluster/licensing/licenses: got {''message'': ''Failed to install the license at index 0 (keys[0]). Reason: License addition failed.'', ''code'': ''1115131'', ''arguments'': [{''message'': ''0''}, {''message'': ''License addition failed.''}], ''target'': ''keys''}. - previous license status: {''installed_licenses'': {''1234567'': {''Core Bundle''}, ''9123456'': {''Core Bundle''}}, ''base'': ''compliant'', ''nfs'': ''compliant'', ''cifs'': ''compliant'', ''iscsi'': ''compliant'', ''fcp'': ''compliant'', ''snaprestore'': ''compliant'', ''snapmirror'': ''compliant'', ''flexclone'': ''compliant'', ''snapvault'': ''compliant'', ''snaplock'': ''unlicensed'', ''snapmanagersuite'': ''compliant'', ''snapprotectapps'': ''unlicensed'', ''v_storageattach'': ''unlicensed'', ''insight_balance'': ''unlicensed'', ''ocshift'': ''unlicensed'', ''tpm'': ''compliant'', ''ve'': ''compliant'', ''dp_optimized'': ''unlicensed'', ''fabricpool'': ''unlicensed'', ''snapmirror_sync'':
''compliant'', ''nvme_of'': ''unlicensed'', ''mt_ek_mgmt'': ''unlicensed'', ''s3'': ''compliant'', ''snapmirror_cloud'': ''unlicensed''}'
the error coming from REST. is there any space before or after license code?
it cannot be format issue.
took error code from your error message - 1115131, when checked in swagger its
1115131 Installation of the license failed
this is error coming from ONTAP.
Ok, it worked fine once I updated use rest never and also worked fine in earlier collections versions. Only change was I updated collections and ran the task.
guessing it could have been one time error, can you try delete and install again in REST
Ok sure I can try and will let you know the results
Hi @vast bobcat, @cobalt forum, @silent anvil Just checking to see if we have any update on using NLF file upload to apply licenses directly rather than requesting license codes and then applying to the new nodes?
Laurent, and Mohan are no longer with Netapp.
Mohan had made the change back in 22.3.0 (https://github.com/ansible-collections/netapp.ontap#2230) and it look like you guy were trying the change out above, but didn't get back to him with results. Can you try it again.
Ok thanks @vast bobcat
Do you have an example to use NLF license file instead of using 28 character license code that I can try?
i don't, let me look in to what Mohan had done for this and get back to you
Ok sounds good. Thank you @vast bobcat
@lilac cape It should support the NLFv2 files
Looking through the code, the node on the documentation, show it should work.
` - Supports NetApp License File Version 2 (NLFv2) with REST.
- NetApp License File Version 1 (NLFv1) with REST is not supported at present but may work.
- Ansible attempts to reformat license files as the contents are python-like.
Use the string filter in case of problem to disable this behavior.`
@vast bobcat so I can use below ansible example to update license using NLF license file
netapp.ontap.na_ontap_license:
state: present
license_codes:
- "{{ lookup('file', nlf_filepath) | string }}"```
Vars:
NLF: “path/to/nlf_license_file.csv”
Is this correct?
Yes that example
nlf_filepath should be the file path
Ok thanks. I’ll give it a try
Here is a snippet out of a playbook for how I'm using NLFs:
vars:
nlf_filepath:
- NLF-4034389062-EE.txt
- NLF-4082368507-EE.txt
tasks:
- name: Add NLF licenses
netapp.ontap.na_ontap_license:
state: "{{ state | default('present') }}"
# <<: *login # Uncomment if not using module_defaults
use_rest: always
license_codes:
- "{{ lookup('file', item) | string }}"
register: ontap_info
loop: "{{ nlf_filepath }}"