Change hostname to host parameter in Infra command

This commit is contained in:
Christer Warén
2026-01-06 07:46:25 +02:00
parent c9008a981b
commit c479044caf
2 changed files with 16 additions and 16 deletions

View File

@@ -54,7 +54,7 @@ wx-infra(){
then
wxi-header "Init" h3
hostname=${args['hostname']}
host=${args['host']}
if [[ -z ${args['3']} ]]
then
@@ -63,24 +63,24 @@ wx-infra(){
tags=${args['3']}
fi
ansible-playbook $INFRA_VAULT init.yml --tags $tags --limit "$hostname"
ansible-playbook $INFRA_VAULT init.yml --tags $tags --limit "$host"
elif [[ ${args['2']} == "manager" ]]
then
if [[ -z ${args['hostname']} ]]
if [[ -z ${args['host']} ]]
then
hostname="any"
host="any"
else
hostname=${args['hostname']}
host=${args['host']}
fi
operation=${args['operation']}
wxi-header "Manager" h3
ansible-playbook $INFRA_VAULT manager.yml --tags $operation --extra-vars "host=$hostname operation=$operation"
ansible-playbook $INFRA_VAULT manager.yml --tags $operation --extra-vars "host=$host operation=$operation"
else
wxi-header "Infra" h3
hostname=${args['hostname']}
host=${args['host']}
tags=${args['2']}
ansible-playbook $INFRA_VAULT infra.yml --tags $tags --limit "$hostname"
ansible-playbook $INFRA_VAULT infra.yml --tags $tags --limit "$host"
fi
cd "$OLDPWD"
fi

16
wx
View File

@@ -326,7 +326,7 @@ wx-infra(){
then
wxi-header "Init" h3
hostname=${args['hostname']}
host=${args['host']}
if [[ -z ${args['3']} ]]
then
@@ -335,24 +335,24 @@ wx-infra(){
tags=${args['3']}
fi
ansible-playbook $INFRA_VAULT init.yml --tags $tags --limit "$hostname"
ansible-playbook $INFRA_VAULT init.yml --tags $tags --limit "$host"
elif [[ ${args['2']} == "manager" ]]
then
if [[ -z ${args['hostname']} ]]
if [[ -z ${args['host']} ]]
then
hostname="any"
host="any"
else
hostname=${args['hostname']}
host=${args['host']}
fi
operation=${args['operation']}
wxi-header "Manager" h3
ansible-playbook $INFRA_VAULT manager.yml --tags $operation --extra-vars "host=$hostname operation=$operation"
ansible-playbook $INFRA_VAULT manager.yml --tags $operation --extra-vars "host=$host operation=$operation"
else
wxi-header "Infra" h3
hostname=${args['hostname']}
host=${args['host']}
tags=${args['2']}
ansible-playbook $INFRA_VAULT infra.yml --tags $tags --limit "$hostname"
ansible-playbook $INFRA_VAULT infra.yml --tags $tags --limit "$host"
fi
cd "$OLDPWD"
fi