Skip to content

Add c8kv iosxe clean examples #49

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

Merged
merged 2 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions clean/full_clean_c8kv_iosxe/c8kv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
testbed:
name: c8kv
servers:
ftp:
address: 10.7.14.186
credentials:
default:
username: rcpuser
password: 123rcp!
path: /auto/imageto/dir
tftp:
address: 10.7.14.186
credentials:
default:
username: rcpuser
password: 123rcp!
devices:
c8kv-iosxe:
alias: uut
os: iosxe
type: "c8kv"
platform: "cat8k"
credentials:
default:
password: Lablab123
username: admin
enable:
password: lab123
connections:
defaults:
class: unicon.Unicon
vty:
protocol: telnet
ip: 10.7.1.57
credentials:
default:
password: lab123
username: test1
enable:
password: lab123
cli:
protocol: telnet
ip: 10.7.1.16
port: 9001
a:
protocol: telnet
ip: 10.7.1.16
port: 9001

arguments:
debug: True
custom:
execute_timeout: 600
configure_timeout: 250
abstraction:
order: [os, platform]

peripherals:
power_cycler:
type: 'esxi'
connection_type: 'ssh'
host: 'genie-esxi'
# Log into your ESXi shell and issue command: vim-cmd vmsvc/getallvms
# to find out your VMID to put into outlets
outlets: [11]

"genie-esxi":
os: linux
type: esxi
platform: linux
connections:
a:
ip: 10.7.1.16
protocol: ssh
credentials:
default:
username: root
password: Lablab123
enable:
password: C1sco123
124 changes: 124 additions & 0 deletions clean/full_clean_c8kv_iosxe/clean_c8kv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
cleaners:
DeviceClean:
module: genie.libs.clean
devices: [c8kv-iosxe]

devices:
c8kv-iosxe:
device_recovery:
break_count: 10
console_activity_pattern: "\\.\\.\\.\\."
timeout: 1200
recovery_password: lab
golden_image:
- bootflash:/golden_image.bin
powercycler: True

images:
- /auto/yourimage/dir/c8000v-universalk9.S2C.SSA.bin

connect:

copy_to_device:
origin:

hostname: 10.7.14.186
destination:
directory: 'bootflash:/'
protocol: ftp
min_free_space_percent: 50
vrf: ''
check_file_stability: False
protected_files:
- golden_image.bin

change_boot_variable:

write_erase:

reload:
check_modules:
check: false
reload_service_args:
timeout: 900
prompt_recovery: False

apply_configuration:
configuration: |
hostname c8kv-iosxe
ip route 0.0.0.0 0.0.0.0 10.7.1.1
ip ftp source-interface GigabitEthernet1
ip ftp username rcpuser
ip ftp password 123rcp!
interface GigabitEthernet1
ip address 10.7.1.57 255.255.255.0
negotiation auto
no shut
config_timeout: 900
config_stable_time: 30
max_time: 300
check_interval: 20

verify_running_image:

ping_server:
interval: 60
server: 10.7.14.186
timeout: 120
vrf: ''

backup_file_on_device:
copy_dir: 'bootflash:'
copy_file: test.cfg

delete_backup_from_device:
delete_dir: 'bootflash:'
delete_file: test.cfg

delete_backup_from_device__1:
delete_dir: 'bootflash:'
delete_file: test.cfg

delete_backup_from_device__2:
delete_dir: 'bootflash:'
delete_file: backup_test.cfg

copy_to_linux:
protocol: sftp
append_hostname: true
copy_attempts: 3
destination:
directory: /auto/tftp-ssr/
hostname: 10.7.14.186
origin:
files:
- /auto/yourimage/dir/sample_file
overwrite: true

delete_files_from_server:
files:
- /auto/yourimage/sample_file_c8kv-iosxe
protocol: sftp
server: 10.7.14.186

power_cycle:
boot_timeout: 900
sleep_after_power_off: 10

order:
- connect
- apply_configuration
- ping_server
- copy_to_device
- backup_file_on_device
- change_boot_variable
- copy_to_linux
- write_erase
- power_cycle
- reload
- apply_configuration
- ping_server
- verify_running_image
- delete_backup_from_device__1
- delete_backup_from_device__2
- delete_files_from_server