Only set cacert and capath if env set
@@ -54,8 +54,12 @@ class LookupModule(LookupBase):
}
authtype = self._get_environment(environments, 'VAULT_AUTHTYPE', 'token')
params['authtype'] = authtype
- params['ca_cert'] = os.getenv('VAULT_CACERT')
- params['ca_path'] = os.getenv('VAULT_CAPATH')
+ cacert = self._get_environment(environments, 'VAULT_CACERT')
+ if cacert:
+ params['ca_cert'] = cacert
+ capath = self._get_environment(environments, 'VAULT_CAPATH')
+ if capath:
+ params['ca_path'] = capath
params['client_cert'] = os.getenv('VAULT_CLIENT_CERT')
params['client_key'] = os.getenv('VAULT_CLIENT_KEY')
if authtype == 'approle':
