-
Notifications
You must be signed in to change notification settings - Fork 16
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
Extra vars poc #203
Merged
Merged
Extra vars poc #203
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
fef7f9a
POC: lookup plugin references playbook variables
john-odonnell 6223bff
handled the extra-vars support for lookup plugin
ramavenkata-loya d5e777d
Update CHANGELOG.md
ramavenkata-loya ecb19c7
removed the default key in the lookup plugin documentation
ramavenkata-loya 29f25d6
handled the backward compatible for conjur_authn_token_file
ramavenkata-loya 560c17b
updated the ini keys in lookup plugin
ramavenkata-loya b646a67
removed trailing whitespaces
ramavenkata-loya 31ba2b6
formatted the conjur_variable.py script
ramavenkata-loya 1f1886f
replaces the module for urllib_error
ramavenkata-loya b5c9922
updated the version in lookup plugin
ramavenkata-loya ea42740
reverted the version
ramavenkata-loya 9a7064a
Update CHANGELOG.md
itsbrugu a109a12
Dev env: remove hostname call in CLI container
john-odonnell a1d4fff
added the unit test case for extra-vars
ramavenkata-loya 675a6b2
fixed the formating issues
ramavenkata-loya e564a5e
resolved the formating issues
ramavenkata-loya 7a7e57f
Fix unit tests for using Ansible vars as config
john-odonnell 261de1d
Lookup plugin: fix false positive unit tests
john-odonnell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we have some unexpected behavior here that breaks backwards compatibility.
Previously, we had a section in the
DOCUMENTATION
variable that described theconjur_authn_token_file
variable, but it was being accessed exclusively as an environment variable, so the specified default value was not being applied. Now that we're accessing the value this way, the default value is being applied when we would expect it not to.We either need to add some special handling for this variable to maintain backwards compatibility, or release this as part of a major version bump.
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.
In the past, the authn_token_file value was generated by either an environmental variable or the default path (/var/run/conjur/access-token).
The newest modifications allow for the authn_token_file value to be pulled from either the environmental variable, extra variables, or the default path (/var/run/conjur/access-token).
The behavior was the same as earlier, but we have updated only the ini name of authn_token_file.
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.
The last part of this isn't true - previously, the lookup plugin checked the
CONJUR_AUTHN_TOKEN_FILE
environment variable, and if didn't exist, no default value was applied, and instead the plugin retrieved a new authn token.Check out this PR's Jenkins build, which is failing on the lookup plugin's end-to-end tests.
The existing
DOCUMENTATION
variable section describing theauthn_token_file
parameter is inaccurate, but we aren't usingself.get_option
, so it isn't being enforced. Backwards compatibility should be maintained if we updated the newauthn_token_file
section to specify that it doesn't have a default value, and isn't required.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.
To ensure backward compatibility for conjur_authn_token_file. We have removed the default key parameter in the conjur_authn_token_file documentation section and also added an extra check for conjur_authn_token_file.
if not variable_value and key != "conjur_authn_token_file":
raise AnsibleError("The value of the {0} variable is not set".format(key))
The token can either be selected from environmental/extra-vars variables or generated within the code.
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.
Thanks, @ramavenkata-loya!