salt.fileserver.minionfs

Fileserver backend which serves files pushed to the Master

The cp.push function allows Minions to push files up to the Master. Using this backend, these pushed files are exposed to other Minions via the Salt fileserver.

To enable minionfs, file_recv needs to be set to True in the master config file (otherwise cp.push will not be allowed to push files to the Master), and minion must be added to the fileserver_backends list.

fileserver_backend:
  - minion

其他minionfs配置包括: minionfs_whitelist, minionfs_blacklist, minionfs_mountpoint, 和 minionfs_env

salt.fileserver.minionfs.dir_list(load)

返回一个在master所有目录的列表。

CLI 范例:

$ salt 'source-minion' cp.push /absolute/path/file  # Push the file to the master
$ salt 'destination-minion' cp.list_master_dirs
destination-minion:
    - source-minion/absolute
    - source-minion/absolute/path
salt.fileserver.minionfs.envs()

返回一个在master配置中为minionfs指定的环境

salt.fileserver.minionfs.file_hash(load, fnd)

返回一个文件hash,hash类型在master配置文件中设置。

salt.fileserver.minionfs.file_list(load)

在指定环境中返回文件服务器的所有文件列表

salt.fileserver.minionfs.find_file(path, tgt_env='base', **kwargs)

在相对路径中搜索环境

salt.fileserver.minionfs.serve_file(load, fnd)

从一个基于接收到的文件中返回数据块

CLI 范例:

# Push the file to the master
$ salt 'source-minion' cp.push /path/to/the/file
$ salt 'destination-minion' cp.get_file salt://source-minion/path/to/the/file /destination/file
salt.fileserver.minionfs.update()

要求更新(正则区间)的范围主机获取缓存