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 Linting Errors #2860

Closed
etienne-miralytik opened this issue Aug 24, 2022 · 4 comments · Fixed by #2861
Closed

Ansible Linting Errors #2860

etienne-miralytik opened this issue Aug 24, 2022 · 4 comments · Fixed by #2861

Comments

@etienne-miralytik
Copy link
Contributor

Hey

- name: nvm
  shell: >
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  args:
    creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh"

this provided Ansible task from README.md has multiple Linting Errors:

command-instead-of-module: curl used in place of get_url or uri module
[...] Task/Handler: nvm

fqcn-builtins: Use FQCN for builtin actions.
[...] Task/Handler: nvm

name: All names should start with an uppercase letter. (name[casing])
[...] Task/Handler: nvm

risky-shell-pipe: Shells that use pipes should set the pipefail option.
[...] Task/Handler: nvm

The ansible-lint version used was 6.5.0

@ljharb
Copy link
Member

ljharb commented Aug 24, 2022

Thanks!

  • curl is used intentionally, because that's what the official install script uses.
  • I have no idea what FQCN is, can you elaborate?
  • sure, i guess? seems unimportant tho
  • this script does not need the pipefail option.

@etienne-miralytik
Copy link
Contributor Author

FQCN just means that you should use the full module name: ansible.builtin.shell

@ljharb
Copy link
Member

ljharb commented Aug 24, 2022

A PR to make the relevant fixes would be appreciated.

@etienne-miralytik
Copy link
Contributor Author

Well this only leaves the two minor errors, I opened PR #2861 to fix them.

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

Successfully merging a pull request may close this issue.

3 participants
@ljharb @etienne-miralytik and others