mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
781fd7099a
- Move legacy tests into a separate directory. - Reduce common dependencies between targets.
24 lines
2.4 KiB
YAML
24 lines
2.4 KiB
YAML
# This contain sample config back up tasks
|
|
---
|
|
- name: Test Running Config Backup
|
|
cnos_backup: host={{ inventory_hostname }} username={{ hostvars[inventory_hostname]['username']}} password={{ hostvars[inventory_hostname]['password']}} deviceType={{ hostvars[inventory_hostname]['deviceType']}} outputfile=./results/cnos_backup_{{ inventory_hostname }}_output.txt configType='{{item.configType}}' protocol='{{item.protocol}}' serverip='{{item.serverip}}' rcpath={{ hostvars[inventory_hostname]['rcpath']}} serverusername='{{item.serverusername}}' serverpassword='{{item.serverpassword}}'
|
|
with_items: "{{test_config_data1}}"
|
|
|
|
- name: Test Startup Config Backup
|
|
cnos_backup: host={{ inventory_hostname }} username={{ hostvars[inventory_hostname]['username']}} password={{ hostvars[inventory_hostname]['password']}} deviceType={{ hostvars[inventory_hostname]['deviceType']}} outputfile=./results/cnos_backup_{{ inventory_hostname }}_output.txt configType='{{item.configType}}' protocol='{{item.protocol}}' serverip='{{item.serverip}}' rcpath={{ hostvars[inventory_hostname]['rcpath']}} serverusername='{{item.serverusername}}' serverpassword='{{item.serverpassword}}'
|
|
with_items: "{{test_config_data2}}"
|
|
|
|
#Root folder will be different for SFTP/SCP and TFTP
|
|
#The following task is commented.
|
|
#Before trying this, please change in /etc/ansible/hosts file
|
|
#and backup the config file with reference to your tftp-root folder
|
|
|
|
#- name: Test Running Config Backup -TFTP
|
|
# cnos_backup: host={{ inventory_hostname }} username={{ hostvars[inventory_hostname]['username']}} password={{ hostvars[inventory_hostname]['password']}} deviceType={{ hostvars[inventory_hostname]['deviceType']}} outputfile=./results/cnos_backup_{{ inventory_hostname }}_output.txt configType='{{item.configType}}' protocol='{{item.protocol}}' serverip='{{item.serverip}}' rcpath={{ hostvars[inventory_hostname]['rcpath']}}
|
|
# with_items: "{{test_config_data3}}"
|
|
|
|
#- name: Test Startup Config Backup - TFTP
|
|
# cnos_backup: host={{ inventory_hostname }} username={{ hostvars[inventory_hostname]['username']}} password={{ hostvars[inventory_hostname]['password']}} deviceType={{ hostvars[inventory_hostname]['deviceType']}} outputfile=./results/cnos_backup_{{ inventory_hostname }}_output.txt configType='{{item.configType}}' protocol='{{item.protocol}}' serverip='{{item.serverip}}' rcpath={{ hostvars[inventory_hostname]['rcpath']}}
|
|
# with_items: "{{test_config_data4}}"
|
|
|
|
# Completed file
|