Merge branch 'agile611:main' into main

This commit is contained in:
cocodrilo
2025-11-20 09:23:45 +01:00
committed by GitHub
2 changed files with 53 additions and 0 deletions

24
misc/example-certs.yml Normal file
View File

@@ -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

29
misc/hosts-yaml Normal file
View File

@@ -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