Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST]: save configuration module #326

Closed
pkodzis opened this issue Dec 20, 2023 · 6 comments
Closed

[FEATURE REQUEST]: save configuration module #326

pkodzis opened this issue Dec 20, 2023 · 6 comments
Assignees

Comments

@pkodzis
Copy link

pkodzis commented Dec 20, 2023

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

sumanth-lingappa added a commit that referenced this issue Dec 21, 2023
Signed-off-by: Sumanth Lingappa <sumanth.lingappa@cloud.com>
@sumanth-lingappa
Copy link
Collaborator

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

@pkodzis
Copy link
Author

pkodzis commented Dec 21, 2023

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'})",

sumanth-lingappa added a commit that referenced this issue Jan 4, 2024
Signed-off-by: Sumanth Lingappa <sumanth.lingappa@cloud.com>
sumanth-lingappa added a commit that referenced this issue Jan 4, 2024
Issue #326: No GET for save_config
@sumanth-lingappa
Copy link
Collaborator

@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?

@pkodzis
Copy link
Author

pkodzis commented Jan 4, 2024

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]"

@sumanth-lingappa
Copy link
Collaborator

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

Refer: https://github.com/netscaler/ansible-collection-netscaleradc/blob/main/README.md#via-github-to-have-the-latest-updated-which-are-yet-to-be-released-in-ansible-galaxy

@pkodzis
Copy link
Author

pkodzis commented Jan 5, 2024

ack. it works as expected and no more error 400. thank you so much! :)

@pkodzis pkodzis closed this as completed Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants