mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-02 14:29:10 -07:00
[PR #8091/67736d79 backport][stable-8] Fix consul_token usage without accessor_id. (#8097)
Fix consul_token usage without accessor_id. (#8091)
* Fix consul_token usage without accessor_id.
* Update changelogs/fragments/8091-consul-token-fixes.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/consul_token.py
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 67736d796a
)
Co-authored-by: Florian Apolloner <florian@apolloner.eu>
This commit is contained in:
parent
c47081245c
commit
12ab33df84
4 changed files with 20 additions and 1 deletions
|
@ -237,6 +237,12 @@ class ConsulTokenModule(_ConsulModule):
|
|||
|
||||
create_only_fields = {"expiration_ttl"}
|
||||
|
||||
def read_object(self):
|
||||
# if `accessor_id` is not supplied we can only create objects and are not idempotent
|
||||
if not self.params.get(self.unique_identifier):
|
||||
return None
|
||||
return super(ConsulTokenModule, self).read_object()
|
||||
|
||||
def needs_update(self, api_obj, module_obj):
|
||||
# SecretID is usually not supplied
|
||||
if "SecretID" not in module_obj and "SecretID" in api_obj:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue