Update Device Types feature in Init script

This commit is contained in:
Christer Warén
2025-12-07 17:19:58 +02:00
parent a710bfa4b2
commit b544f7af1e
2 changed files with 12 additions and 6 deletions

View File

@@ -30,9 +30,12 @@ wx-init(){
if [[ ! -z ${args['device-type']} ]]
then
if [[ ${args['device-type']} == "server" || ${args['device-type']} == "workstation" ]]
if [[ ${args['device-type']} == "server" ]]
then
DEVICE_TYPE="${args['device-type']}"
DEVICE_TYPE="Server"
elif [[ ${args['device-type']} == "workstation" ]]
then
DEVICE_TYPE="Workstation"
else
wxi-content status "Device Type" "Invalid"
wxi-stop
@@ -66,7 +69,7 @@ wx-init(){
echo "---" > ~/.ansible/vars.yml
echo "hostname: $HOSTNAME" >> ~/.ansible/vars.yml
echo "info:" >> ~/.ansible/vars.yml
echo " type: $TYPE" >> ~/.ansible/vars.yml
echo " type: $DEVICE_TYPE" >> ~/.ansible/vars.yml
echo "config:" >> ~/.ansible/vars.yml
echo " identity:" >> ~/.ansible/vars.yml
echo " vault:" >> ~/.ansible/vars.yml

View File

@@ -15,9 +15,12 @@ wx-init(){
if [[ ! -z ${args['device-type']} ]]
then
if [[ ${args['device-type']} == "server" || ${args['device-type']} == "workstation" ]]
if [[ ${args['device-type']} == "server" ]]
then
DEVICE_TYPE="${args['device-type']}"
DEVICE_TYPE="Server"
elif [[ ${args['device-type']} == "workstation" ]]
then
DEVICE_TYPE="Workstation"
else
wxi-content status "Device Type" "Invalid"
wxi-stop
@@ -51,7 +54,7 @@ wx-init(){
echo "---" > ~/.ansible/vars.yml
echo "hostname: $HOSTNAME" >> ~/.ansible/vars.yml
echo "info:" >> ~/.ansible/vars.yml
echo " type: $TYPE" >> ~/.ansible/vars.yml
echo " type: $DEVICE_TYPE" >> ~/.ansible/vars.yml
echo "config:" >> ~/.ansible/vars.yml
echo " identity:" >> ~/.ansible/vars.yml
echo " vault:" >> ~/.ansible/vars.yml