From 132813c4beefa872febe88c91542e0de08bb226d Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Tue, 4 Jul 2017 21:31:19 -0500 Subject: [PATCH] use case for os.localvars --- runansible | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/runansible b/runansible index 26bc0d35b..e4e62f68d 100755 --- a/runansible +++ b/runansible @@ -8,13 +8,32 @@ fi # if vars/local_vars.yml is missing, put a default one in place if [ ! -f ./vars/local_vars.yml ]; then - OS=`grep ^ID= /etc/*release|cut -d= -f2` - OS=${OS//\"/} - if [ "$OS" = "centos" ]; then - cp ./vars/centos.localvars ./vars/local_vars.yml - else - cp ./vars/debian.localvars ./vars/local_vars.yml - fi + OS=`grep ^ID= /etc/*release|cut -d= -f2` + OS=${OS//\"/} + + case $OS in + OLPC) + cp ./vars/olpc.localvars ./vars/local_vars.yml + fedora) + cp ./vars/olpc.localvars ./vars/local_vars.yml + ;; + centos) + cp ./vars/centos.localvars ./vars/local_vars.yml + ;; + debian) + cp ./vars/debian.localvars ./vars/local_vars.yml + ;; + ubuntu) + cp ./vars/debian.localvars ./vars/local_vars.yml + ;; + raspbian) + cp ./vars/debian.localvars ./vars/local_vars.yml + ;; + *) + echo "Unknown OS -- no matching os.localvars -- exiting now..." + exit 0 + ;; + esac fi if [ -f /etc/iiab/iiab.env ] @@ -27,7 +46,7 @@ fi if [ ! -f iiab.yml ] then - echo "XSCE Playbook not found." + echo "IIAB Playbook not found." echo "Please run this command from the top level of the git repo." echo "Exiting." exit