summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README2
-rwxr-xr-xipmi.sh28
2 files changed, 27 insertions, 3 deletions
diff --git a/README b/README
index c57bade..1d6651b 100644
--- a/README
+++ b/README
@@ -9,7 +9,7 @@ Actions
User: guest
Password: anything
Domain: ipe.kit.edu
- => On Ipepdvcompute2
+ => On Ipepdvcompute2 (reset of IPMI may be required in case of error 255: ipmitool mc reset cold)
Host (NFS): 192.168.26.172
Path: /virtual/images/
Image Name (On the previous screen): centos8-ands.iso
diff --git a/ipmi.sh b/ipmi.sh
index 4b00165..06fdd29 100755
--- a/ipmi.sh
+++ b/ipmi.sh
@@ -12,7 +12,27 @@ function configure {
(
cd $itm || { echo "ITM (Ansible scripts) are not found"; exit 1; }
# ansible-playbook -i inventories/ipe.erb -l localhost,$hosts ssh.yml
- ansible-playbook -i inventories/ipe.erb -l $hosts $play "$@"
+ ansible-playbook --vault-password-file=.vault-pass -i inventories/ipe.erb -l $hosts $play "$@"
+ )
+}
+
+function update {
+ hosts=$1
+ shift
+
+ (
+ cd $itm || { echo "ITM (Ansible scripts) are not found"; exit 1; }
+ ansible-playbook --vault-password-file=.vault-pass -i inventories/ipe.erb -l $hosts "update.yml" "$@"
+ )
+}
+
+function run {
+ hosts=$1
+ shift
+
+ (
+ cd $itm || { echo "ITM (Ansible scripts) are not found"; exit 1; }
+ ansible all -b -u root --vault-password-file=.vault-pass -i inventories/ipe.erb -l $hosts -a "'$@'"
)
}
@@ -167,6 +187,10 @@ elif [[ "$1" =~ wait ]]; then
action="wait_off"
elif [[ "$1" =~ config ]]; then
action="configure"
+elif [[ "$1" =~ update ]]; then
+ action="update"
+elif [[ "$1" =~ run ]]; then
+ action="run"
else
shift=0
action="cmd"
@@ -177,7 +201,7 @@ if [ $shift -eq 1 ]; then
fi
-if [ $action = "configure" ]; then
+if [ $action = "configure" -o $action = "update" -o $action = "run" ]; then
list=$(echo $hip | sed -re 's/\s+/ /g' | tr ' ' ',')
eval "$action" "$list" "$@"
exit