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

  • 相关阅读:
    FOJ2250 不可能弹幕结界
    寻找最大值
    Haybale Guessing
    MG loves string
    Curious Cupid
    Anton and Permutation
    TLE
    Jzzhu and Numbers
    Divisible Group Sums
    The merchant
  • 原文地址:https://www.cnblogs.com/leoshi/p/13666712.html
Copyright © 2011-2022 走看看