As a part of getting a bunch of nodes ready and configured for our environment, I need to copy a file from already configured node. Let call the already configured node {{ dis_host }} with actual host name pfch3dis99. Here’s my playbook:
- name: MySQL Playbook
hosts: irisprep
vars:
env: “{{ iris_env }}”
mysql_path: /etc/sysconfig/myapp/java_lib/mysql-connector-java-5.1.43-bin.jar
vars_files:
- variables.yml
tasks:
- name: Synchronize mysql connector from dis host
synchronize:
mode: pull
src: “{{ mysql_path }}”
dest: “{{ mysql_path }}”
recursive: no
delegate_to: “{{ dis_host }}”
become: yes
Host group irisprep has all the hosts I want to run the playbook on. pfch3calc98 happens to be one of the hosts part of the host group. It keeps giving me a failure. with the following error:
File “/tmp/ansible_ansible.posix.synchronize_payload_H65x9J/ansible_ansible.posix.synchronize_payload.zip/ansible/module_utils/basic.py”, line 2710, in run_command
cmd = subprocess.Popen(args, **kwargs)
File “/usr/lib64/python2.7/subprocess.py”, line 711, in init
errread, errwrite)
File “/usr/lib64/python2.7/subprocess.py”, line 1327, in _execute_child
raise child_exception
fatal: [pfch3calc98 → pfch3dis99]: FAILED! => {
“changed”: false,
“cmd”: “sshpass”,
“invocation”: {
“module_args”: {
“_local_rsync_password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“_local_rsync_path”: “rsync”,
“_substitute_controller”: false,
“archive”: true,
“checksum”: false,
“compress”: true,
“copy_links”: false,
“delete”: false,
“dest”: “/etc/sysconfig/myapp/java_lib/mysql-connector-java-5.1.43-bin.jar”,
“dest_port”: null,
“dirs”: false,
“existing_only”: false,
“group”: null,
“link_dest”: null,
“links”: null,
“mode”: “pull”,
“owner”: null,
“partial”: false,
“perms”: null,
“private_key”: null,
“recursive”: false,
“rsync_opts”: [],
“rsync_path”: “sudo rsync”,
“rsync_timeout”: 0,
“set_remote_user”: true,
“src”: “myuser@pfch3calc98:/etc/sysconfig/myapp/java_lib/mysql-connector-java-5.1.43-bin.jar”,
“ssh_args”: null,
“times”: null,
“verify_host”: false
}
},
“msg”: “[Errno 2] No such file or directory”,
“rc”: 2
}
I can’t seem to figure out what’s going on. Anyone see something that my eyes are not spotting?
Thanks a lot,
Subhi.