Summary
Running playbooks/network_restore.yml with restore_mode: overwrite on IOS devices fails with:
changed: true
stdout: ''
stderr: '/bin/sh: line 1: sshpass: command not found'
rc: 127
cmd: >
sshpass -p "..." scp -O -o StrictHostKeyChecking=no
/backup/<date>/cisco.txt
admin@cisco:'flash:<date>-cisco.txt'
Root Cause
roles/restore/tasks/ios/overwrite.yml uses sshpass to authenticate the SCP transfer to the Cisco device when ansible_password is set. The task is delegated to backup-server, so sshpass must be installed on the backup-server — not on the Ansible control node. This dependency is undocumented.
Steps to Reproduce
- Set
restore_mode: overwrite (or rely on the default, which resolves to overwrite per ios.yml)
- Run
ansible-playbook playbooks/network_restore.yml -e rollback_date=<date>
- Observe failure at the "Copy file over to flash on network device using SCP" task
Expected Behavior
Either:
sshpass is listed as a prerequisite for the backup-server in the README, or
- The playbook checks for
sshpass and fails with a clear message before attempting the SCP
Fix
Install sshpass on the backup-server:
sudo dnf install sshpass # RHEL/Fedora
sudo apt install sshpass # Debian/Ubuntu
And document this as a prerequisite in the repo README or role README (roles/restore/README.md).
Environment
- Ansible network_os:
cisco.ios
- restore_mode:
overwrite
- Failing task:
roles/restore/tasks/ios/overwrite.yml — "Copy file over to flash on network device using SCP"
Summary
Running
playbooks/network_restore.ymlwithrestore_mode: overwriteon IOS devices fails with:Root Cause
roles/restore/tasks/ios/overwrite.ymlusessshpassto authenticate the SCP transfer to the Cisco device whenansible_passwordis set. The task is delegated tobackup-server, sosshpassmust be installed on the backup-server — not on the Ansible control node. This dependency is undocumented.Steps to Reproduce
restore_mode: overwrite(or rely on the default, which resolves tooverwriteperios.yml)ansible-playbook playbooks/network_restore.yml -e rollback_date=<date>Expected Behavior
Either:
sshpassis listed as a prerequisite for the backup-server in the README, orsshpassand fails with a clear message before attempting the SCPFix
Install
sshpasson the backup-server:And document this as a prerequisite in the repo README or role README (
roles/restore/README.md).Environment
cisco.iosoverwriteroles/restore/tasks/ios/overwrite.yml— "Copy file over to flash on network device using SCP"