From c84e0ee9bec940a4aef33a5d3cc1bb7b49266959 Mon Sep 17 00:00:00 2001 From: devops Date: Wed, 16 Sep 2026 13:32:16 +0000 Subject: [PATCH] fix: inventory me staging+production groups, deploy.yml target variable --- deploy/deploy.yml | 2 +- deploy/inventory.ini | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/deploy/deploy.yml b/deploy/deploy.yml index cef8ee8..b49a8a4 100644 --- a/deploy/deploy.yml +++ b/deploy/deploy.yml @@ -1,7 +1,7 @@ --- # App ko VM par deploy karo. Idempotent hai - baar baar chalao, wahi nateeja. - name: Deploy demo-app to VM - hosts: app + hosts: "{{ target | default('production') }}" gather_facts: true vars: diff --git a/deploy/inventory.ini b/deploy/inventory.ini index 55a50cb..f12534b 100644 --- a/deploy/inventory.ini +++ b/deploy/inventory.ini @@ -1,7 +1,10 @@ -[app] +[staging] +staging-vm-01 ansible_host=192.168.124.167 + +[production] app-vm-01 ansible_host=192.168.124.136 -[app:vars] +[all:vars] ansible_user=deploy ansible_ssh_private_key_file=/var/jenkins_secrets/deploy_key ansible_ssh_common_args=-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null