zoukankan      html  css  js  c++  java
  • Saltstack module hosts 详解

    hosts.has_pair

    Return true if the alias is set
    
    CLI Example:
    
        salt '*' hosts.has_pair <ip> <alias>
    

    hosts.get_ip

    Return the ip associated with the named host
    
    CLI Example:
    
        salt '*' hosts.get_ip <hostname>
    

    hosts.get_alias

    Return the list of aliases associated with an ip
    
    Aliases (host names) are returned in the order in which they
    appear in the hosts file.  If there are no aliases associated with
    the IP, an empty list is returned.
    
    CLI Example:
    
        salt '*' hosts.get_alias <ip addr>
    

    hosts.list_hosts

    Return the hosts found in the hosts file in this format::
    
        {'<ip addr>': ['alias1', 'alias2', ...]}
    
    CLI Example:
    
        salt '*' hosts.list_hosts
    

    hosts.add_host

    Add a host to an existing entry, if the entry is not in place then create
    it with the given host
    
    CLI Example:
    
        salt '*' hosts.add_host <ip> <alias>
    

    hosts.rm_host

    Remove a host entry from the hosts file
    
    CLI Example:
    
        salt '*' hosts.rm_host <ip> <alias>
    

    hosts.set_host

    Set the host entry in the hosts file for the given ip, this will overwrite
    any previous entry for the given ip
    
    Changed in version 2016.3.0
        If ``alias`` does not include any host names (it is the empty
        string or contains only whitespace), all entries for the given
        IP address are removed.
    
    CLI Example:
    
        salt '*' hosts.set_host <ip> <alias>
  • 相关阅读:
    JS实现在线ps功能
    Vmware 下安装linux虚拟机
    一文了解:Redis主从复制
    一文了解:Redis过期键删除策略
    一文了解:Redis的AOF持久化
    一文了解:Redis的RDB持久化
    一文了解:Redis事务
    一文了解:Redis基础类型
    并发一:Java内存模型和Volatile
    干了这杯java之ThreadLocal
  • 原文地址:https://www.cnblogs.com/randomlee/p/Saltstack_module_hosts.html
Copyright © 2011-2022 走看看