ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Saltstack module freezer 详解

2020-03-28 21:02:18  阅读:292  来源: 互联网

标签:list module freezer kwargs Saltstack packages pkg


freezer.restore

Make sure that the system contains the packages and repos from a
frozen state.

Read the list of packages and repositories from the freeze file,
and compare it with the current list of packages and repos. If
there is any difference, all the missing packages are repos will
be installed, and all the extra packages and repos will be
removed.

As this module is build on top of the pkg module, the user can
send extra attributes to the underlying pkg module via kwargs.
This function will call ``pkg.list_repos``, ``pkg.mod_repo``,
``pkg.list_pkgs``, ``pkg.install``, ``pkg.remove`` and
``pkg.del_repo``, and any additional arguments will be passed
through to those functions.

name
    Name of the frozen state. Optional.

clean
    If True remove the frozen information YAML from the cache

    New in version 3000

CLI Example:

    salt '*' freezer.restore
    salt '*' freezer.restore root=/chroot

freezer.freeze

Save the list of package and repos in a freeze file.

As this module is build on top of the pkg module, the user can
send extra attributes to the underlying pkg module via kwargs.
This function will call ``pkg.list_pkgs`` and ``pkg.list_repos``,
and any additional arguments will be passed through to those
functions.

name
    Name of the frozen state. Optional.

force
    If true, overwrite the state. Optional.

CLI Example:

    salt '*' freezer.freeze
    salt '*' freezer.freeze pre_install
    salt '*' freezer.freeze force=True root=/chroot

freezer.fopen

Wrapper around open() built-in to set CLOEXEC on the fd.

This flag specifies that the file descriptor should be closed when an exec
function is invoked;

When a file descriptor is allocated (as with open or dup), this bit is
initially cleared on the new file descriptor, meaning that descriptor will
survive into the new program after exec.

NB! We still have small race condition between open and fcntl.

freezer.list

Return the list of frozen states.

CLI Example:

    salt '*' freezer.list

freezer.status

Return True if there is already a frozen state.

A frozen state is merely a list of packages (including the
version) in a specific time. This information can be used to
compare with the current list of packages, and revert the
installation of some extra packages that are in the system.

name
    Name of the frozen state. Optional.

CLI Example:

    salt '*' freezer.status
    salt '*' freezer.status pre_install

freezer.clean_kwargs

Return a dict without any of the __pub* keys (or any other keys starting
with a dunder) from the kwargs dict passed into the execution module
functions. These keys are useful for tracking what was used to invoke
the function call, but they may not be desirable to have if passing the
kwargs forward wholesale.

Usage example:

    kwargs = __utils__['args.clean_kwargs'](**kwargs)

标签:list,module,freezer,kwargs,Saltstack,packages,pkg
来源: https://www.cnblogs.com/randomlee/p/Saltstack_module_freezer.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有