-
Notifications
You must be signed in to change notification settings - Fork 12
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
os9_config backup options does not work #28
Comments
I'm having the same issue. ansible [core 2.14.1] ansible-galaxy collection list community.general /home/venv_python_3.10/lib/python3.10/site-packages/ansible_collections community.general 6.1.0 ansible-config dump --only-changed |
You're in luck, I will give you my workaround as apparently nobody is going to fix this anytime soon. Here you go:
|
Thanks! I’ll give this a try
From: mpsOxygen ***@***.***>
Sent: Thursday, June 20, 2024 4:57 AM
To: ansible-collections/dellemc.os9 ***@***.***>
Cc: Bob Webb ***@***.***>; Comment ***@***.***>
Subject: Re: [ansible-collections/dellemc.os9] os9_config backup options does not work (Issue #28)
You don't often get email from ***@***.******@***.***>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
You're in luck, I will give you my workaround as apparently nobody is going to fix this anytime soon. Here you go:
…---
- name: backup dell switch
hosts: switches
connection: ansible.netcommon.network_cli
gather_facts: no
ignore_errors: yes
tasks:
- name: 'check if switch is online'
local_action: command ping -w 2 {{ ansible_host }}
register: ping_result
- name: Backup current switch config (dellos9)
dellemc.os9.os9_facts:
gather_subset:
- config
when: (ansible_network_os == 'dellemc.os9.os9' and ping_result.rc == 0)
- name: Backup current switch config (dellos6)
dellemc.os6.os6_facts:
gather_subset:
- config
when: (ansible_network_os == 'dellemc.os6.os6' and ping_result.rc == 0)
- name: Salveaza config
copy:
content: "{{ ansible_facts.net_config }}"
dest: "/home/user/ansible/backup/{{ inventory_hostname }}.cfg"
mode: u=rw,g=r,o=r
when: ping_result.rc == 0
—
Reply to this email directly, view it on GitHub<#28 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANSMV2S7IPZE5KEADCGNC6DZIKKNZAVCNFSM6AAAAABJQQTIDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBQGE3DQNJYGY>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
SUMMARY
I am trying to backup the configuration of an Dell S4048 switch running OS 9 using the example from the documentation and it just does not work. Here is the playbook:
name: backup dell switch
hosts: sw2
connection: ansible.netcommon.network_cli
gather_facts: yes
ignore_errors: yes
tasks:
name: 'check if switch is online'
local_action: command ping -w 1 {{ ansible_host }}
register: ping_result
name: Backup current switch config (dellos9)
dellemc.os9.os9_config:
save: yes
lines: ['hostname {{ inventory_hostname }}']
backup: yes
backup_options:
filename: "{{ inventory_hostname }}.cfg"
dir_path: /home/name/Documents/ansible/backup
when: (ansible_network_os == 'dellemc.os9.os9' and ping_result.rc == 0)
ISSUE TYPE
COMPONENT NAME
dellemc.os9.os9_config
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
test#sh ver
Dell EMC Real Time Operating System Software
Dell EMC Operating System Version: 2.0
Dell EMC Application Software Version: 9.14(0.1)
Copyright (c) 1999-2018 by Dell Inc. All Rights Reserved.
Build Time: Fri Aug 10 23:10:14 2018
Build Path: /build/build02/SW/SRC
Dell EMC Networking OS uptime is 15 week(s), 4 day(s), 0 hour(s), 25 minute(s)
System image file is "system://A"
System Type: S4048T-ON
Control Processor: Intel Rangeley with 3 Gbytes (3177148416 bytes) of memory, core(s) 2.
8G bytes of boot flash memory.
1 48x10G, 6x40G TE/FO G (S4048T-ON)
48 Ten GigabitEthernet/IEEE 802.3 interface(s)
6 Forty GigabitEthernet/IEEE 802.3 interface(s)
STEPS TO REPRODUCE
EXPECTED RESULTS
I expected to have a file named sw2.cfg appear in the backup directory.
ACTUAL RESULTS
Nothing happens, it just changes the switch hostname and that's it.
The text was updated successfully, but these errors were encountered: