SWITCH: 从 Ansible 切换到 Terraform 管理 Nomad 配置
Some checks failed
Some checks failed
- 创建 nomad-config Terraform 模块 - 声明式管理 Nomad 节点配置 - 更新 GitOps 工作流使用 Terraform - 避免配置漂移,确保主客观统一 - 目标: 通过 IaC 修复 5个异常节点
This commit is contained in:
@@ -21,11 +21,17 @@ jobs:
|
||||
sudo apt update
|
||||
sudo apt install -y ansible
|
||||
|
||||
- name: Deploy Nomad Configurations
|
||||
- name: Setup Terraform
|
||||
uses: hashicorp/setup-terraform@v3
|
||||
with:
|
||||
terraform_version: "1.5.0"
|
||||
|
||||
- name: Deploy Nomad Configurations with Terraform
|
||||
run: |
|
||||
echo "修复 Nomad 节点配置..."
|
||||
cd ansible
|
||||
ansible-playbook -i inventory/hosts.yml fix-nomad-nodes.yml --limit "ch4,hcp1,warden,ash1d" -v
|
||||
echo "使用 Terraform 管理 Nomad 配置..."
|
||||
terraform init
|
||||
terraform plan -out=tfplan
|
||||
terraform apply -auto-approve tfplan
|
||||
|
||||
- name: Verify Deployment
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user