mirror of
https://github.com/ansible/awx.git
synced 2026-03-15 07:57:29 -02:30
docs and review change for IS multivault
Mention inventory sources /credentials/ endpoint in docs Also change means of identifying projects for the purose of injecting custom credentials
This commit is contained in:
@@ -2735,11 +2735,8 @@ class InventorySourceCredentialsList(SubListAttachDetachAPIView):
|
|||||||
if error:
|
if error:
|
||||||
return {'msg': error}
|
return {'msg': error}
|
||||||
if sub.credential_type == 'vault':
|
if sub.credential_type == 'vault':
|
||||||
# Vault credentials are only exclusive with others of same ID
|
# TODO: support this
|
||||||
if sub.unique_hash() in [cred.unique_hash() for cred in parent.credentials.all()]:
|
return {"msg": _("Vault credentials are not yet supported for inventory sources.")}
|
||||||
return {"msg": _(
|
|
||||||
"A credential of type {credential_type} is already assigned to this inventory source."
|
|
||||||
).format(credential_type=sub.unique_hash(display=True))}
|
|
||||||
else:
|
else:
|
||||||
# Cloud credentials are exclusive with all other cloud credentials
|
# Cloud credentials are exclusive with all other cloud credentials
|
||||||
cloud_cred_qs = parent.credentials.exclude(credential_type__kind='vault')
|
cloud_cred_qs = parent.credentials.exclude(credential_type__kind='vault')
|
||||||
|
|||||||
@@ -927,8 +927,8 @@ class BaseTask(LogErrorsTask):
|
|||||||
elif isinstance(instance, InventoryUpdate):
|
elif isinstance(instance, InventoryUpdate):
|
||||||
# TODO: allow multiple custom creds for inv updates
|
# TODO: allow multiple custom creds for inv updates
|
||||||
credentials = [instance.get_cloud_credential()]
|
credentials = [instance.get_cloud_credential()]
|
||||||
elif hasattr(instance, 'credential'):
|
elif isinstance(instance, Project):
|
||||||
# once other UnifiedJobs (project updates)
|
# once (or if) project updates
|
||||||
# move from a .credential -> .credentials model, we can
|
# move from a .credential -> .credentials model, we can
|
||||||
# lose this block
|
# lose this block
|
||||||
credentials = [instance.credential]
|
credentials = [instance.credential]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Multi-Credential Assignment
|
|||||||
===========================
|
===========================
|
||||||
|
|
||||||
awx has added support for assigning zero or more credentials to
|
awx has added support for assigning zero or more credentials to
|
||||||
a JobTemplate via a singular, unified interface.
|
JobTemplates and InventoryUpdates via a singular, unified interface.
|
||||||
|
|
||||||
Background
|
Background
|
||||||
----------
|
----------
|
||||||
@@ -220,3 +220,16 @@ POST /api/v2/job_templates/N/launch/
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Inventory Source Credentials
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
Inventory sources and inventory updates that they spawn also use the same
|
||||||
|
relationship. The new endpoints for this are
|
||||||
|
- `/api/v2/inventory_sources/N/credentials/` and
|
||||||
|
- `/api/v2/inventory_updates/N/credentials/`
|
||||||
|
|
||||||
|
Most cloud sources will continue to adhere to the constraint that they
|
||||||
|
must have a single credential that corresponds to their cloud type.
|
||||||
|
However, this relationship allows users to associate multiple vault
|
||||||
|
credentials of different ids to inventory sources.
|
||||||
|
|||||||
Reference in New Issue
Block a user