設定管理

クライアントそれぞれを手動で設定するのではなく、設定ファイルおよびチャンネルを使用してクライアントの設定を管理できます。

設定パラメータは、スクリプト化され、設定ファイルに保存されます。 SUSE Multi-Linux ManagerのWeb UIを使用して設定ファイルを直接書き込むことができます。または、別の場所にあるファイルをアップロードまたはリンクできます。

設定チャンネルは、設定ファイルの編成に使用されます。 クライアントを設定チャンネルにサブスクライブして、必要に応じて設定ファイルを展開できます。

設定ファイルはバージョン管理されるため、設定を追加し、クライアントで設定をテストし、必要に応じて前のリビジョンにロールバックできます。 設定チャンネルを作成したら、さまざまな設定ファイル間の比較や同じ設定ファイルの異なるリビジョン間の比較も実行できます。

Configuration files are provided through Configuration Channels or State Channels.

次の表に、サポートされている機能を示します。各記号の意味は次のとおりです。

  • : この機能はSUSEでサポートされています

  • : この機能はSUSEではサポートされていません

  • : この機能は検討中であり、後日サポートされるかどうかは未定です。

Table 1. 設定管理でサポートされる機能
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:

Procedure: Creating a configuration channel
  1. SUSE Multi-Linux ManagerのWeb UIで、設定  チャンネルに移動し、設定チャンネルの作成をクリックします。

  2. チャンネルの名前を入力します。

  3. チャンネルのラベルを入力します。 This field must contain only letters, numbers, hyphens (-) and underscores (_).

  4. 他のチャンネルから区別できるようにチャンネルの説明を入力します。

  5. 設定チャンネルの作成をクリックして新しいチャンネルを作成します。

1.2. State channel

State channels use Salt states on clients:

Procedure: Creating a Salt state channel
  1. SUSE Multi-Linux ManagerのWeb UIで、設定  チャンネルに移動し、状態チャンネルの作成をクリックします。

  2. チャンネルの名前を入力します。

  3. チャンネルのラベルを入力します。 This field must contain only letters, numbers, hyphens (-) and underscores (_).

  4. 他のチャンネルから区別できるようにチャンネルの説明を入力します。

  5. Type the SLS Contents for the init.sls file.

  6. Click Create Config State Channel to create the new channel.

設定チャンネルを作成済みの場合、設定ファイル、ディレクトリ、またはシンボリックリンクを追加できます。

Procedure: Adding a configuration file, directory, or symbolic link
  1. SUSE Multi-Linux ManagerのWeb UIで、設定  チャンネルに移動し、設定ファイルに追加する設定チャンネルの名前をクリックし、ファイルの追加  ファイルの作成サブタブに移動します。

  2. In the File Type field, choose whether you want to create a text file, directory, or symbolic link.

  3. In the Filename/Path field, type the absolute path to the location where the file should be deployed.

  4. If you are creating a symbolic link, type the target file and path in the Symbolic Link Target Filename/Path field.

  5. Type the User name and Group name for the file in the Ownership field, and the File Permissions Mode.

  6. If the client has SELinux enabled, you can configure SELinux contexts to enable the required file attributes (for example: user, role, and file type).

  7. You can use Jinja templating with grains or pillar data instead of legacy macro delimiters.

  8. Enter the configuration file contents in the File Contents text box, using the script drop-down box to choose the appropriate scripting language.

  9. 設定ファイルの作成をクリックします。

3. Subscribe clients to configuration channels

You can subscribe individual clients to configuration channels by navigating to Systems  System List, 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).

Procedure: Subscribing multiple clients to configuration channels
  1. SUSE Multi-Linux ManagerのWeb UIで、システム  システム一覧に移動し、操作するクライアントを選択します。

  2. システム  システムセットマネージャに移動し、設定  チャンネルにサブスクライブサブタブに移動し、使用できる設定チャンネルの一覧を表示します。

  3. OPTIONAL: Click the number in the Systems currently subscribed column to see which clients are currently subscribed to the configuration channel.

  4. サブスクライブ先の設定チャンネルを確認し、続行をクリックします。

  5. 上下矢印を使用して設定チャンネルをランクします。 設定の競合が設定チャンネルで発生した場合、一覧の上の方にあるチャンネルが優先されます。

  6. 選択したクライアントにチャンネルを適用する方法を決定します。 最も低い順位でサブスクライブをクリックして、現在サブスクライブしているチャンネルより低い優先度で新しいチャンネルを追加します。 最も高い順位でサブスクライブをクリックして、現在サブスクライブしているチャンネルより高い優先度で新しいチャンネルを追加します。 既存のサブスクリプションを置換をクリックして、既存のチャンネルを削除し、新しいチャンネルに置き換えます。

  7. サブスクリプションの適用をクリックします。

新しい設定チャンネルの優先度が既存のチャンネルと競合する場合、重複チャンネルが削除され、新しい優先度に応じて置き換えられます。 クライアントの設定優先度をアクションで順序変更する場合、Web UIでは続行する前に変更を確認する必要があります。

4. Compare configuration files

システムセットマネージャ(SSM)を使用して、SUSE Multi-Linux Managerサーバに保存されている設定ファイルを使用してクライアントに展開された設定ファイルを比較することもできます。

Procedure: Comparing configuration files
  1. SUSE Multi-Linux ManagerのWeb UIで、システム  システム一覧に移動して、比較する設定ファイルにサブスクライブされているクライアントを選択します。

  2. システム  システムセットマネージャに移動し、設定  ファイルの比較サブタブに移動し、使用できる設定チャンネルの一覧を表示します。

  3. OPTIONAL: Click the number in the Systems column to see which clients are currently subscribed to the configuration file.

  4. 比較する設定ファイルを確認し、ファイルの比較をスケジュールをクリックします。

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