diff --git a/changelogs/fragments/56038-fix-non-signature-auth.yaml b/changelogs/fragments/56038-fix-non-signature-auth.yaml new file mode 100644 index 00000000000..ea4413757fd --- /dev/null +++ b/changelogs/fragments/56038-fix-non-signature-auth.yaml @@ -0,0 +1,2 @@ +bugfixes: +- ACI modules - Fix non-signature authentication diff --git a/lib/ansible/module_utils/network/aci/aci.py b/lib/ansible/module_utils/network/aci/aci.py index bb58f12a938..29498527c74 100644 --- a/lib/ansible/module_utils/network/aci/aci.py +++ b/lib/ansible/module_utils/network/aci/aci.py @@ -335,7 +335,7 @@ class ACIModule(object): self.url = '%(protocol)s://%(host)s/' % self.params + path.lstrip('/') # Sign and encode request as to APIC's wishes - if not self.params['private_key']: + if self.params['private_key']: self.cert_auth(path=path, payload=payload) # Perform request @@ -372,7 +372,7 @@ class ACIModule(object): self.url = '%(protocol)s://%(host)s/' % self.params + path.lstrip('/') # Sign and encode request as to APIC's wishes - if not self.params['private_key']: + if self.params['private_key']: self.cert_auth(path=path, method='GET') # Perform request @@ -659,7 +659,7 @@ class ACIModule(object): elif not self.module.check_mode: # Sign and encode request as to APIC's wishes - if not self.params['private_key']: + if self.params['private_key']: self.cert_auth(method='DELETE') resp, info = fetch_url(self.module, self.url, @@ -795,7 +795,7 @@ class ACIModule(object): uri = self.url + self.filter_string # Sign and encode request as to APIC's wishes - if not self.params['private_key']: + if self.params['private_key']: self.cert_auth(path=self.path + self.filter_string, method='GET') resp, info = fetch_url(self.module, uri, @@ -896,7 +896,7 @@ class ACIModule(object): return elif not self.module.check_mode: # Sign and encode request as to APIC's wishes - if not self.params['private_key']: + if self.params['private_key']: self.cert_auth(method='POST', payload=json.dumps(self.config)) resp, info = fetch_url(self.module, self.url,