-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Update TSS lookup plugin documentation and add Delinea Platform authentication examples #11031
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
Open
delinea-sagar
wants to merge
2
commits into
ansible-collections:main
Choose a base branch
from
delinea-sagar:rebranding.delinea_sagar
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+60
−11
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||
| minor_changes: | ||||||
| - "tss lookup plugin - updated documentation to reflect Delinea rebranding, changing references from 'Thycotic Secret Server' to 'Delinea Secret Server' in the short description (https://github.com/ansible-collections/community.general/pull/11031)." | ||||||
| - "tss lookup plugin - enhanced EXAMPLES section with clearer task names and added Platform authentication examples for Delinea Platform service users and tokens (https://github.com/ansible-collections/community.general/pull/11031)." | ||||||
| - "tss lookup plugin - improved RETURN documentation to include both secret ID and secret path lookup responses (https://github.com/ansible-collections/community.general/pull/11031)." | ||||||
| - "tss lookup plugin - fixed AccessTokenAuthorizer initialization to include base_url parameter for proper token authentication (https://github.com/ansible-collections/community.general/pull/11031)." | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ | |
| DOCUMENTATION = r""" | ||
| name: tss | ||
| author: Adam Migus (@amigus) <[email protected]> | ||
| short_description: Get secrets from Thycotic Secret Server | ||
| short_description: Get secrets from Delinea Secret Server | ||
| version_added: 1.0.0 | ||
| description: | ||
| - Uses the Thycotic Secret Server Python SDK to get Secrets from Secret Server using token authentication with O(username) | ||
|
|
@@ -119,14 +119,16 @@ | |
| RETURN = r""" | ||
| _list: | ||
| description: | ||
| - The JSON responses to C(GET /secrets/{id}). | ||
| - The JSON responses to C(GET /secrets/{id}) and C(GET /secrets/{path}). | ||
| - See U(https://updates.thycotic.net/secretserver/restapiguide/TokenAuth/#operation--secrets--id--get). | ||
| type: list | ||
| elements: dict | ||
| """ | ||
|
|
||
| EXAMPLES = r""" | ||
| - hosts: localhost | ||
| # Using Secret Server Authentication | ||
| - name: Lookup secret using Secret Server user credentials | ||
| hosts: localhost | ||
| vars: | ||
| secret: >- | ||
| {{ | ||
|
|
@@ -147,7 +149,8 @@ | |
| value_name='itemValue'))['password'] | ||
| }} | ||
|
|
||
| - hosts: localhost | ||
| - name: Lookup secret with domain user | ||
| hosts: localhost | ||
| vars: | ||
| secret: >- | ||
| {{ | ||
|
|
@@ -169,7 +172,8 @@ | |
| value_name='itemValue'))['password'] | ||
| }} | ||
|
|
||
| - hosts: localhost | ||
| - name: Lookup secret using Secret Server token | ||
| hosts: localhost | ||
| vars: | ||
| secret_password: >- | ||
| {{ | ||
|
|
@@ -187,7 +191,8 @@ | |
| # Private key stores into certificate file which is attached with secret. | ||
| # If fetch_attachments=True then private key file will be download on specified path | ||
| # and file content will display in debug message. | ||
| - hosts: localhost | ||
| - name: Lookup secret and fetch attachments using Secret Server token | ||
| hosts: localhost | ||
| vars: | ||
| secret: >- | ||
| {{ | ||
|
|
@@ -210,7 +215,8 @@ | |
| }} | ||
|
|
||
| # If fetch_secret_ids_from_folder=true then secret IDs are in a folder is fetched based on folder ID | ||
| - hosts: localhost | ||
| - name: Lookup secret IDs by folder ID using Secret Server token | ||
| hosts: localhost | ||
| vars: | ||
| secret: >- | ||
| {{ | ||
|
|
@@ -230,7 +236,8 @@ | |
| }} | ||
|
|
||
| # If secret ID is 0 and secret_path has value then secret is fetched by secret path | ||
| - hosts: localhost | ||
| - name: Lookup secret by secret path using Secret Server user credentials | ||
| hosts: localhost | ||
| vars: | ||
| secret: >- | ||
| {{ | ||
|
|
@@ -251,6 +258,45 @@ | |
| | items2dict(key_name='slug', | ||
| value_name='itemValue'))['password'] | ||
| }} | ||
|
|
||
| # Using Platform Authentication | ||
| - name: Lookup secret using Platform service user credentials | ||
| hosts: localhost | ||
| vars: | ||
| secret: >- | ||
| {{ | ||
| lookup( | ||
| 'community.general.tss', | ||
| 102, | ||
| base_url='https://platform.delinea.app/', | ||
| username='platform_service_username', | ||
| password='platform_service_user_password' | ||
| ) | ||
| }} | ||
| tasks: | ||
| - ansible.builtin.debug: | ||
| msg: > | ||
| the password is {{ | ||
| (secret['items'] | ||
| | items2dict(key_name='slug', | ||
| value_name='itemValue'))['password'] | ||
| }} | ||
|
|
||
| - name: Lookup secret using platform token | ||
| hosts: localhost | ||
| vars: | ||
| secret_password: >- | ||
| {{ | ||
| ((lookup( | ||
| 'community.general.tss', | ||
| 102, | ||
| base_url='https://platform.delinea.app/', | ||
| token='delinea_platform_access_token', | ||
| ) | from_json).get('items') | items2dict(key_name='slug', value_name='itemValue'))['password'] | ||
| }} | ||
| tasks: | ||
| - ansible.builtin.debug: | ||
| msg: the password is {{ secret_password }} | ||
| """ | ||
|
|
||
| import abc | ||
|
|
@@ -394,9 +440,7 @@ def __init__(self, **server_parameters): | |
| @staticmethod | ||
| def _get_authorizer(**server_parameters): | ||
| if server_parameters.get("token"): | ||
| return AccessTokenAuthorizer( | ||
| server_parameters["token"], | ||
| ) | ||
| return AccessTokenAuthorizer(server_parameters["token"], server_parameters["base_url"]) | ||
|
|
||
| if server_parameters.get("domain"): | ||
| return DomainPasswordGrantAuthorizer( | ||
|
|
||
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.
Documentation changes are generally not mentioned in the changelog.