{"id":28904767,"url":"https://github.com/ralf02/k8s-ansible-aws","last_synced_at":"2026-05-07T03:37:10.896Z","repository":{"id":298964030,"uuid":"1001692212","full_name":"ralf02/k8s-ansible-aws","owner":"ralf02","description":"Propuesta de automatización de Instalación de Kubernetes y Docker en Instancias Debian AWS con Ansible.","archived":false,"fork":false,"pushed_at":"2025-06-13T20:45:54.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-13T21:33:37.801Z","etag":null,"topics":["ansible","aws","cluster","devops","docker","k8s"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ralf02.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-13T20:38:28.000Z","updated_at":"2025-06-13T20:48:19.000Z","dependencies_parsed_at":"2025-06-15T22:02:21.307Z","dependency_job_id":null,"html_url":"https://github.com/ralf02/k8s-ansible-aws","commit_stats":null,"previous_names":["ralf02/k8s-ansible-aws"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ralf02/k8s-ansible-aws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralf02%2Fk8s-ansible-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralf02%2Fk8s-ansible-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralf02%2Fk8s-ansible-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralf02%2Fk8s-ansible-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ralf02","download_url":"https://codeload.github.com/ralf02/k8s-ansible-aws/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralf02%2Fk8s-ansible-aws/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261126449,"owners_count":23113312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","aws","cluster","devops","docker","k8s"],"created_at":"2025-06-21T13:02:09.645Z","updated_at":"2026-05-07T03:37:10.890Z","avatar_url":"https://github.com/ralf02.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Infraestructura como Código con Terraform \u0026 Ansible\n\nEste proyecto contiene la configuración de infraestructura como Codigo (IaC) con Terraform y playbooks de Ansible para la gestión de infraestructura en la nube AWS, con soporte para Kubernetes, Docker, GitLab Runner y más.\n\n## Estructura del Proyecto\n```\n   .\n   ├── ansible/                   # Configuración principal de Ansible\n   │   ├── ansible.cfg            # Configuración global de Ansible\n   │   ├── inventory/             # Definición de hosts y grupos\n   │   │   └── hosts.yml          # Configuración de hosts en formato YAML\n   │   ├── playbooks/             # Playbooks principales\n   │   │   ├── k8s-cluster.yml    # Configuraciones comunes\n   │   │   └── simple-server.yml  # Instalación y configuración de Docker\n   │   └── roles/                 # Roles de Ansible organizados por funcionalidad\n   │       ├── commons/           # Configuraciones básicas del sistema\n   │       ├── cerbot             # Configuraciones cerbot\n   │       ├── docker             # Configuraciones docker\n   │       ├── gitlab-runner      # Configuraciones gitlab-runner\n   │       ├── kubernetes         # Configuraciones para un cluster k8s\n   │       ├── php                # Configuraciones php\n   │       └── update-system      # Actualizaciones del sistema\n   │\n   ├── terraform/                 # Configuración de infraestructura con Terraform\n   │   ├── environments/          # Entornos (dev, prod, etc.)\n   │   │   └── dev/\n   │   │       └── simple-server/ # Configuración para servidor simple\n   │   └── modules/               # Módulos reutilizables\n   │       ├── ec2/               # Configuración de instancias EC2\n   │       ├── vpc/               # Configuración de VPC\n   │       └── security_groups/   # Configuración de grupos de seguridad\n   │\n   ├── scripts/\n   │   ├── run_ansible_k8s        # Script para ejecutar la creacion de un cluster k8s\n   │   ├── run_ansible.sh         # Script para ejecutar playbooks\n   │   └── run_IaC_simple_server.sh        # Script completo IaC (Terraform + Ansible)\n   │\n   ├── notes/                     # Documentación y notas adicionales\n   │   └── labs/                  # Laboratorios iniciales\n   └── env.example                # Plantilla de variables de entorno\n```\n\n## Configuración de variables de Entorno\n\n1. Copia el archivo de entorno de ejemplo:\n   ```bash\n   cp env.example .env\n   ```\n\n2. Edita el archivo `.env` con tus credenciales y configuraciones:\n   ```bash\n   # Configuración default ansible\n   ANSIBLE_HOST=1.2.3.4\n   ANSIBLE_USER=user\n   ANSIBLE_KEY=~/.ssh/tu-clave.pem\n\n   # IPs de los servidores para cluster k8s\n   WORKER_NODE_01_IP=1.2.3.2\n   WORKER_NODE_02_IP=1.2.3.3\n   ```\n\n## Uso Básico\n\n### Ejecucción playbooks Ansible\n\nUsa el script `run_ansible.sh` para ejecutar un playbook en especifico para testear. Este script cargará automáticamente las variables de entorno desde el archivo `.env`:\n\n```bash\n# Dar permisos de ejecución al script\nchmod +x ./scripts/run_ansible.sh\n\n# Ejecutar playbook de actualizaciones del sistema\n./scripts/run_ansible.sh playbooks/00-update-system.yml\n\n# Ejecutar playbook de paquetes comunes\n./scripts/run_ansible.sh playbooks/01-commons.yml\n\n# Ejecutar playbook de dokcer\n./scripts/run_ansible.sh playbooks/02-docker.yml\n\n```\n### Gestión de Infraestructura con Terraform\n\nIncluyo scripts para gestionar la infraestructura con terraform :\n\n```bash\n# Dar permisos de ejecución a los scripts\nchmod +x ./scripts/run_terraform_simple_server.sh\nchmod +x ./scripts/run_IaC_simple_server.sh\n\n# Desplegar infraestructura\n./scripts/run_terraform_simple_server.sh apply\n\n# Destruir infraestructura (con confirmación)\n./scripts/run_terraform_simple_server.sh destroy\n\n# Despliegue completo (Terraform + Ansible)\n./scripts/run_IaC_simple_server.sh\n```\n\n## Variables de Entorno\n\nLas siguientes variables de entorno pueden configurarse en el archivo `.env`:\n\n- `ANSIBLE_HOST`: IP del host (en el cluster k8s actuara como nodo de control)\n- `ANSIBLE_USER`: Usuario para conectarse a los servidores remotos\n- `ANSIBLE_KEY`: Ruta a la clave privada SSH\n- `WORKER_NODE_XX_IP`: IPs de los nodos worker para cluster k8s\n\n## Notas adicionales\n\n- Todas las credenciales y configuraciones sensibles deben ir en el archivo `.env`\n- El archivo `.env` está incluido en `.gitignore` por defecto\n- Usa `run_ansible.sh` para ejecutar playbooks con las variables de entorno cargadas automáticamente\n- Los archivos `*.tfplan` y `*.tfstate` están incluidos en `.gitignore` por seguridad\n- La infraestructura se puede gestionar manualmente con Terraform en el directorio `terraform/environments/dev/simple-server/`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralf02%2Fk8s-ansible-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fralf02%2Fk8s-ansible-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralf02%2Fk8s-ansible-aws/lists"}