ansible-dcnm
ansible-dcnm copied to clipboard
dcnm_switch_bootflash
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
new module to manage bootflash of switches
New or Affected modules(s):
- dcnm_switch_bootflash
DCNM version
- V 12.1.3
Potential ansible task config
# Copy-paste your ansible playbook
- name: managing bootflash
cisco.dcnm.dcnm_switch_bootflash:
state: delete # choose from deleted, query
config:
files: # list of files to be deleted or filtered as query, when the state is deleted, it is mandatory, when the state is query, it is optional
- nxos64-cs.10.3.2.F.bin
- nxos64-cs.10.3.1.F.bin
switches: # list of switches, files per switch overridden the global file list, it is mandatory for both deleted and query
- ip_address: 192.168.123.101
files:
- nxos64-cs.10.3.3.F.bin
References
Additional context Add any other context or screenshots about the feature request here.
Playbooks as implemented on branch dcnm_bootflash. Work in progress PR: https://github.com/CiscoDevNet/ansible-dcnm/pull/311
---
# Example deleted state.
# 1. On switch 192.168.1.1
# Delete all text files from all flash devices on active supervisor.
# 2. On switch 192.168.1.2
# Delete foo.txt from bootflash on active supervisor.
# 3. On switch 192.168.1.3
# Delete all files, whose name implies creation during the month of
# July 2024, from bootflash on active supervisor.
# NOTES:
# - 192.168.1.1 uses the global targets specification.
# - 192.168.1.2 and 192.168.1.3 override the global targets
# specification with their own local targets specification.
- name: Example deleted state
cisco.dcnm.dcnm_bootflash:
state: deleted
config:
targets:
- filepath: "*:/*.txt"
supervisor: active
switches:
- ip_address: 192.168.1.1
- ip_address: 192.168.1.2
targets:
- filepath: bootflash:/foo.txt
supervisor: active
- ip_address: 192.168.1.3
targets:
- filepath: bootflash:/202407??.*
supervisor: active
# Example query state.
# 1. On switch 192.168.1.1
# List all text files from all flash devices on active supervisor.
# 2. On switch 192.168.1.2
# List foo.txt from bootflash on active supervisor.
# 3. On switch 192.168.1.3
# List all files, whose name implies creation during the month of
# July 2024, from bootflash on active supervisor.
# NOTES:
# - 192.168.1.1 uses the global targets specification.
# - 192.168.1.2 and 192.168.1.3 override the global targets
# specification with their own local targets specification.
# - If files do not exist, the module returns an empty list.
- name: Example query state
cisco.dcnm.dcnm_bootflash:
state: query
config:
targets:
- filepath: "*:/*.txt"
supervisor: active
switches:
- ip_address: 192.168.1.1
- ip_address: 192.168.1.2
targets:
- filepath: bootflash:/foo.txt
supervisor: active
- ip_address: 192.168.1.3
targets:
- filepath: bootflash:/202407??.*
supervisor: active