ansible error: Failed to find required executable rsync in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin"}
You can automate installation of base packages on your node. Sharing here apt module definition of the same.
- name: "Installing Rsync"
apt: >
pkg={{ item }}
state=latest
update_cache=yes
cache_valid_time=3600
with_items:
- rsync
Yum module definition would look something like below.
- name: install the latest version of rsync
yum:
name: rsync
state: latest
I may be a little late. But adding an answer here incase it helps some one else.
When the test fails because of 'rsync not found', I believe it's talking about rsync on the ansible controller, not the ansible target.
So if you duplicate this task but make it a local action, then rsync will exist on both ends:
- name: install rsync on the ansible controller
connection: local
package:
name: rsync
state: present