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

Not found inventory, roles path #13

Open
guard43ru opened this issue Nov 27, 2020 · 1 comment
Open

Not found inventory, roles path #13

guard43ru opened this issue Nov 27, 2020 · 1 comment

Comments

@guard43ru
Copy link

Hello, I have some problems with plugin:

Error Ansible: the role 'nodejs' was not found in /Users/guard/Documents/ansible/server/playbooks/roles:/Users/guard/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/guard/Documents/ansible/server/playbooks
Warning Ansible: No inventory was parsed, only implicit localhost is available.
Warning Ansible: provided hosts list is empty, only localhost is available. Note that.

As I understand, plugin don't see my ansible.cfg
Ansible works perfectly (see all roles, hosts)
ansible-lint, ansible-playbook --syntax-check launched from the shell successfully works

project tree

.
├── README.md
├── ansible.cfg
├── env
│   ├── dev
│   │   ├── group_vars
│   │   ├── host_vars
│   │   └── hosts
│   └── prod
│       ├── group_vars
│       ├── host_vars
│       └── hosts
├── playbooks
│   ├── ...
│   ├── nodejs.yml
└── roles
    ├── ...
    └── nodejs
        ├── defaults
        └── tasks

ansible.cfg

[defaults]
inventory = env/dev/hosts
roles_path = roles

my environment

macos: 10.15.1
ansible: 2.9.14
atom: 1.52.0
language-ansible: 0.2.2
linter: 3.1.1
linter-ansible-syntax: 1.3.0

all other plugins disabled for debug

@mschuchard
Copy link
Owner

The package executes ansible-playbook from the directory of your currently opened file to properly find relative files e.g. includes. It likely is unable to find the ansible.cfg at the higher level.
I will have to revisit this in the future to determine what fix can be made that does not inadvertently also introduce a breaking change.
Thanks for finding this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants