mirror of https://github.com/ansible/ansible.git
New module: cnos_rollback (#21788)
* Initial commit for cnos_rollback * Move roles to integration/roles directory and remove aliases file. * update module short description * Change module directory name to Lenovo * change import cnos statementpull/22207/head
parent
267cc0edfc
commit
70af90436a
@ -0,0 +1,18 @@
|
||||
# You have to paste this dummy information in /etc/ansible/hosts
|
||||
# Notes:
|
||||
# - Comments begin with the '#' character
|
||||
# - Blank lines are ignored
|
||||
# - Groups of hosts are delimited by [header] elements
|
||||
# - You can enter hostnames or ip addresses
|
||||
# - A hostname/ip can be a member of multiple groups
|
||||
#
|
||||
# In the /etc/ansible/hosts file u have to enter [cnos_rollback_sample] tag
|
||||
# Following you should specify IP Adresses details
|
||||
# Please change <username> and <password> with appropriate value for your switch.
|
||||
|
||||
[cnos_rollback_sample]
|
||||
10.241.107.39 username=<username> password=<password> deviceType=g8272_cnos rcpath=/root/cnos_config/G8272-running-config.txt
|
||||
|
||||
#Use this in case its TFTP as tftpboot folder is the starting point for tftp
|
||||
#10.241.107.39 username=<username> password=<password> deviceType=g8272_cnos rcpath=/anil/G8272-running-config.txt
|
||||
|
@ -0,0 +1,25 @@
|
||||
# This contain sample config Roll Back execution tasks
|
||||
---
|
||||
|
||||
- name: Test Rollback of config - Running config
|
||||
cnos_rollback: host={{ inventory_hostname }} username={{ hostvars[inventory_hostname]['username']}} password={{ hostvars[inventory_hostname]['password']}} deviceType={{ hostvars[inventory_hostname]['deviceType']}} outputfile=./results/cnos_rollback_{{ 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_rollback_data1}}"
|
||||
|
||||
- name: Test Rollback of config - Startup config
|
||||
cnos_rollback: host={{ inventory_hostname }} username={{ hostvars[inventory_hostname]['username']}} password={{ hostvars[inventory_hostname]['password']}} deviceType={{ hostvars[inventory_hostname]['deviceType']}} outputfile=./results/cnos_rollback_{{ 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_rollback_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 place an config file with reference to your tftp-root folder
|
||||
|
||||
#- name: Test Rollback of config - Running config - TFTP
|
||||
# cnos_rollback: host={{ inventory_hostname }} username={{ hostvars[inventory_hostname]['username']}} password={{ hostvars[inventory_hostname]['password']}} deviceType={{ hostvars[inventory_hostname]['deviceType']}} outputfile=./results/cnos_rollback_{{ inventory_hostname }}_output.txt configType='{{item.configType}}' protocol='{{item.protocol}}' serverip='{{item.serverip}}' rcpath={{ hostvars[inventory_hostname]['rcpath']}}
|
||||
# with_items: "{{test_rollback_data3}}"
|
||||
|
||||
#- name: Test Rollback of config - Startup config - TFTP
|
||||
# cnos_rollback: host={{ inventory_hostname }} username={{ hostvars[inventory_hostname]['username']}} password={{ hostvars[inventory_hostname]['password']}} deviceType={{ hostvars[inventory_hostname]['deviceType']}} outputfile=./results/cnos_rollback_{{ inventory_hostname }}_output.txt configType='{{item.configType}}' protocol='{{item.protocol}}' serverip='{{item.serverip}}' rcpath={{ hostvars[inventory_hostname]['rcpath']}}
|
||||
# with_items: "{{test_rollback_data4}}"
|
||||
|
||||
# Completed file
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
test_rollback_data1:
|
||||
- {configType: running-config, protocol: "sftp", serverip: "10.241.106.118", serverusername: "root", serverpassword: "root123"}
|
||||
|
||||
test_rollback_data2:
|
||||
- {configType: startup-config, protocol: "sftp", serverip: "10.241.106.118", serverusername: "root", serverpassword: "root123"}
|
||||
|
||||
test_rollback_data3:
|
||||
- {configType: running-config, protocol: "tftp", serverip: "10.241.106.118"}
|
||||
|
||||
test_rollback_data4:
|
||||
- {configType: startup-config, protocol: "tftp", serverip: "10.241.106.118"}
|
Loading…
Reference in New Issue