From 87608f9bfb8743564f4e6898c72868f7a00a14b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sat, 4 Jan 2025 06:19:35 +0200 Subject: [PATCH] Code Update --- src/commands/infra.sh | 18 ++++++++++++------ wx | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/commands/infra.sh b/src/commands/infra.sh index 2b1fd27..2beb3ea 100644 --- a/src/commands/infra.sh +++ b/src/commands/infra.sh @@ -44,13 +44,19 @@ wx-infra(){ then if [[ -z $2 ]] then - echo "Tag Required" - else - cd "$INFRA_PATH" - git pull &> /dev/null - ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw playbooks/init.yml -t $2 $3 $4 $5 $6 $7 $8 $9 - cd "$OLDPWD" + 2=init fi + + cd "$INFRA_PATH" + git pull &> /dev/null + ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw playbooks/init.yml -t $2 $3 $4 $5 $6 $7 $8 $9 + cd "$OLDPWD" + else if [[ $1 == "manager" ]] + then + cd "$INFRA_PATH" + git pull &> /dev/null + ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw manager.yml $2 $3 $4 $5 $6 $7 $8 $9 + cd "$OLDPWD" else cd "$INFRA_PATH" git pull &> /dev/null diff --git a/wx b/wx index 6775ddf..0c01594 100755 --- a/wx +++ b/wx @@ -177,13 +177,19 @@ wx-infra(){ then if [[ -z $2 ]] then - echo "Tag Required" - else - cd "$INFRA_PATH" - git pull &> /dev/null - ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw playbooks/init.yml -t $2 $3 $4 $5 $6 $7 $8 $9 - cd "$OLDPWD" + 2=init fi + + cd "$INFRA_PATH" + git pull &> /dev/null + ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw playbooks/init.yml -t $2 $3 $4 $5 $6 $7 $8 $9 + cd "$OLDPWD" + else if [[ $1 == "manager" ]] + then + cd "$INFRA_PATH" + git pull &> /dev/null + ansible-playbook --vault-id warengroup@vault/warengroup --vault-id cwchristerw@vault/cwchristerw manager.yml $2 $3 $4 $5 $6 $7 $8 $9 + cd "$OLDPWD" else cd "$INFRA_PATH" git pull &> /dev/null