使用ansible安装storcli工具

根据服务器和raid卡型号的不同,选择不同的在线radi工具。本例选用storcli,使用华为,浪潮等多款服务器。

1、被管节点创建文件夹

[root@localhost Desktop]# ansible 192.168.122.152 -m shell -a 'mkdir /tmp/ops' -f 500
 [WARNING]: Consider using file module with state=directory rather than running
mkdir


192.168.122.152 | SUCCESS | rc=0 >>


2、向被管节点下发工具
[root@localhost Desktop]# ansible 192.168.122.152 -m copy -a 'src=storcli-007.0116.0000.0000-1.noarch.rpm dest=/tmp/ops/storcli.rpm owner=root group=root mode=755 backup=yes' -o
192.168.122.152 | SUCCESS => {"changed": true, "checksum": "1696430764e3bfd61ba3383d605ef0a8a469ee4e", "dest": "/tmp/ops/storcli.rpm", "failed": false, "gid": 0, "group": "root", "md5sum": "4009127e744188f5bd2408a0e296e314", "mode": "0755", "owner": "root", "secontext": "unconfined_u:object_r:admin_home_t:s0", "size": 5456408, "src": "/root/.ansible/tmp/ansible-tmp-1516330465.85-6246165567391/source", "state": "file", "uid": 0}

已经在被管节点识别到了;


3、安装storcli的rpm包;


[root@localhost Desktop]# ansible 192.168.122.152 -m shell -a 'cd /tmp/ops && rpm -ivh storcli.rpm ' -f 500
192.168.122.152 | SUCCESS | rc=0 >>
Preparing...                ##################################################
storcli                     ##################################################


[root@localhost Desktop]# ansible 192.168.122.152 -m shell -a 'ln -s /opt/MegaRAID/storcli/storcli64 /usr/bin/storcli ' -f 500
 [WARNING]: Consider using file module with state=link rather than running ln


192.168.122.152 | SUCCESS | rc=0 >>
4、剩下的,就是愉快的给服务器在线做raid啦!

猜你喜欢

转载自blog.csdn.net/zsx0728/article/details/79105009