fix(semaphore/configure): vault key attaches via vaults[] not vault_key_id
Semaphore v2.18 replaced the single vault_key_id field with a vaults[]
array supporting multi-vault per template. Sending vault_key_id is
silently ignored — template stores no vault association, runs fail
at the playbook stage with 'Attempting to decrypt but no vault
secrets found'.
Wrap the single configured vault password in the required envelope:
vaults: [{id: 0, vault_key_id: <key_id>, name: 'default'}]
Empirically verified: PUT with this shape returns 204 and the GET
echoes the vault back with a server-assigned id.
This commit is contained in:
@@ -305,7 +305,9 @@
|
|||||||
'survey_vars': item.survey_vars | default([])
|
'survey_vars': item.survey_vars | default([])
|
||||||
}
|
}
|
||||||
| combine(
|
| combine(
|
||||||
{'vault_key_id': _semaphore_key_ids[item.vault_password] | int}
|
{'vaults': [{'id': 0,
|
||||||
|
'vault_key_id': _semaphore_key_ids[item.vault_password] | int,
|
||||||
|
'name': 'default'}]}
|
||||||
if item.vault_password is defined else {}
|
if item.vault_password is defined else {}
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user