Use new arguments and fix Init playbook location in Infra command
This commit is contained in:
@@ -54,6 +54,8 @@ wx-infra(){
|
||||
then
|
||||
wxi-header "Init" h3
|
||||
|
||||
hostname=${args['hostname']}
|
||||
|
||||
if [[ -z ${args['3']} ]]
|
||||
then
|
||||
tags=init
|
||||
@@ -61,15 +63,24 @@ wx-infra(){
|
||||
tags=${args['3']}
|
||||
fi
|
||||
|
||||
ansible-playbook $INFRA_VAULT playbooks/init.yml -t $tags --limit "${args['limit']}"
|
||||
ansible-playbook $INFRA_VAULT init.yml --tags $tags --limit "$hostname"
|
||||
elif [[ ${args['2']} == "manager" ]]
|
||||
then
|
||||
if [[ -z ${args['hostname']} ]]
|
||||
then
|
||||
hostname="any"
|
||||
else
|
||||
hostname=${args['hostname']}
|
||||
fi
|
||||
operation=${args['operation']}
|
||||
|
||||
wxi-header "Manager" h3
|
||||
ansible-playbook $INFRA_VAULT manager.yml --extra-vars "${args['extra-vars']}"
|
||||
ansible-playbook $INFRA_VAULT manager.yml --tags $operation --extra-vars "host=$hostname operation=$operation"
|
||||
else
|
||||
wxi-header "Playbooks" h3
|
||||
hostname=${args['hostname']}
|
||||
tags=${args['2']}
|
||||
ansible-playbook $INFRA_VAULT playbooks.yml -t $tags --limit "${args['limit']}"
|
||||
ansible-playbook $INFRA_VAULT playbooks.yml --tags $tags --limit "$hostname"
|
||||
fi
|
||||
cd "$OLDPWD"
|
||||
fi
|
||||
|
||||
17
wx
17
wx
@@ -326,6 +326,8 @@ wx-infra(){
|
||||
then
|
||||
wxi-header "Init" h3
|
||||
|
||||
hostname=${args['hostname']}
|
||||
|
||||
if [[ -z ${args['3']} ]]
|
||||
then
|
||||
tags=init
|
||||
@@ -333,15 +335,24 @@ wx-infra(){
|
||||
tags=${args['3']}
|
||||
fi
|
||||
|
||||
ansible-playbook $INFRA_VAULT playbooks/init.yml -t $tags --limit "${args['limit']}"
|
||||
ansible-playbook $INFRA_VAULT init.yml --tags $tags --limit "$hostname"
|
||||
elif [[ ${args['2']} == "manager" ]]
|
||||
then
|
||||
if [[ -z ${args['hostname']} ]]
|
||||
then
|
||||
hostname="any"
|
||||
else
|
||||
hostname=${args['hostname']}
|
||||
fi
|
||||
operation=${args['operation']}
|
||||
|
||||
wxi-header "Manager" h3
|
||||
ansible-playbook $INFRA_VAULT manager.yml --extra-vars "${args['extra-vars']}"
|
||||
ansible-playbook $INFRA_VAULT manager.yml --tags $operation --extra-vars "host=$hostname operation=$operation"
|
||||
else
|
||||
wxi-header "Playbooks" h3
|
||||
hostname=${args['hostname']}
|
||||
tags=${args['2']}
|
||||
ansible-playbook $INFRA_VAULT playbooks.yml -t $tags --limit "${args['limit']}"
|
||||
ansible-playbook $INFRA_VAULT playbooks.yml --tags $tags --limit "$hostname"
|
||||
fi
|
||||
cd "$OLDPWD"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user