Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible suggests invalid solution in error message for include_tasks #45661

Closed
jasmith79 opened this issue Sep 14, 2018 · 1 comment · Fixed by #45667
Closed

Ansible suggests invalid solution in error message for include_tasks #45661

jasmith79 opened this issue Sep 14, 2018 · 1 comment · Fixed by #45667
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@jasmith79
Copy link

SUMMARY

Using Ansible 2.6.4 (current release) when attempting to include_tasks for a file that isn't present on the controller but is present on the remote, the following error message prints:

FAILED! => {"reason": "Unable to retrieve file contents\nCould not find or access '/path/to/playbook.yml' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}

However, per the docs, remote_src is not a valid option for include_tasks.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

include_tasks

ANSIBLE VERSION
ansible 2.6.4
  config file = None
  configured module search path = ['/Users/jared/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/jared/Library/Python/3.5/lib/python/site-packages/ansible
  executable location = /Library/Frameworks/Python.framework/Versions/3.5/bin/ansible
  python version = 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
CONFIGURATION
none
OS / ENVIRONMENT

Controller is Mac OS X High Sierra, remote is Ubuntu 18.04

STEPS TO REPRODUCE
  1. Create a yml file on the remote host, e.g. /tmp/file.yml.
  2. Create a playbook on the controller that tries to include_tasks: /tmp/file.yml
  3. Attempt to provision the remote host with the playbook.
---
- hosts: all
  tasks:
  - include_tasks: /tmp/file.yml
EXPECTED RESULTS

Get a useful error message.

ACTUAL RESULTS

Got the error

FAILED! => {"reason": "Unable to retrieve file contents\nCould not find or access '/path/to/playbook.yml' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}

which suggests an invalid solution.

PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [default]

TASK [include_tasks] ***********************************************************
fatal: [default]: FAILED! => {"reason": "Unable to retrieve file contents\nCould not find or access '/tmp/file.yml' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}
	to retry, use: --limit @/Users/myuser/Dev/project/simple.retry

PLAY RECAP *********************************************************************
default                    : ok=1    changed=0    unreachable=0    failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
@ansibot
Copy link
Contributor

ansibot commented Sep 14, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 14, 2018
sivel added a commit to sivel/ansible that referenced this issue Sep 14, 2018
@sivel sivel added has_pr This issue has an associated PR. and removed needs_triage Needs a first human triage before being processed. labels Sep 14, 2018
sivel added a commit to sivel/ansible that referenced this issue Sep 18, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants