Symptom
On Cat9200/9300 switches, copying the configuration file to a new switch's running config causes SmartPort macro configurations to fail. Copying the config file to the flash and then the running config also causes a failure. If you copy the config to startup-config and reboot the switch, or paste the config into the CLI, it works as expected.
switch's running config:
copy http://10.1.1.1/sw1-9200.cfg.txt run
Destination filename [running-config]?
Accessing http:/10.1.1.1/sw1-9200.cfg.txt...
Loading http://10.1.1.1/sw1-9200.cfg.txt
WARNING: Command has been added to the configuration using a type 5 password. However, type 5 passwords will soon be deprecated. Migrate to a supported password type
% Could not create trigger mapping.
if [[ $LINKUP == YES ]]
^
% Invalid input detected at '^' marker.
then conf t
^
% Invalid input detected at '^' marker.
interface $INTERFACE
^
% Invalid input detected at '^' marker.
macro description $TRIGGER
^
% Invalid input detected at '^' marker.
no ip arp inspection limit rate 5
^
% Invalid input detected at '^' marker.
Conditions
Try to copy the configuration to the running config from flash, ftp, etc when it is including macros.
Workaround
Manually copy the configuration over the CLI.