Command failed: ansible-playbook /myrepo/ansible/dev/dev.yml --syntax-check
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
ERROR! the role 'myrole' was not found in <default paths>
Solution
From what I found by searching this repository, the README and the settings of the extension, there is no way to configure the behavior of syntax checking when it's done using ansible-playbook
.
I would like to either disable the checking entirely or be able to change the configuration to tell it to take my ansible.cfg
into account. Or simply extend the role_paths
directly even if it's not DRY.
Alternatives
Disabling the Ansible extension entirely.
Attempted to switch to ansible-lint
but ticking the checkbox didn't change anything.
Additional context
No response
Hi and thanks for answering.
It seems I don't have ansible-lint
installed:
Error: Command failed: which ansible-lint
at ChildProcess.exithandler (node:child_process:406:12)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Socket.<anonymous> (node:internal/child_process:450:11)
at Socket.emit (node:events:390:28)
at Pipe.<anonymous> (node:net:687:12) {
killed: false,
code: 1,
signal: null,
cmd: 'which ansible-lint',
stdout: '',
stderr: ''
And right after this error, I get the usual error from ansible-playbook --syntax-check
.
Okay, thanks.
Also I suspect that ansible.cfg
is not picked up by the vscode extension. Could you try opening the entire ansible
directory (the root as you mentioned) in the vscode and check ?
This because the extension checks for ansible config file in two ways:
the workspace root of the current working directory in the vscode
ANSIBLE_CONFIG env variable.
Maybe, you can even try checking by setting the ANSIBLE_CONFIG env variable to point the config file.
That would be a good idea but it wouldn't solve my issue.
I still think adding a setting for the user to set the ansible.cfg
would be a good idea.
I don't want to use the environment variable because this is only an issue on this specific project.
And I can't move the ansible.cfg
file to the root of the repository because it would add clutter for the other team members.
Could you keep this issue open, please?
Bumps [lxml](https://github.com/lxml/lxml) from 4.9.1 to 4.9.2.
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](lxml/lxml@lxml-4.9.1...lxml-4.9.2)
updated-dependencies:
- dependency-name: lxml
dependency-type: direct:production
update-type: version-update:semver-patch
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>