[root@saltmaster file]#cd /srv/salt/file
[root@saltmaster file]# cat top.sls
base:
'saltclient':
- installim.installim
[root@saltmaster file]# cd installim/
[root@saltmaster installim]# ls
installim.sh installim.sls
[root@saltmaster installim]# cat installim.sls
installim:
cmd.script:
- source: salt://installim/installim.sh
- user: root
- shell: /bin/bash
[root@saltmaster installim]# cat installim.sh
#!/bin/sh
#####
IM_nfs_root=/opt/software/IM
IM_software_root=/home/software/IM
if [ ! -d "$IM_software_root" ];then
echo "Please check nfs server if IM_software_root exits."
fi
cd $IM_software_root
unzip $IM_nfs_root/agent.installer.linux.gtk.x86_64_1.6.3001.20130528_1750.zip -d $IM_software_root
#if [ $? -eq 0 ];then
echo "unzip IBM Install Manager successfully."
cd $IM_software_root
./installc -acceptLicense -log /WebSphere/installLog/IMinstall.log -installationDirectory /WebSphere/IM -silent
echo "install IBM Install Manager successfully."
执行命令远程挂载nfs
[root@saltmaster installim]#mount 192.168.1.104:/opt/software /opt/software
[root@saltmaster installim]# salt 'saltclient' state.sls installim.installim
阅读(1342) | 评论(0) | 转发(0) |