From 4c21116d6ea02c6d88b7cef21c95b04df9bd87db Mon Sep 17 00:00:00 2001 From: ogrechko Date: Sun, 28 Dec 2025 00:39:32 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20ansible/deploy=5Fall.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/deploy_all.yml | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/ansible/deploy_all.yml b/ansible/deploy_all.yml index 01666f1..fe5a4bf 100644 --- a/ansible/deploy_all.yml +++ b/ansible/deploy_all.yml @@ -1,19 +1,36 @@ -- name: Infrastructure Deployment +--- +- name: Step 1 - Terraform Provisioning hosts: localhost + connection: local + gather_facts: false tasks: - name: Run Terraform Apply community.general.terraform: - project_path: "./terraform" + project_path: "./terraform" # путь к папке с .tf файлами в вашем репозитории state: present force_init: true - backend_config: - address: "{{ lookup('env', 'TF_HTTP_ADDRESS') }}" - username: "{{ lookup('env', 'TF_HTTP_USERNAME') }}" - password: "{{ lookup('env', 'TF_HTTP_PASSWORD') }}" + register: tf_result - - name: Wait for VMs to be ready - pause: - seconds: 30 + - name: Wait for SSH to be ready + wait_for: + host: "{{ item }}" + port: 22 + state: started + timeout: 300 + loop: + - 10.33.33.201 + - 10.33.33.202 + - 10.33.33.203 -- name: Kubernetes Cluster Setup - import_playbook: k8s_setup.yml \ No newline at end of file +- name: Step 2 - Install Kubernetes + hosts: all + # Теперь мы переключаемся на реальные сервера. + # Чтобы это сработало в одном шаблоне, + # в Semaphore должен быть выбран Inventory со всеми хостами, + # НО в первом Play мы принудительно используем localhost. + become: true + tasks: + - name: Install base packages + apt: + name: [curl, apt-transport-https] + state: present \ No newline at end of file