Replies: 4 comments 5 replies
-
Check that you provide correct script:
- echo $ANSIBLE_VAULT_PASSWORD > .vault_password
- ANSIBLE_VAULT_PASSWORD_FILE=.vault_password ansible-lint
variables:
# By default the CI/CD variables are not propagated to the runner
ANSIBLE_VAULT_PASSWORD: $ANSIBLE_VAULT_PASSWORD |
Beta Was this translation helpful? Give feedback.
-
Can't you just exclude the file?
|
Beta Was this translation helpful? Give feedback.
-
I was able to get around this issue for my circumstances, maybe the solution will be useful to other people. The problem I had was when I was statically importing variables, in my case via When I changed the playbook to dynamically importing variables, ansible-lint was happy again! Of course, you need to check you are happy with the variable precedence and any edge cases. For example, previous problematic playbook:
Happy dynamic playbook:
|
Beta Was this translation helpful? Give feedback.
-
I had the same issue and found a workaround that doesn't require any changes in the Ansible code. Apparently, Ansible Lint only checks that the path in I've simply added a step to my CI pipeline to create a password file with the content "fake_password" and Ansible Lint properly lints everything without complaints. (I've only tested this with inline vault-encrypted strings so far, not with entirely encrypted variable files. Those caused issues with Ansible Lint anyway, so we stopped using them. I'd generally recommend inline encryption by now, it's easier to maintain and to review in a pull request.) I still think it would be a great addition to add a |
Beta Was this translation helpful? Give feedback.
-
I have a playbook which contains vault variables. Locally I am decrypting it via a vault file. Now on CI I don't need this file because I am only verifying the playbook with
ansible-lint
. But I am getting this error:Is there a way to disable this check without disabling the whole "internal-error" check?
Beta Was this translation helpful? Give feedback.
All reactions