So, the scenario is: I have a mini computer (running Ubuntu server 18.04) that is accessible using SSH from my local machine. Attached to the mini computer is a sensor device that is connected via USB, but accessed from the mini computer using SSH with [email protected] (no password) and is running a stripped back form of Linux.
I need to copy a config file onto the device, (and am able to do this from the mini computer using SCP successfully), but want to be able to do this from my local machine using Ansible as there will be hundreds of these to setup, each with different configurations.
The Ansible role looks like this:
- name: "Copy config file to mini PC"
template:
src: config.json.j2
dest: "{{ pc_config_path}}"
- name: "Copy config file from mini PC to sensor
command: "scp {{ pc_config_path}} root@{{ device_ip_addr }}:{{ device_config_path }}"
become: yes
The first task executes successfully, but the second one just hangs.
I've tried shell and raw, and even creating a bash script and running that without success.
Not sure if this is a security limitation, but would like to find a solution. So any ideas would help.
Thanks.
synchronize
module to copy local to remote it's also using secure copy – Arbab Nazar