# cat check_env.sh
#!/bin/bash
#
echo "=== 检查CPU ==="
ansible all -m shell -a "cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c"
echo "=== 检查内存 ==="
ansible all -m shell -a "free -h | tail -2 | head -1"
echo "=== 检查磁盘 ==="
ansible all -m shell -a "lsblk |grep disk |wc -l"
echo "=== 检查OS版本 ==="
ansible all -a 'lsb_release -d'
echo "=== 检查内核版本 ==="
ansible all -a 'uname -r'
echo "=== 检查docker版本 ==="
ansible all -a 'docker -v'
echo "=== 检查ceph版本 ==="
ansible all -a 'ceph -v'
echo "=== 检查时间 ==="
ansible all -a date
echo "=== 检查python3版本 ==="
ansible all -a 'python3 -V'
# end
标签:脚本,shell,检查,echo,ansible,版本,OS From: https://www.cnblogs.com/varden/p/17217210.html