summaryrefslogtreecommitdiffstats
path: root/setup.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-03-07 07:03:57 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-03-07 07:03:57 +0100
commit6bc3a3ac71e11fb6459df715536fec373c123a97 (patch)
treec99a4507012fd853ffa2622e35fa26f3bd3804e3 /setup.sh
parent69adb23c59e991ddcabf5cfce415fd8b638dbc1a (diff)
downloadands-6bc3a3ac71e11fb6459df715536fec373c123a97.tar.gz
ands-6bc3a3ac71e11fb6459df715536fec373c123a97.tar.bz2
ands-6bc3a3ac71e11fb6459df715536fec373c123a97.tar.xz
ands-6bc3a3ac71e11fb6459df715536fec373c123a97.zip
Streamlined networking, OpenShift recovery, Ganesha
Diffstat (limited to 'setup.sh')
-rwxr-xr-xsetup.sh100
1 files changed, 59 insertions, 41 deletions
diff --git a/setup.sh b/setup.sh
index 83b8a52..1c38536 100755
--- a/setup.sh
+++ b/setup.sh
@@ -2,88 +2,106 @@
. opts.sh
+action=$1
+shift
-case "${1}" in
+case "$action" in
all)
- ./setup.sh -i $inventory prepare || exit 1
- ./setup.sh -i $inventory openshift || exit 1
- ./setup.sh -i $inventory gluster || exit 1
- ./setup.sh -i $inventory configure || exit 1
- ./setup.sh -i $inventory projects || exit 1
+ ./setup.sh -i $inventory prepare "$@" || exit 1
+ ./setup.sh -i $inventory openshift "$@" || exit 1
+ ./setup.sh -i $inventory gluster "$@" || exit 1
+ ./setup.sh -i $inventory configure "$@" || exit 1
+ ./setup.sh -i $inventory projects "$@" || exit 1
;;
local)
- apply playbooks/local.yml || exit 1
+ apply playbooks/local.yml "$@" || exit 1
;;
vm)
- apply playbooks/ands-vm-setup.yml || exit 1
- ;;
- vmconf)
- apply playbooks/ands-vm-conf.yml || exit 1
+ apply playbooks/ands-vm-setup.yml "$@" || exit 1
;;
prepare)
- apply playbooks/ands-prepare.yml || exit 1
+ apply playbooks/ands-prepare.yml "$@" || exit 1
;;
openshift)
- apply playbooks/openshift-install.yml || exit 1
+ apply playbooks/openshift-install.yml "$@" || exit 1
;;
gluster)
- apply playbooks/ands-gluster.yml || exit 1
+ apply playbooks/ands-gluster.yml "$@" || exit 1
+ ;;
+ migrate)
+ from=$1
+ to=$2
+ [ -z "$from" -o -z "$to" ] && { usage "you must specify source and destination ip addresses" ; exit 1 ; }
+ shift 2
+ apply playbooks/ands-gluster-migrate.yml --extra-vars "gfs_from=$from gfs_to=$to" "$@" || exit 1
+# echo "Currently unsupported, use scripts..."
+ ;;
+ ganesha)
+ apply playbooks/ands-gluster-ganesha.yml "$@" || exit 1
;;
configure)
- apply playbooks/openshift-setup.yml || exit 1
+ apply playbooks/openshift-setup.yml "$@" || exit 1
;;
projects)
- apply playbooks/openshift-setup-projects.yml || exit 1
+ apply playbooks/openshift-setup-projects.yml "$@" || exit 1
;;
project)
project=$2
shift
- [ -z "$project" ] && { echo 'project name should be specified...' ; exit 1; }
- apply playbooks/openshift-setup-project.yml --extra-vars "ands_configure_project=$project" || exit 1
+ [ -n "$project" ] || { usage 'project name should be specified...' ; exit 1; }
+ apply playbooks/openshift-setup-project.yml --extra-vars "ands_configure_project=$project" "$@" || exit 1
+ ;;
+ openshift-masters)
+ apply playbooks/openshift-add-masters.yml "$@" || exit 1
;;
openshift-nodes)
- apply playbooks/openshift-add-nodes.yml || exit 1
+ apply playbooks/openshift-add-nodes.yml "$@" || exit 1
;;
- nodes)
- ./setup.sh -i $inventory prepare || exit 1
- ./setup.sh -i $inventory openshift-nodes || exit 1
- ./setup.sh -i $inventory gluster || exit 1
- ./setup.sh -i $inventory configure || exit 1
+ openshift-etcd)
+ apply playbooks/openshift-add-etcd.yml "$@" || exit 1
;;
- openshift-masters)
- apply playbooks/openshift-add-masters.yml || exit 1
+ openshift-gluster)
+ apply playbooks/openshift-add-gluster.yml "$@" || exit 1
;;
masters)
- ./setup.sh -i $inventory prepare || exit 1
- ./setup.sh -i $inventory openshift-masters || exit 1
- ./setup.sh -i $inventory gluster || exit 1
- ./setup.sh -i $inventory configure || exit 1
+ ./setup.sh -i $inventory prepare "$@" || exit 1
+ ./setup.sh -i $inventory openshift-masters "$@" || exit 1
+ ./setup.sh -i $inventory gluster "$@" || exit 1
+ ./setup.sh -i $inventory configure "$@" || exit 1
+ ;;
+ nodes)
+ ./setup.sh -i $inventory prepare "$@" || exit 1
+ ./setup.sh -i $inventory openshift-nodes "$@" || exit 1
+ ./setup.sh -i $inventory gluster "$@" || exit 1
+ ./setup.sh -i $inventory configure "$@" || exit 1
;;
users)
- apply playbooks/openshift-setup-users.yml || exit 1
+ apply playbooks/openshift-setup-users.yml "$@" || exit 1
;;
security)
- apply playbooks/openshift-setup-security.yml || exit 1
+ apply playbooks/openshift-setup-security.yml "$@" || exit 1
;;
storage)
- apply playbooks/openshift-setup-storage.yml || exit 1
+ apply playbooks/openshift-setup-storage.yml "$@" || exit 1
;;
vpn)
- apply playbooks/openshift-setup-vpn.yml || exit 1
+ apply playbooks/openshift-setup-vpn.yml "$@" || exit 1
;;
certs)
- apply playbooks/openshift-redeploy-certificates.yml --extra-vars "openshift_certificates_redeploy_ca=true" || exit 1
+ apply playbooks/openshift-redeploy-certificates.yml --extra-vars "openshift_certificates_redeploy_ca=true" "$@" || exit 1
;;
upgrade)
- apply playbooks/openshift-upgrade.yml || exit 1
+ apply playbooks/openshift-upgrade.yml "$@" || exit 1
;;
- check)
- apply playbooks/maintain.yml || exit
+ maintain)
+ apply playbooks/maintain.yml "$@" || exit
;;
setup)
- [ -n "$2" ] || usage "Specify that to setup"
- apply ands_openshift -e "subrole=$2"
+ subrole=$2
+ shift
+ [ -n "$subrole" ] || { usage "Specify that to setup"; exit 1; }
+ apply ands_openshift -e "subrole=$subrole" "$@"
;;
*)
- apply $@ || exit 1
+ apply $action "$@" || exit 1
esac