• 六、saltstack的module组件


    Module是saltstack日常使用中用的最多的一个组件。用于管理操作对象。

    查看系统module:

    [root@super65 ~]# salt 'super66' sys.list_modules
    super66:
    - acl
    - aliases
    - alternatives
    - apache

    .........

    查看module的function:

    [root@super65 ~]# salt 'super66' sys.list_functions cmd
    super66:
    - cmd.exec_code
    - cmd.exec_code_all
    - cmd.has_exec
    - cmd.retcode
    - cmd.run
    ..........

    查看function的用法:

    [root@super65 ~]# salt 'super66' sys.doc cmd

    [root@super65 ~]# salt 'super66' sys.doc cmd.run

    使用cmd.run远程执行命令:

    [root@super65 ~]# salt 'super66' cmd.run "ifconfig eth0"
    super66:
        eth0 Link encap:Ethernet HWaddr 00:0C:29:3E:34:32
        inet addr:192.168.1.66 Bcast:192.168.1.255 Mask:255.255.255.0
        inet6 addr: fe80::20c:29ff:fe3e:3432/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        RX packets:26347 errors:0 dropped:0 overruns:0 frame:0
        TX packets:11997 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:29597859 (28.2 MiB) TX bytes:1138554 (1.0 MiB)

  • 相关阅读:
    HTTP协议入门
    TCP/IP的分层管理
    TCP与UDP
    如何处理某个Web页面的HTTP请求
    AGC005D ~K Perm Counting
    “玲珑杯” 线上赛Round #17 B 震惊,99%+的中国人都会算错的问题
    bzoj4455 [Zjoi2016]小星星
    AGC010F Tree Game
    AGC016E Poor Turkeys
    AGC003E Sequential operations on Sequence
  • 原文地址:https://www.cnblogs.com/fanxuanhui-linux/p/5878107.html
Copyright © 2020-2023  润新知