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