設定管理
クライアントそれぞれを手動で設定するのではなく、設定ファイルおよびチャンネルを使用してクライアントの設定を管理できます。
設定パラメータは、スクリプト化され、設定ファイルに保存されます。 SUSE Multi-Linux ManagerのWeb UIを使用して設定ファイルを直接書き込むことができます。または、別の場所にあるファイルをアップロードまたはリンクできます。
設定チャンネルは、設定ファイルの編成に使用されます。 クライアントを設定チャンネルにサブスクライブして、必要に応じて設定ファイルを展開できます。
設定ファイルはバージョン管理されるため、設定を追加し、クライアントで設定をテストし、必要に応じて前のリビジョンにロールバックできます。 設定チャンネルを作成したら、さまざまな設定ファイル間の比較や同じ設定ファイルの異なるリビジョン間の比較も実行できます。
Configuration files are provided through Configuration Channels or State Channels.
次の表に、サポートされている機能を示します。各記号の意味は次のとおりです。
-
: この機能はSUSEでサポートされています
-
: この機能はSUSEではサポートされていません
-
: この機能は検討中であり、後日サポートされるかどうかは未定です。
| Feature | Status |
|---|---|
Config Channels |
|
State Channels |
|
Deploying Files |
|
Comparing Files |
|
Applying the Highstate |
|
File Import from a Client |
|
Jinja Templating |
1. Create configuration channels
1.1. Configuration channel
To create a new configuration channel:
SUSE Multi-Linux ManagerのWeb UIで、に移動し、設定チャンネルの作成をクリックします。
チャンネルの名前を入力します。
チャンネルのラベルを入力します。 This field must contain only letters, numbers, hyphens (
-) and underscores (_).他のチャンネルから区別できるようにチャンネルの説明を入力します。
設定チャンネルの作成をクリックして新しいチャンネルを作成します。
1.2. State channel
State channels use Salt states on clients:
SUSE Multi-Linux ManagerのWeb UIで、に移動し、状態チャンネルの作成をクリックします。
チャンネルの名前を入力します。
チャンネルのラベルを入力します。 This field must contain only letters, numbers, hyphens (
-) and underscores (_).他のチャンネルから区別できるようにチャンネルの説明を入力します。
Type the
SLS Contentsfor theinit.slsfile.Click Create Config State Channel to create the new channel.
2. Add configuration files, directories, or symbolic links
設定チャンネルを作成済みの場合、設定ファイル、ディレクトリ、またはシンボリックリンクを追加できます。
SUSE Multi-Linux ManagerのWeb UIで、に移動し、設定ファイルに追加する設定チャンネルの名前をクリックし、サブタブに移動します。
In the
File Typefield, choose whether you want to create a text file, directory, or symbolic link.In the
Filename/Pathfield, type the absolute path to the location where the file should be deployed.If you are creating a symbolic link, type the target file and path in the
Symbolic Link Target Filename/Pathfield.Type the
User nameandGroup namefor the file in theOwnershipfield, and theFile Permissions Mode.If the client has SELinux enabled, you can configure
SELinux contextsto enable the required file attributes (for example: user, role, and file type).You can use Jinja templating with grains or pillar data instead of legacy macro delimiters.
Enter the configuration file contents in the
File Contentstext box, using the script drop-down box to choose the appropriate scripting language.設定ファイルの作成をクリックします。
3. Subscribe clients to configuration channels
You can subscribe individual clients to configuration channels by navigating to , selecting the client you want to subscribe, and navigating to the Configuration tab. To subscribe multiple clients to a configuration channel, you can use the system set manager (SSM).
SUSE Multi-Linux ManagerのWeb UIで、に移動し、操作するクライアントを選択します。
に移動し、サブタブに移動し、使用できる設定チャンネルの一覧を表示します。
OPTIONAL: Click the number in the
Systems currently subscribedcolumn to see which clients are currently subscribed to the configuration channel.サブスクライブ先の設定チャンネルを確認し、続行をクリックします。
上下矢印を使用して設定チャンネルをランクします。 設定の競合が設定チャンネルで発生した場合、一覧の上の方にあるチャンネルが優先されます。
選択したクライアントにチャンネルを適用する方法を決定します。 最も低い順位でサブスクライブをクリックして、現在サブスクライブしているチャンネルより低い優先度で新しいチャンネルを追加します。 最も高い順位でサブスクライブをクリックして、現在サブスクライブしているチャンネルより高い優先度で新しいチャンネルを追加します。 既存のサブスクリプションを置換をクリックして、既存のチャンネルを削除し、新しいチャンネルに置き換えます。
サブスクリプションの適用をクリックします。
|
新しい設定チャンネルの優先度が既存のチャンネルと競合する場合、重複チャンネルが削除され、新しい優先度に応じて置き換えられます。 クライアントの設定優先度をアクションで順序変更する場合、Web UIでは続行する前に変更を確認する必要があります。 |
4. Compare configuration files
システムセットマネージャ(SSM)を使用して、SUSE Multi-Linux Managerサーバに保存されている設定ファイルを使用してクライアントに展開された設定ファイルを比較することもできます。
SUSE Multi-Linux ManagerのWeb UIで、に移動して、比較する設定ファイルにサブスクライブされているクライアントを選択します。
に移動し、サブタブに移動し、使用できる設定チャンネルの一覧を表示します。
OPTIONAL: Click the number in the
Systemscolumn to see which clients are currently subscribed to the configuration file.比較する設定ファイルを確認し、ファイルの比較をスケジュールをクリックします。
5. クライアントでのJinjaテンプレート
Jinja templating is possible on Salt clients. Jinja is only evaluated when content is processed by the Salt engine. Jinja provides variables from pillars or grains. They can be used in files managed by Salt (for example, via file.managed) or Salt states.
|
File configuration channels deliver static files without Jinja processing. State channel files are only applied if referenced in a Salt state. |
詳細については、次の例のhttps://docs.saltproject.io/salt/user-guide/en/latest/topics/jinja.htmlを参照してください。
{% if grains.os_family == 'RedHat' %}
{% set dns_cfg = '/etc/named.conf' %}
{% elif grains.os_family == 'Debian' %}
{% set dns_cfg = '/etc/bind/named.conf' %}
{% else %}
{% set dns_cfg = '/etc/named.conf' %}
{% endif %}
dns_conf:
file.managed:
- name: {{ dns_cfg }}
- source: salt://dns/files/named.conf
- template: jinja