ansible shell模块


[root@ftp:/root]
> ansible ansible01  -u root -k -m shell -a 'hostname'
SSH password: 
ansible01 | CHANGED | rc=0 >>
ansible01

 

[root@ftp:/root]
> ansible ansible01  -u root -k -m shell -a 'uptime'
SSH password: 
ansible01 | CHANGED | rc=0 >>
 16:11:53 up  2:49,  2 users,  load average: 0.00, 0.01, 0.05

 

[root@ftp:/root]
> ansible ansible01  -u root -k -m shell -a 'free -m'
SSH password: 
ansible01 | CHANGED | rc=0 >>
              total        used        free      shared  buff/cache   available
Mem:           1839         119        1259           8         460        1525
Swap:          1023           0        1023

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM