Обновить ansible/deploy_all.yml
This commit is contained in:
@@ -1,19 +1,36 @@
|
|||||||
- name: Infrastructure Deployment
|
---
|
||||||
|
- name: Step 1 - Terraform Provisioning
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
|
connection: local
|
||||||
|
gather_facts: false
|
||||||
tasks:
|
tasks:
|
||||||
- name: Run Terraform Apply
|
- name: Run Terraform Apply
|
||||||
community.general.terraform:
|
community.general.terraform:
|
||||||
project_path: "./terraform"
|
project_path: "./terraform" # путь к папке с .tf файлами в вашем репозитории
|
||||||
state: present
|
state: present
|
||||||
force_init: true
|
force_init: true
|
||||||
backend_config:
|
register: tf_result
|
||||||
address: "{{ lookup('env', 'TF_HTTP_ADDRESS') }}"
|
|
||||||
username: "{{ lookup('env', 'TF_HTTP_USERNAME') }}"
|
|
||||||
password: "{{ lookup('env', 'TF_HTTP_PASSWORD') }}"
|
|
||||||
|
|
||||||
- name: Wait for VMs to be ready
|
- name: Wait for SSH to be ready
|
||||||
pause:
|
wait_for:
|
||||||
seconds: 30
|
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
|
- name: Step 2 - Install Kubernetes
|
||||||
import_playbook: k8s_setup.yml
|
hosts: all
|
||||||
|
# Теперь мы переключаемся на реальные сервера.
|
||||||
|
# Чтобы это сработало в одном шаблоне,
|
||||||
|
# в Semaphore должен быть выбран Inventory со всеми хостами,
|
||||||
|
# НО в первом Play мы принудительно используем localhost.
|
||||||
|
become: true
|
||||||
|
tasks:
|
||||||
|
- name: Install base packages
|
||||||
|
apt:
|
||||||
|
name: [curl, apt-transport-https]
|
||||||
|
state: present
|
||||||
Reference in New Issue
Block a user