I'm working on a playbook to upload a configuration file to remote servers, but the remote servers do not have python installed (which is a requirement for using modules). I have successfully written other playbooks using the raw feature to avoid having to install python on the servers, but I can't find any examples in the Ansible documentation to perform a file upload using bare-bones ssh. Is a non-module based upload possible?
No sure why do you use Ansible this way, but you can make a local task with scp:
- name: remote task
raw: echo remote
- name: local scp
local_action: command scp /path/to/localfile {{ inventory_hostname }}:/path/to/remotefile
- name: remote task
raw: cat /path/to/remotefile
I usually check and install python with raw module and continue with Ansible core modules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With