yamllint is not found when running 'lint' target as of Molecule 3.0.7
See original GitHub issueIssue Type
- Bug report
Molecule and Ansible details
Ansible 2.9.12
Molecule 3.0.7
Molecule installation method (one of):
- pip
Ansible installation method (one of):
- pip
Detail any linters or test runners used:
yamllint and ansible-lint, test is run in Travis CI environment
Desired Behavior
Linters should run without issue.
Actual Behaviour
--> Scenario: 'default'
--> Action: 'lint'
--> Executing: set -e
yamllint .
ansible-lint
/bin/sh: 2: yamllint: not found
ERROR: Lint failed: Command 'set -e
yamllint .
ansible-lint
' returned non-zero exit status 127.: Command 'set -e
yamllint .
ansible-lint
' returned non-zero exit status 127.
See failed build: https://travis-ci.org/github/geerlingguy/ansible-role-clamav/jobs/718754330#L470
It looks like this bug was introduced in the 3.0.7 release. If I pip install molecule===3.0.6
the problem goes away.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:16 (5 by maintainers)
Top Results From Across the Web
1614358 – python3-molecule is missing yamllint as dependency
Bug 1614358 - python3-molecule is missing yamllint as dependency ... CommandNotFound: yamllint ``` Expected results: test is running further Additional info ...
Read more >Quickstart — yamllint 1.28.0 documentation - Read the Docs
Running yamllint ¶ ... You can also lint all YAML files in a whole directory: yamllint . ... By default, the output of...
Read more >What's New - Oracle Linux Yum Server
Oracle Linux with Oracle enterprise-class support is the best Linux operating system (OS) for your enterprise computing needs.
Read more >command not found" after installing yamllint and trying to use it
after installing the last version of pip and successfully installing yamllint using pip install yamllint. when I'm trying to use yamlling by ...
Read more >Project dependencies - D2iQ Help Center
golang.org/x, lint, v0.0.0-20200302205851-738671d3881b, BSD-3-Clause ... go4.org/unsafe, assume-no-moving-gc, v0.0.0-20220617031537-928513b29760 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK, here’s what’s going on:
I have yamllint installed through Fedora package manager. So without passing the PATH value through to the environment my system is picking up /usr/bin/yamllint. When I send through the PATH value, I get the yamllint that’s installed in my virtualenv.
Since the previous behavior of molecule was to run with the entire invoking environment, I’m going to submit a patch that passes the entirety of os.environ through along with the MOLECULE_ values unless someone objects to that.
For a quick-and-dirty workaround while waiting for the next release, add the following
PATH=
line in thelint
block, before running the linters:The PATH variable will be expanded by molecule BEFORE running the shell script, instead of being expanded by the shell of the
lint
block.