Skip to content

No such file or directory : ~/.ansible/tmp/ansible-tmp-.../wait_for.py #25

@cdggcali

Description

@cdggcali

Hi,

Im testing to stackstorm-ansible to test if we could use it to update Ubuntu servers.

I have a good know playbook that I can successfully run using the standard ansible-playbook command, to run that playbook using Strackstorm Im using the following command:

# st2 run ansible.playbook playbook=/root/git/stash/linux-update/linux-update.yml inventory_file=/root/git/stash/linux-update/linux-update.ini

The task is the following:

---
  - name: Wait for host to boot
    become: false
    local_action: wait_for
    args:
      host: "{{ inventory_hostname }}"
      port: 22
      state: started
      delay: 30
      timeout: 200

And it is failing with the following error:

TASK [linux-update : Wait for host to boot] ************************************
fatal: [192.168.56.101]: FAILED! =>
{"msg": "failed to transfer file to ~/.ansible/tmp/ansible-tmp-1524245385.09-134125845791648/wait_for.py:
[Errno 2] No such file or directory: '~/.ansible/tmp/ansible-tmp-1524245385.09-134125845791648/wait_for.py'"}
	to retry, use: --limit @/root/git/stash/linux-update/linux-update.retry

Is it possible the path is not correct since Im using Stackstrom?

Regards,
Carlos

Update: The Workaround/Solution

There is a bug in Ansible (ansible/ansible#21562) and they got really a lot of reports like this. They're trying to put everything together and fix it in some future release: ansible/ansible#31022

Until that:

Workaround 1

Set in ansible.cfg:

remote_tmp = $HOME/.ansible/tmp
local_tmp = $HOME/.ansible/tmp

Workaround 2

Pass those environment variables to ansible command:

ANSIBLE_LOCAL_TEMP=$HOME/.ansible/tmp
ANSIBLE_REMOTE_TEMP=$HOME/.ansible/tmp

Workaround 3

Downgrade of Ansible to version 2.2.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions