diff --git a/nx-os/poap/poap.py b/nx-os/poap/poap.py index 0a660206..01691562 100755 --- a/nx-os/poap/poap.py +++ b/nx-os/poap/poap.py @@ -32,13 +32,16 @@ # in your automation environment # system and kickstart images, configuration: location on server (src) and target (dst) -n9k_image_version = "6.1.2" # this must match your code version -image_dir_src = "/tftpboot" # Sample - /Users/bob/poap +n9k_image_version = "7.0.3.I2.2a" # this must match your code version +image_dir_src = "/home/poap-sftp" # Sample - /Users/bob/poap ftp_image_dir_src_root = image_dir_src tftp_image_dir_src_root = image_dir_src -n9k_system_image_src = "n9000-dk9.%s.bin" % n9k_image_version -config_file_src = "/tftpboot/conf" # Sample - /Users/bob/poap/conf -image_dir_dst = "bootflash:poap" # directory where n9k image will be stored +n9k_system_image_src = "nxos.%s.bin" % n9k_image_version +config_file_src = "/home/poap-sftp/config" # Sample - /Users/bob/poap/co +nf +static_config_filename = "staticpoap.cfg" +image_dir_dst = "bootflash:poap" # directory where n9k image will be s +tored system_image_dst = n9k_system_image_src config_file_dst = "volatile:poap.cfg" md5sum_ext_src = "md5" @@ -50,10 +53,10 @@ protocol = "scp" # protocol to use to download images/config # Host name and user credentials -username = "root" # server account -ftp_username = "anonymous" # server account -password = "root" # password -hostname = "1.1.1.1" # ip address of ftp/scp/http/sftp server +username = "poap-sftp" # server account +ftp_username = "poap-sftp" # server account +password = "C1sco123" # password +hostname = "10.0.0.15" # ip address of ftp/scp/http/sftp server # vrf info vrf = "management" @@ -507,6 +510,12 @@ def set_config_file_src_serial_number (): config_file_src = "%s.%s" % (config_file_src, serial_number) poap_log("INFO: Selected config filename (serial_number) : %s" % config_file_src) +# set config name file to staticpoap.cfg +def set_config_file_src_static (): + global config_file_src + config_file_src = "%s.%s" % (config_file_src, static_config_filename) + poap_log("INFO: Selected config filename (static) : %s" % config_file_src) + # This check seems redundant but it's here as a defensive programming measure # If the checks above change or go away, this code won't have to change if config_file_type == "location" and cdp_interface is not None: @@ -524,6 +533,8 @@ def set_config_file_src_serial_number (): elif config_file_type == "serial_number": #set source config file based on switch's serial number set_config_file_src_serial_number() +elif config_file_type == "static": + set_config_file_src_static() else: poap_log("ERR: Either config_file_type is not valid or interface was not given and location can not be derived.") exit(-1)