From da066bd7fccc8214344a4931dea28e9253fcd526 Mon Sep 17 00:00:00 2001 From: ogrechko Date: Sun, 28 Dec 2025 09:57:41 +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 | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ansible/deploy_all.yml b/ansible/deploy_all.yml index 5bc88a3..11645f4 100644 --- a/ansible/deploy_all.yml +++ b/ansible/deploy_all.yml @@ -48,29 +48,29 @@ TF_VAR_proxmox_api_token_secret: "{{ lookup('env', 'TF_VAR_proxmox_api_token_secret') }}" TF_VAR_proxmox_api_url: "{{ lookup('env', 'TF_VAR_proxmox_api_url') }}" - - name: Show Apply Output - debug: - var: tf_result.stdout_lines - -- name: Step 2 - Dynamic Inventory & Setup - hosts: localhost - connection: local - tasks: - - name: Add hosts + - name: Dynamically add hosts to Ansible memory add_host: - name: "{{ item }}" - groups: k8s_new_nodes - ansible_host: "{{ item }}" - ansible_user: ubuntu - loop: [10.33.33.201, 10.33.33.202, 10.33.33.203] + name: "{{ item.name }}" + groups: + - k8s_new_nodes + - "{{ 'masters' if 'master' in item.name else 'workers' }}" + ansible_host: "{{ item.ip }}" + ansible_user: ubuntu # ИСПОЛЬЗУЕМ ubuntu ИЗ CLOUD-INIT + ansible_ssh_extra_args: "-o StrictHostKeyChecking=no" + loop: + - { name: 'master-01', ip: '10.33.33.201' } + - { name: 'worker-01', ip: '10.33.33.202' } + - { name: 'worker-02', ip: '10.33.33.203' } -- name: Step 3 - K8s Setup +- name: Step 2 - Wait for SSH and Prepare hosts: k8s_new_nodes gather_facts: false tasks: - - name: Wait for SSH - wait_for: - host: "{{ inventory_hostname }}" - port: 22 + - name: Wait for SSH to be ready on new VMs + wait_for_connection: + delay: 10 timeout: 300 - delegate_to: localhost \ No newline at end of file + +# Step 3 - Запускаем твой основной плейбук установки K8s +- name: Step 3 - Install Kubernetes Cluster + import_playbook: k8s_setup.yml \ No newline at end of file