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

16
wx
View File

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