From 22fe4431149d8f6e1b5b6fe9ad16bafc7441c3e8 Mon Sep 17 00:00:00 2001 From: ogrechko Date: Sun, 28 Dec 2025 09:21:58 +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 | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/ansible/deploy_all.yml b/ansible/deploy_all.yml index 71d621a..8ba25fc 100644 --- a/ansible/deploy_all.yml +++ b/ansible/deploy_all.yml @@ -2,19 +2,13 @@ - name: Step 1 - Terraform Provisioning hosts: localhost connection: local - gather_facts: false # <--- ОТКЛЮЧАЕМ автоматический сбор фактов - become: false # <--- ПРИНУДИТЕЛЬНО отключаем sudo - vars: - tf_dir: "{{ playbook_dir }}/../terraform" + gather_facts: false # <--- ТЕПЕРЬ СТРОГО FALSE + become: false # <--- ТЕПЕРЬ СТРОГО FALSE + tasks: - # Если нам всё же нужны данные о системе, собираем их без sudo - - name: Manual fact gathering without sudo - setup: - become: false - - name: Create terraform mirror config copy: - dest: "/tmp/.terraformrc" # Используем /tmp, так как в контейнере права туда есть всегда + dest: "/tmp/.terraformrc" content: | provider_installation { network_mirror { @@ -25,15 +19,15 @@ } } - - name: Cleanup old terraform data + - name: Clean old terraform file: - path: "{{ tf_dir }}/.terraform" + path: "{{ playbook_dir }}/../terraform/.terraform" state: absent - name: Terraform Init shell: terraform init -reconfigure -no-color args: - chdir: "{{ tf_dir }}" + chdir: "{{ playbook_dir }}/../terraform" environment: TF_CLI_CONFIG_FILE: "/tmp/.terraformrc" TF_HTTP_USERNAME: "{{ lookup('env', 'TF_HTTP_USERNAME') }}" @@ -42,7 +36,7 @@ - name: Terraform Apply shell: terraform apply -auto-approve -no-color args: - chdir: "{{ tf_dir }}" + chdir: "{{ playbook_dir }}/../terraform" environment: TF_CLI_CONFIG_FILE: "/tmp/.terraformrc" TF_VAR_proxmox_api_token_id: "{{ lookup('env', 'TF_VAR_proxmox_api_token_id') }}" @@ -51,10 +45,8 @@ - name: Step 2 - Install Kubernetes hosts: all - become: true # Для реальных серверов sudo всё еще нужно + gather_facts: true # Тут факты нужны, так как это реальные серверы + become: true # Тут sudo нужно tasks: - - name: Install base packages - apt: - name: [curl, apt-transport-https, qemu-guest-agent] - state: present - update_cache: yes \ No newline at end of file + - name: Test Connection + ping: \ No newline at end of file