andreasscherbaum / ansible-lxc-ssh

Ansible connection plugin using ssh + lxc-attach
45 stars 22 forks source link

Fetch task fails #23

Closed dmp1ce closed 5 years ago

dmp1ce commented 5 years ago

Fetch task fails for me. Could this be another Python3 issue?

    - name: My backup task
      fetch:
        src: /tmp/myfile-{{ ansible_date_time.date }}.tar.gz
        dest: localbackups
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/ansible/executor/task_executor.py", line 144, in run
    res = self._execute()
  File "/usr/lib/python3.7/site-packages/ansible/executor/task_executor.py", line 648, in _execute
    result = self._handler.run(task_vars=variables)
  File "/usr/lib/python3.7/site-packages/ansible/plugins/action/fetch.py", line 172, in run
    self._connection.fetch_file(source, dest)
  File "/home/david/Workspace/UpgradeYa/albatross-ansible/connection_plugins/lxc_ssh.py", line 1245, in fetch_file
    out_f.write(stdout)
TypeError: write() argument must be str, not bytes

fatal: [omd]: FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}