zoukankan      html  css  js  c++  java
  • SaltStack管理从这里开始

    Modules
    1:查看所有module列表:
    salt 'jcfx-4' sys.list_modules

    jcfx-4:
    - acl
    - aliases
    - alternatives
    - apache
    - archive
    - artifactory
    - at
    - beacons
    - bigip
    - blockdev
    - bridge
    - btrfs

    2:查看指定module的所有function
    salt 'jcfx-4' sys.list_functions cp

    jcfx-4:
    - cp.cache_dir
    - cp.cache_file
    - cp.cache_files
    - cp.cache_local_file
    - cp.cache_master
    - cp.get_dir
    - cp.get_file
    - cp.get_file_str
    - cp.get_template
    - cp.get_url
    - cp.hash_file
    - cp.is_cached
    - cp.list_master
    - cp.list_master_dirs
    - cp.list_master_symlinks
    - cp.list_minion
    - cp.list_states
    - cp.push
    - cp.push_dir
    - cp.recv

    3:查看指定module用法:
    salt 'jcfx-4' sys.doc cp.get_file

    cp.get_file:

    Used to get a single file from the salt master

    CLI Example:

    salt '*' cp.get_file salt://path/to/file /minion/dest

    Template rendering can be enabled on both the source and destination file
    names like so:

    salt '*' cp.get_file "salt://{{grains.os}}/vimrc" /etc/vimrc template=jinja

    This example would instruct all Salt minions to download the vimrc from a
    directory with the same name as their os grain and copy it to /etc/vimrc

    For larger files, the cp.get_file module also supports gzip compression.
    Because gzip is CPU-intensive, this should only be used in scenarios where
    the compression ratio is very high (e.g. pretty-printed JSON or YAML
    files).

    Use the *gzip* named argument to enable it. Valid values are 1..9, where 1
    is the lightest compression and 9 the heaviest. 1 uses the least CPU on
    the master (and minion), 9 uses the most.

    States
    1:查看所有states列表:
    salt 'jcfx-4' sys.list_state_modules

    jcfx-4:
    - acl
    - alias
    - alternatives
    - apache
    - archive
    - artifactory
    - at
    - beacon
    - blockdev
    - buildout
    - cloud
    - cmd
    - composer
    - cron

    2:查看指定states的所有function
    salt 'jcfx-4' sys.list_state_functions file

    jcfx-4:
    - file.absent
    - file.accumulated
    - file.append
    - file.blockreplace
    - file.comment
    - file.copy
    - file.directory
    - file.exists
    - file.line
    - file.managed
    - file.missing
    - file.mknod
    - file.mod_run_check_cmd
    - file.patch
    - file.prepend
    - file.recurse
    - file.rename
    - file.replace
    - file.serialize
    - file.symlink
    - file.touch
    - file.uncomment

    3:查看指定states用法:
    salt 'jcfx-4' sys.state_doc file
    输出略;
    4:查看states指定function用法:
    salt 'jcfx-4' sys.state_doc file.managed
    输出略;
  • 相关阅读:
    大道至简第一章和java理论学时第一节。感受。
    jQuery基础
    JavaScript对象及初始面向对象
    使用JavaScript操作DOM
    JavaScript操作BOM对象
    JavaScript基础
    实体之间的对应关系
    MySQL常用函数
    SQL Server中分离附加数据及生成SQL脚本
    C#中子类构造函数
  • 原文地址:https://www.cnblogs.com/qlwang/p/5036461.html
Copyright © 2011-2022 走看看