[FEATURE REQUEST]: save configuration module
pkodzis opened this issue · 6 comments
Summary
Please provide module that will let saving configuration
Issue Type
Feature Idea
Component Name
general
Describe alternatives you've considered
No response
Additional Information
Please check the new release 2.2.0
-- save_config
module and update the issue
sample playbook:
https://github.com/netscaler/ansible-collection-netscaleradc/blob/main/examples/save_config.yaml
wow, that was super-quick! :)
I didnt test option "all", while we don't use it. We always save per-partition:
# session has been already switched to partition DEV:
- name: save_config
delegate_to: localhost
netscaler.adc.save_config:
nsip: "{{ provider.nsip }}"
nitro_auth_token: "{{ provider.nitro_auth_token | default(omit) }}"
nitro_protocol: "{{ provider.nitro_protocol | default(omit) }}"
validate_certs: "{{ provider.validate_certs | default(omit) }}"
The test passed - Ansible returned success:
DEBUG: save_config nsconfig SUCCESS
On device I can see it did modify only expected config file:
# find /nsconfig/* -name ns.conf -exec ls -l {} \;
-rw------- 1 root wheel 36235 Dec 14 15:38 /nsconfig/ns.conf
-rw------- 1 root wheel 132863 Dec 15 15:27 /nsconfig/partitions/PROD/ns.conf
-rw------- 1 root wheel 34943 Dec 21 11:11 /nsconfig/partitions/DEV/ns.conf # <<<<< DEV config modified only
Attaching the log:
save_config_test-1.log
These are msgs there that I guess should not appear, so maybe there is something else in backgroud that needs to be tweaked:
"TRACE: EXIT: send() returned (400, {'errorcode': 1232, 'message': 'Invalid object name [save_config]', 'severity': 'ERROR'})",
"TRACE: EXIT: get() returned (400, {'errorcode': 1232, 'message': 'Invalid object name [save_config]', 'severity': 'ERROR'})",
@pkodzis, is it not the expected behaviour that save_config
to a particular partition should only change the respective partition's ns.conf
?
I added a small fix to skip the GET call for save_config
for the above mentioned error
These are msgs there that I guess should not appear, so maybe there is something else in backgroud that needs to be tweaked:
"TRACE: EXIT: send() returned (400, {'errorcode': 1232, 'message': 'Invalid object name [save_config]', 'severity': 'ERROR'})", "TRACE: EXIT: get() returned (400, {'errorcode': 1232, 'message': 'Invalid object name [save_config]', 'severity': 'ERROR'})",
Am I missing something?
To answer your question - yes, it behaves as expected from my perspecitve.
Regarding the fix to skip the GET call for save_config, unable to test while after "ansible-galaxy collection install netscaler.adc --force" I'm not getting fixed version - it installs the code version that gives reported "Invalid object name [save_config]"
The recent fix (to skip the GET call for save_config) is not released yet to ansible-galaxy or ansible-authmation-hub.
You need to install it from the github itself
ansible-galaxy collection install "git+https://github.com/netscaler/ansible-collection-netscaleradc.git" --force
ack. it works as expected and no more error 400. thank you so much! :)