-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Clean up ansible-lint and yamllint issues #106
Conversation
Can you squash your commits into one and overwrite this branch (force push) with that commit? |
c008b90
to
3aff54d
Compare
@lae Done |
@@ -17,22 +17,22 @@ netbox_config: | |||
- Dale Gribble | |||
- [email protected] | |||
# note that the array is nested above | |||
BANNER_BOTTOM: *BANNER_TOP | |||
BANNER_BOTTOM: '*BANNER_TOP' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change the value? It's a reference to another value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this thing passes to jinja2? If so it must be the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
My understanding is that Ansible parses the YAML first, so here I think it was supposed to reference the value of the BANNER_TOP key and that value itself would get passed to Jinja for templating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I don't know how it working. Where does the variable for BANNER_BOTTOM
come from?
There is a problem if leave everything as is (without quotes).
❯ ansible-lint
Warning: Failed to load examples/netbox_config.yml with We were unable to read either as JSON nor YAML, these are the errors we got from each:
JSON: Expecting value: line 1 column 1 (char 0)
Syntax Error while loading YAML.
found undefined alias
The error appears to be in '/home/shm/Documents/projects/ansible-role-netbox/examples/netbox_config.yml': line 20, column 18, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
# note that the array is nested above
BANNER_BOTTOM: *BANNER_TOP
^ here
, assuming is not a playbook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the reference creation needs to be placed further above. I think? e.g.:
BANNER_TOP: &BANNER_TOP 'Your banner text'
BANNER_BOTTOM: *BANNER_TOP
(but also, it's an example so I'm not sure if the linter should be parsing it)
1aece01
to
213390a
Compare
Clean up ansible-lint and yamllint issues
Issue: #103
Lint OK, but
ansible test
still failed.