Salt Bundle
1. Salt Bundleの概要
Salt Bundleは、Salt Minion、Python 3、必須のPythonモジュール、およびライブラリが含まれている1つのバイナリパッケージです。
Salt BundleはPython 3に付属していて、Saltを実行するためのすべての要件です。したがって、Salt Bundleは、システムソフトウェアとしてクライアントにインストールされているPythonバージョンを使用しません。Salt Bundleは、指定のSaltバージョンの要件を満たさないクライアントにインストールできます。
SUSE Multi-Linux Manager Salt Master以外のSalt Masterに接続されているSalt Minionを実行するシステムでSalt Bundleを使用することもできます。
2. Salt Bundleを使用してクライアントをMinionとして登録する
Salt Bundleを使用した登録方法は推奨の登録方法です。 このセクションでは、現在の実装の利点と制約について説明します。
The Salt Bundle is provided as the venv-salt-minion package that consists of Salt, Python 3, and the Python modules Salt depends on.
Web UIを使用したブートストラップもSalt Bundleを使用しているため、Web UIを使用したブートストラップはPythonに依存しません。 Salt Bundleを使用すると、クライアントがPythonインタープリターまたはモジュールを提供する必要がなくなります。
If you bootstrap new clients, registration with the Salt Bundle is the default method. You can switch existing clients to the Salt Bundle method. If you switch, the salt-minion package and its dependencies will stay installed.
2.1. Salt Minionを使用したSalt Bundleの使用
The Salt Bundle can be used with the Salt Minion managed by the Salt Master other than SUSE Multi-Linux Manager Server at the same time. If the Salt Bundle is installed on a client SUSE Multi-Linux Manager Server will manage the configuration files of the Salt Bundle, the configuration files of salt-minion will not be managed in this case. For more information, see Salt Bundle configuration.
|
2.2. Salt MinionからSalt Bundleへの切り替え
The Salt state util.mgr_switch_to_venv_minion is available to switch from salt-minion to venv-salt-minion. It is recommended to switch to venv-salt-minion in two steps to avoid trouble with shifting processes:
util.mgr_switch_to_venv_minion state to venv-salt-minion-
Apply
util.mgr_switch_to_venv_minionwith no pillar specified first. This will result in the switch tovenv-salt-minionwith copying configuration files etc. It will not clean up the originalsalt-minionconfigurations and its packages.salt <minion_id> state.apply util.mgr_switch_to_venv_minion
Apply
util.mgr_switch_to_venv_minionwithmgr_purge_non_venv_saltset toTrueto removesalt-minionand withmgr_purge_non_venv_salt_filesset toTrueto remove all the files related tosalt-minion. This second step ensures the first step was processed, and then removes the old configuration files and the now obsoletesalt-minionpackage.salt <minion_id> state.apply util.mgr_switch_to_venv_minion pillar='{"mgr_purge_non_venv_salt_files": True, "mgr_purge_non_venv_salt": True}'
2.3. 追加の懸念事項
-
In case of running the second step only and the first step, state apply process could fail as it requires stopping the
salt-minionwhich is used to execute the command on the client side. -
It is also possible to avoid installing the Salt Bundle and keep using
salt-minioninstead. In this case, specify one of these options:-
Execute
mgr-bootstrapwith--no-bundleoption. -
Set
AVOID_VENV_SALT_MINIONto1in the generated bootstrap script. -
For bootstrap state set the
mgr_avoid_venv_salt_minionpillar toTruein/srv/pillar/salt_bundle_config.sls.
-
3. Salt BundleによるSSH Push
Salt Bundleは、クライアントに対してSSH Pushアクションを実行するときにも使用されます。
A shell script deploys the Salt Bundle onto the target system without installing venv-salt-minion before any Salt command is executed. Because the Salt Bundle contains the whole Salt code base, no salt-thin is deployed. SSH Push (including bootstrapping using the Web UI) uses the Python 3 interpreter within the bundle. The target system does not need to have any other Python interpreter installed.
Bundleを使用して配備されたPython 3は、クライアントでSSH Pushセッションを処理するために使用されるため、SSH Push (Web UIを使用したブートストラップを含む)は、システムにインストールされているPythonに依存しません。
Using salt-thin can be enabled as a fallback method, but it requires Python 3 to be installed on the client. This method is not recommended nor supported and exists for development purposes only. Set web.ssh_use_salt_thin to true in the /etc/rhn/rhn.conf configuration file.
|
4. Extend Salt Bundle With Python Packages using pip
The Salt Bundle includes pip to make it possible to extend the functionality of the bundled Salt Minion with extra Python packages.
By default, salt <minion_id> pip.install <package-name> installs the Python package specified by <package_name> into /var/lib/venv-salt-minion/local.
|
If needed, the path [Service] Environment=VENV_PIP_TARGET=/new/path/local/venv-salt-minion/pip |
|
The Python packages installed through |