updated pki.py script
This commit is contained in:
parent
283fc7bf32
commit
d0d57526c8
@ -8,7 +8,7 @@ def fetched(name=None,
|
||||
username=None,
|
||||
password=None,
|
||||
domains=None,
|
||||
certfile=None,
|
||||
fullcertfile=None,
|
||||
keyfile=None):
|
||||
|
||||
ret = {
|
||||
@ -22,7 +22,7 @@ def fetched(name=None,
|
||||
currentkey = None
|
||||
domain_concat = ",".join(domains)
|
||||
|
||||
currentcert = __salt__['pki.get_file_content'](checkfile=certfile)
|
||||
currentcert = __salt__['pki.get_file_content'](checkfile=fullcertfile)
|
||||
currentkey = __salt__['pki.get_file_content'](checkfile=keyfile)
|
||||
|
||||
newcert, newkey = __salt__['pki.get_pki_cert'](url=url,
|
||||
@ -31,7 +31,7 @@ def fetched(name=None,
|
||||
domains=domain_concat)
|
||||
|
||||
if currentcert != newcert or currentkey != newkey:
|
||||
wcert = __salt__['pki.write_file_content'](newcert, certfile)
|
||||
wcert = __salt__['pki.write_file_content'](newcert, fullcertfile)
|
||||
wkey = __salt__['pki.write_file_content'](newkey, keyfile)
|
||||
|
||||
ret["changes"]["old"] = "\n".join([currentcert, currentkey])
|
||||
|
Loading…
Reference in New Issue
Block a user