Explorar el Código

added option to recreate certificate

Fabian Peter Hammerle hace 8 años
padre
commit
2170795a2c
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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'])