diff --git a/misc/example-certs.yml b/misc/example-certs.yml new file mode 100644 index 0000000..715d324 --- /dev/null +++ b/misc/example-certs.yml @@ -0,0 +1,24 @@ +- name: test para autenticar en máquina con certificado + hosts: all + become: yes + vars: + domain_name: "example.com" + cert_path: "/etc/ssl/certs/example.com.crt" + key_path: "/etc/ssl/private/example.com.key" + tasks: + - name: Asegurarse que existe la clave dominio + community.crypto.openssl_privatekey: + path: "{{ key_path }}" + size: 2048 + state: present + + - name: Obtener certificado via ACME (Let's Encrypt) + community.crypto.acme_certificate: + account_key_src: "/etc/ssl/private/account.key" + csr: + common_name: "{{ domain_name }}" + fullchain_dest: "{{ cert_path }}" + privatekey_dest: "{{ key_path }}" + provider: letsencrypt + terms_agreed: true + state: present \ No newline at end of file diff --git a/misc/hosts-yaml b/misc/hosts-yaml new file mode 100644 index 0000000..9c2740f --- /dev/null +++ b/misc/hosts-yaml @@ -0,0 +1,29 @@ +all: + ansible_python_interpreter: /usr/bin/python3.12 + +database: + hosts: + db_01: + ansible_host: 192.168.11.20 + ansible_connection: ssh + ansible_user: vagrant + ansible_ssh_password: vagrant +loadbalancer: + hosts: + lb_01: + ansible_host: 192.168.11.30 + ansible_connection: ssh + ansible_user: vagrant + ansible_ssh_password: vagrant +webserver: + hosts: + ws_01: + ansible_host: 192.168.11.40 + ansible_connection: ssh + ansible_user: vagrant + ansible_ssh_password: vagrant + ws_02: + ansible_host: 192.168.11.50 + ansible_connection: ssh + ansible_user: vagrant + ansible_ssh_password: vagrant \ No newline at end of file