Configure ztp.json with CLI
SUMMARY SSH in to the Apstra ZTP server and configure the ztp.json file.
To lessen the chance of errors, we recommend using the Apstra ZTP GUI Configurator to
configure ztp.json
, but you have the option of using CLI instead, as
described below. You can configure ZTP configuration directly with text editors such as vi
or nano.
Configure ztp.json with CLI
-
Open a terminal and SSH into the Apstra ZTP server.
ssh admin@<apstra-ztp-server-ip>
where<apstra-ztp-server-ip>
is the IP address of the Apstra ZTP server. -
The ZTP configuration file is on the Apstra ZTP VM in the
/containers_data/tftp
directory.admin@apstra-ztp:~$ sudo ls -l /containers_data/tftp total 336 -rwxrwxrwx 1 admin admin 2448 Aug 28 16:39 config_verifier.py -rwxrwxrwx 1 admin admin 742 Aug 28 16:39 container_init.sh -rwxr-xr-x 1 admin admin 292 Sep 11 15:17 cumulus_slicer_custom.sh -rwxrwxrwx 1 admin admin 178 Aug 28 16:39 Dockerfile -rwxrwxrwx 1 admin admin 107 Aug 28 16:39 eos_custom.sh -rwxr-xr-x 1 admin admin 75 Sep 11 15:17 eos_slicer_custom.sh -rwxrwxrwx 1 admin admin 5735 Aug 28 16:39 junos_apstra_ztp_bootstrap.sh -rwxrwxrwx 1 admin admin 1799 Aug 28 16:39 junos_custom.sh -rwxr-xr-x 1 admin admin 564 Sep 11 15:17 junos_evo_slicer_custom.sh -rwxr-xr-x 1 admin admin 517 Sep 11 15:17 junos_slicer_custom.sh -rwxr-xr-x 1 admin admin 214 Sep 11 15:17 linux_slicer_custom.sh -rwxrwxrwx 1 admin admin 86 Aug 28 16:39 nxos_custom.sh -rwxr-xr-x 1 admin admin 78 Sep 11 15:17 nxos_slicer_custom.sh -rwxrwxrwx 1 admin admin 205 Aug 28 16:39 poap-md5sum -rw-rw-r-- 1 admin admin 26720 Sep 11 15:17 pxelinux.0 -rwxrwxrwx 1 admin admin 1843 Aug 28 16:39 rsyslog.conf -rwxrwxrwx 1 admin admin 170 Aug 28 16:39 sonic_custom.sh -rwxr-xr-x 1 admin admin 88 Sep 11 15:17 sonic_slicer_custom.sh -rwxrwxrwx 1 admin admin 2640 Sep 11 15:17 ztp.json -rwxrwxrwx 1 admin admin 115549 Aug 28 16:58 ztp.py -rwxrwxrwx 1 root root 115506 Aug 28 16:58 ztp.py.md5
-
Open the
ztp.json
file with a text editor, such as vi or nano.admin@apstra-ztp:~$ sudo nano /containers_data/tftp/ztp.json
-
The default section includes default key-value pairs. The values defined here
are applied to all devices, unless the same key is defined in more specific
sections, such as for specific platforms, models, or serial numbers. More specific
keys take precedence over less specific keys. See ztp.json
Keys for key details.
{ "defaults": { "nxos-image": "http://buildfiles.dc1.apstra.com/apstrktr/switch_images/cisco/nxos.10.2.5.bin", "eos-image": "http://buildfiles.dc1.apstra.com/apstrktr/switch_images/arista/EOS-4.27.6M.swi", "cumulus-image": "http://buildfiles.dc1.apstra.com/apstrktr/switch_images/cumulus/cl-4.2.1-bcm-amd64.bin", "junos-image": "http://10.24.128.10/apstrktr/switch_images/juniper/junos-5e-22.2R3.15.tgz", "junos-evo-image": "http://10.24.128.10/apstrktr/switch_images/juniper/junos-evo-install-qfx-ms-fixed-x86-64> "sonic-image": "http://buildfiles.dc1.apstra.com/apstrktr/switch_images/sonic/sonic-4.0.5-GA-adv-bcm.bin", "license": "http://onie.dc1.apstra.com/lic/cumulus.lic", "device-root-password": "admin", "device-user": "admin", "device-user-password": "admin" },
or this one?
{ "defaults": { "nxos-versions": [ "nxos-version1" ], "nxos-image": "aos_nxos_image.bin", "eos-versions": [ "eos-version1", "eos-version2" ], "eos-image": "aos_eos_image.bin", "junos-versions": [ "junos-version1", "junos-version2" ], "junos-image": "http://10.85.24.52/juniper/21.2R1-S2.2/jinstall-host-qfx-5e-x86-64-21.2R1-S2.2-secure-signed.tgz", "junos-evo-versions": [ "junos-evo-version1" ], "junos-evo-image": "http://server_address/path/to/install_package_name.tgz", "sonic-versions": [ "sonic-version1", "sonic-version2" ], "sonic-image": "http://server_address/path/to/sonic_package_name.bin", "device-root-password": "admin", "device-user": "aosadmin", "device-user-password": "aosadmin", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "onbox", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "junos": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [ "21.2R1-S2.2" ], "junos-image": "http://10.85.24.52/juniper/21.2R1-S2.2/jinstall-host-qfx-5e-x86-64-21.2R1-S2.2-secure-signed.tgz", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "root123", "device-user": "aosadmin", "device-user-password": "aosadmin123", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "junos", "agent_type": "offbox", "install_requirements": false, "job_on_create": "install", "force_package_install": false, "packages": [] } }, "junos-evo": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [], "junos-image": "", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "root123", "device-user": "", "device-user-password": "aosadmin123", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "junos", "agent_type": "offbox", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "install", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "eos": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [], "junos-image": "", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "", "device-user": "", "device-user-password": "", "custom-config": "eos_custom.sh", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "nxos": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [], "junos-image": "", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "admin123", "device-user": "", "device-user-password": "", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "onbox", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "JNP10002-60C [QFX10002-60C]": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [ "21.2R1-S1.3" ], "junos-image": "http://10.85.24.52/juniper/21.2R1-S1.3/junos-vmhost-install-qfx-x86-64-21.2R1-S1.3.tgz", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "", "device-user": "", "device-user-password": "", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } }, "QFX10002-36Q": { "nxos-versions": [], "nxos-image": "", "eos-versions": [], "eos-image": "", "junos-versions": [ "21.2R1-S2.2" ], "junos-image": "http://10.85.24.52/juniper/21.2R1-S2.2/jinstall-host-qfx-10-f-x86-64-21.2R1-S2.2-secure-signed.tgz", "junos-evo-versions": [], "junos-evo-image": "", "sonic-versions": [], "sonic-image": "", "device-root-password": "", "device-user": "", "device-user-password": "", "custom-config": "", "management-subnet-prefixlen": "", "management-master-ip": "", "management-backup-ip": "", "management-ip": "", "management-gw-ip": "", "dual-routing-engine": false, "system-agent-params": { "platform": "", "agent_type": "", "operation_mode": "", "profile": "", "install_requirements": false, "job_on_create": "", "force_package_install": false, "enable_monitor": false, "packages": [], "id": "" } } }
-
The platform-specific section includes configuration that's applied to each
device based on its platform. For information about custom-config files, see Create Vendor-specific Custom Configuration
"junos": { "device-root-password": "root123", "custom-config": "junos_slicer_custom.sh" }, "junos-evo": { "device-root-password": "root123", "custom-config": "junos_evo_slicer_custom.sh" }, "eos": { "custom-config": "eos_slicer_custom.sh" }, "nxos": { "custom-config": "nxos_slicer_custom.sh" }, "cumulus": { "custom-config": "cumulus_slicer_custom.sh" }, "sonic": { "custom-config": "sonic_slicer_custom.sh" }, "linux": { "custom-config": "linux_slicer_custom.sh" } }
- Model-specific parameters include the following:
-
Serial number parameters include the following:
"5254003765C9": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "525400EB0A3C": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "5254002FFA41": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "525400C36BF6": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "525400DE0AE4": { "device-root-password": "root123", "junos-versions": [ "22.2R3.15" ], "junos-image": "", "system-agent-params": null }, "525400B813C8": { "system-agent-params": null }, "5254007F0AF8": { "system-agent-params": null }, "5254008DDCCF": { "system-agent-params": null }, "525400602A79": { "system-agent-params": null }, "5254004D62B3": { "system-agent-params": null },