diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2019-10-11 06:29:58 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2019-10-11 06:29:58 +0200 |
commit | aefa08242ad41edc3ebfb7fb532dc65bcdd284d0 (patch) | |
tree | 7f506f90d70597b4398dd78927d75ca59009ff53 /ipmi.sh | |
parent | 162bef18b394caa2053aeb97157333d03d279ddd (diff) | |
download | ipmiboot-aefa08242ad41edc3ebfb7fb532dc65bcdd284d0.tar.gz ipmiboot-aefa08242ad41edc3ebfb7fb532dc65bcdd284d0.tar.bz2 ipmiboot-aefa08242ad41edc3ebfb7fb532dc65bcdd284d0.tar.xz ipmiboot-aefa08242ad41edc3ebfb7fb532dc65bcdd284d0.zip |
Update and run commands
Diffstat (limited to 'ipmi.sh')
-rwxr-xr-x | ipmi.sh | 28 |
1 files changed, 26 insertions, 2 deletions
@@ -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 |