question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

yamllint is not found when running 'lint' target as of Molecule 3.0.7

See original GitHub issue

Issue 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:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
greg-hellingscommented, Aug 18, 2020

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.

1reaction
sduthilcommented, Aug 18, 2020

For a quick-and-dirty workaround while waiting for the next release, add the following PATH= line in the lint block, before running the linters:

lint: |
  set -e
  PATH=${PATH}
  yamllint .
  ...

The PATH variable will be expanded by molecule BEFORE running the shell script, instead of being expanded by the shell of the lint block.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found