ansible-collections / community.network

Ansible Community Network Collection
http://galaxy.ansible.com/community/network
Other
124 stars 89 forks source link

Feature: Support for startup config in exos_config & exos_facts #512

Open ng-bsy opened 1 year ago

ng-bsy commented 1 year ago
SUMMARY

To my understanding, exos_config and exos_facts only represent and let you manipulate or make backups of the current active (running) config. For my use case I'd like to see the same possibilities for the saved (startup) config. E.g.

ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
# use of exos_facts
- community.network.exos_facts:
    gather_subset: config
  register: exos_facts
- ansible.builtin.debug:
    msg:
      - "{{ exos_facts.ansible_facts.ansible_net_config_startup }}"
      - "{{ exos_facts.ansible_facts.ansible_net_config_active }}"

# use of exos_config
- community.network.exos_config:
    backup: yes
    backup_options:
      filename: backup_startup.cfg
      dir_path: /home/user
    config: startup

Thanks a lot

Andersson007 commented 1 year ago

@ng-bsy hello, thanks for reporting the issue!

cc (team_extreme) @LindsayHill @ujwalkomarla

in case someone new wants to pick it up, there's the Quick start dev guide

ng-bsy commented 1 year ago

For now I found a way, using netcommon, to do a manual backup of the startup config, but nontheless would it be nice to have the official modules support it:

- ansible.netcommon.net_get:
    src: nms.xsf
    dest: "{{ /home/user/startup_config"
Andersson007 commented 1 year ago

@ng-bsy the task you posted looks like it has a simple interface, hasn't it? Maybe rather than writing a new piece of code someone needs to maintain, would it be good just to put info about your solutions in related modules, e.g. in DOCUMENTATION and EXAMPLES sections? Something like:

- name: Backup the startup config
  ansible.netcommon.net_get:
    src: nms.xsf
    dest: /home/user/startup_config

what do you think? If you're OK with it, would you like to do it using the Quick-start guide?