I’m following the docs:
community.general.tss lookup – Get secrets from Thycotic Secret Server — Ansible Community Documentation
and my code is:
---
# tasks file for tw.tss
- hosts: localhost
connection: local
gather_facts: no
vars:
key: !vault |
$ANSIBLE_VAULT;1.1;AES256
<vault value>
uri: https://<secretserverurl/SecretServer
role: rolename
secretid: <thesecretID>
secret_password: >-
{{
lookup(
'community.general.tss',
secretid,
base_url=uri,
token=key
) | from_json).get('items') | items2dict(key_name='slug', value_name='itemValue'))['password']
}}
tasks:
- ansible.builtin.debug:
msg: the password is {{ secret_password }}
I have tried a few variations as the docs showed
secret_password: >-
{{
((lookup(
'community.general.tss',
102,
base_url='https://secretserver.domain.com/SecretServer/',
token='thycotic_access_token',
) | from_json).get('items') | items2dict(key_name='slug', value_name='itemValue'))['password']
}}
the trailing ‘,’ seems incorrect and the leeding ‘((’ that are not closed also seemed incorrect. Initially I had those in
the error I receive is
Vault password:
ERROR! 'ansible.builtin.debug' is not a valid attribute for a Play
The error appears to be in '/runner/project/tss.yml': line 31, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- ansible.builtin.debug:
^ here
Additionally, I have tried the built in secret server integration but it failed, I believe ssl cert trust, but I cannot specify an EE to run it from to bypass.