From 533e79ba959143f0459431a486bfb85c56c72ddc Mon Sep 17 00:00:00 2001 From: luisgulo Date: Fri, 24 Oct 2025 18:01:10 +0200 Subject: Releasing code version 1.8.0 --- examples/openssl_autogen.yaml | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 examples/openssl_autogen.yaml (limited to 'examples/openssl_autogen.yaml') diff --git a/examples/openssl_autogen.yaml b/examples/openssl_autogen.yaml new file mode 100644 index 0000000..8c02e70 --- /dev/null +++ b/examples/openssl_autogen.yaml @@ -0,0 +1,46 @@ +hosts: localhost +parallelism: false + +tasks: + - name: Generar certificado autofirmado en /tmp + module: run + args: + command: | + openssl req -x509 -newkey rsa:2048 -keyout /tmp/test.key -out /tmp/test.crt \ + -days 365 -nodes -subj "/CN=example.com" && \ + openssl pkcs12 -export -out /tmp/certificado.pfx \ + -inkey /tmp/test.key -in /tmp/test.crt \ + -name "Certificado de Prueba" -password pass:secreta + become: false + + - name: Convertir PFX a PEM + module: openssl + args: + state: convert + src: /tmp/certificado.pfx + dest: /tmp/certificado.pem + format: pem + password: "secreta" + + - name: Inspeccionar certificado convertido + module: openssl + args: + state: inspect + src: /tmp/certificado.pem + + - name: Instalar certificado como CA confiable + module: openssl + args: + state: trust + src: /tmp/certificado.pem + alias: mi_certificado + trust_path: /usr/local/share/ca-certificates/ + become: true + + - name: Eliminar certificado como CA + module: openssl + args: + state: untrust + alias: mi_certificado + trust_path: /usr/local/share/ca-certificates/ + become: true -- cgit v1.2.3