Эх сурвалжийг харах

added option to recreate certificate

Fabian Peter Hammerle 8 жил өмнө
parent
commit
2170795a2c
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      x509_certificate.py

+ 2 - 1
x509_certificate.py

@@ -78,12 +78,13 @@ def main(argv):
             'common_name': {'required': True, 'type': 'str'},
             'key_path': {'required': True, 'type': 'str'},
             'organization_name': {'required': False, 'type': 'str', 'default': None},
+            'recreate_cert': {'required': False, 'type': 'bool', 'default': False},
             }
         )
 
     changed = False
 
-    if os.path.exists(module.params['key_path']):
+    if os.path.exists(module.params['key_path']) and not module.params['recreate_cert']:
         key = load_key(module.params['key_path'])
     else:
         key = create_key(module.params['key_path'])