From 7093637cffefa21c66948d31f24d1c7c3964b3f7 Mon Sep 17 00:00:00 2001 From: ogrechko Date: Sun, 28 Dec 2025 09:31:27 +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 | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/ansible/deploy_all.yml b/ansible/deploy_all.yml index 5ad32e3..b0b8c75 100644 --- a/ansible/deploy_all.yml +++ b/ansible/deploy_all.yml @@ -40,6 +40,9 @@ chdir: "{{ playbook_dir }}/../terraform" environment: TF_CLI_CONFIG_FILE: "/tmp/.terraformrc" + TF_HTTP_ADDRESS: "{{ lookup('env', 'TF_HTTP_ADDRESS') }}" + TF_HTTP_USERNAME: "{{ lookup('env', 'TF_HTTP_USERNAME') }}" + TF_HTTP_PASSWORD: "{{ lookup('env', 'TF_HTTP_PASSWORD') }}" TF_VAR_proxmox_api_token_id: "{{ lookup('env', 'TF_VAR_proxmox_api_token_id') }}" 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') }}" @@ -49,26 +52,32 @@ name: "{{ item }}" groups: k8s_new_nodes ansible_host: "{{ item }}" - ansible_user: ubuntu # Или тот пользователь, которого ты создал в Cloud-Init + ansible_user: ubuntu loop: - 10.33.33.201 - 10.33.33.202 - 10.33.33.203 - name: Step 2 - Install Kubernetes - hosts: k8s_new_nodes # <--- Теперь используем динамическую группу - gather_facts: true - become: true + hosts: k8s_new_nodes + gather_facts: false # Сначала выключим, чтобы дождаться SSH tasks: - - name: Wait for SSH - wait_for_connection: + - name: Wait for SSH to be ready + wait_for: + host: "{{ inventory_hostname }}" + port: 22 + state: started timeout: 300 + delegate_to: localhost + become: false - - name: Test Connection - ping: + - name: Now gather facts + setup: + become: true - name: Install base packages apt: name: [curl, apt-transport-https, qemu-guest-agent] state: present - update_cache: yes \ No newline at end of file + update_cache: yes + become: true \ No newline at end of file