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

~ and environment variables are not expanded properly both as cli arguments or as in config files #975

Closed
ksmets opened this issue Aug 19, 2020 · 0 comments · Fixed by #976
Labels
new Triage required

Comments

@ksmets
Copy link
Contributor

ksmets commented Aug 19, 2020

Summary

~ and environment variables are not expanded properly when specified as exclude_paths or rulesdir both as cli arguments when using -r=... or --exclude=~... or when used in .ansible-lint config file.

Issue Type
  • Bug Report
Ansible and Ansible Lint details
ansible --version
ansible 2.9.12

ansible-lint --version
ansible-lint 4.3.0
  • ansible installation method: pip(x)
  • ansible-lint installation method: pip(x)
OS / ENVIRONMENT

OS independent

STEPS TO REPRODUCE
ansible-lint -r=~/my-ansible-lint-rules --exclude=~/.ansible/roles -vv

DEBUG    Logging initialized to level 10
DEBUG    Options: Namespace(colored=True, config_file=None, display_relative_path=True, exclude_paths=[PosixPath('/tmp/~/.ansible/roles')], format='plain', listrules=False, listtags=False, parseable=False, parseable_severity=False, playbook=[], quiet=False, rulesdir=[PosixPath('/tmp/~/my-ansible-lint-rules')], skip_list=[], tags=[], use_default_rules=False, verbosity=2)
DEBUG    Loading rules from /tmp/~/my-ansible-lint-rules
INFO     Discovering files to lint: git ls-files *.yaml *.yml
WARNING  Failed to discover yaml files to lint using git: fatal: not a git repository (or any of the parent directories): .git
INFO     Found roles: 
INFO     Found playbooks:
cat .ansible-lint
exclude_paths:
- ~/.ansible/roles
rulesdir:
- ~/my-ansible-lint-rules

ansible-lint -vv
DEBUG    Logging initialized to level 10
DEBUG    Options: Namespace(colored=True, config_file=None, display_relative_path=True, exclude_paths=['/tmp/~/.ansible/roles'], format='plain', listrules=False, listtags=False, parseable=False, parseable_severity=False, playbook=[], quiet=False, rulesdir=['/tmp/~/my-ansible-lint-rules'], skip_list=[], tags=[], use_default_rules=False, verbosity=2)
DEBUG    Loading rules from /tmp/~/my-ansible-lint-rules
INFO     Discovering files to lint: git ls-files *.yaml *.yml
WARNING  Failed to discover yaml files to lint using git: fatal: not a git repository (or any of the parent directories): .git
INFO     Found roles: 
INFO     Found playbooks: 
Desired Behaviour
ansible-lint -vv
DEBUG    Logging initialized to level 10
DEBUG    Options: Namespace(colored=True, config_file=None, display_relative_path=True, exclude_paths=['/home/ksmets/.ansible/roles'], format='plain', listrules=False, listtags=False, parseable=False, parseable_severity=False, playbook=[], quiet=False, rulesdir=['/home/ksmets/my-ansible-lint-rules'], skip_list=[], tags=[], use_default_rules=False, verbosity=2)
DEBUG    Loading rules from /home/ksmets/my-ansible-lint-rules
INFO     Discovering files to lint: git ls-files *.yaml *.yml
WARNING  Failed to discover yaml files to lint using git: fatal: not a git repository (or any of the parent directories): .git
INFO     Unknown file type: test-ansible/requirements.yml
INFO     Found roles: 
INFO     Found playbooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new Triage required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant