zoukankan      html  css  js  c++  java
  • [Ansible]command shell模块

    • 默认是command模块
    • shell模块
      • 可以使用shell内置命令 管道
    [root@ceph1 ~]# ansible all -a "echo 'hello'"
    ceph3 | CHANGED | rc=0 >>
    hello
    ceph2 | CHANGED | rc=0 >>
    hello
    
    [root@ceph1 ~]# ansible all -m shell -a "ps -aux | grep 5000"
    ceph3 | CHANGED | rc=0 >>
    root         538  0.0  0.0  45000  1856 ?        Ss   9月11   0:00 /usr/lib/systemd/systemd-udevd
    root       22712  0.0  0.0 113280  1204 pts/0    S+   11:44   0:00 /bin/sh -c ps -aux | grep 5000
    root       22714  0.0  0.0 112828   960 pts/0    S+   11:44   0:00 grep 5000
    ceph2 | CHANGED | rc=0 >>
    root         542  0.0  0.0  45000  1860 ?        Ss   9月11   0:00 /usr/lib/systemd/systemd-udevd
    root       24971  0.0  0.0 113280  1204 pts/0    S+   11:44   0:00 /bin/sh -c ps -aux | grep 5000
    root       24973  0.0  0.0 112828   956 pts/0    S+   11:44   0:00 grep 5000
    

    END

  • 相关阅读:
    MMA7660
    使用外设需要做的事情
    BH1750
    English
    2016年学习计划
    博客园
    TIM
    USART
    swift与oc的混合编程
    SVN工具如何创建分支和合并分支的
  • 原文地址:https://www.cnblogs.com/leoshi/p/13666712.html
Copyright © 2011-2022 走看看