From 0d4c18d9f909d2b6c26c1eb855bc2966a8cdbd61 Mon Sep 17 00:00:00 2001 From: Egor Artemov Date: Thu, 19 Nov 2026 02:48:56 +0800 Subject: [PATCH] docs: describe groups of a managed inventory --- docs/reference/audit-events.md | 9 ++++++++- docs/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- .../current/user-guide/inventory.md | 17 +++++++++++++++-- 12 files changed, 173 insertions(+), 23 deletions(-) diff --git a/docs/reference/audit-events.md b/docs/reference/audit-events.md index d8984866..5b255548 100644 --- a/docs/reference/audit-events.md +++ b/docs/reference/audit-events.md @@ -99,7 +99,14 @@ Every event is a JSON object. Fields that do not apply to an event are left out. | `resource.inventory_host` | `update` | `change` | success | | `inventory_id`, `inventory_name`, `changed_fields`, `old_name`, `added_variables`, `removed_variables`, `changed_variables` | Community | | `resource.inventory_host` | `enable` | `change` | success | | `inventory_id`, `inventory_name` | Community | | `resource.inventory_host` | `disable` | `change` | success | | `inventory_id`, `inventory_name` | Community | -| `resource.inventory_host` | `delete` | `deletion` | success | | `inventory_id`, `inventory_name` | Community | +| `resource.inventory_host` | `delete` | `deletion` | success | | `inventory_id`, `inventory_name`, `groups`, `part`, `parts` | Community | +| `resource.inventory_group` | `create` | `creation` | success | | `inventory_id`, `inventory_name`, `added_variables` | Community | +| `resource.inventory_group` | `update` | `change` | success | | `inventory_id`, `inventory_name`, `changed_fields`, `old_name`, `added_variables`, `removed_variables`, `changed_variables` | Community | +| `resource.inventory_group` | `delete` | `deletion` | success | | `inventory_id`, `inventory_name`, `children`, `parents`, `host_count`, `part`, `parts` | Community | +| `resource.inventory_group` | `host_add` | `change` | success | | `inventory_id`, `inventory_name`, `hosts`, `part`, `parts` | Community | +| `resource.inventory_group` | `host_remove` | `change` | success | | `inventory_id`, `inventory_name`, `hosts`, `part`, `parts` | Community | +| `resource.inventory_group` | `child_add` | `change` | success | | `inventory_id`, `inventory_name`, `children`, `part`, `parts` | Community | +| `resource.inventory_group` | `child_remove` | `change` | success | | `inventory_id`, `inventory_name`, `children`, `part`, `parts` | Community | | `resource.repository` | `create` | `creation` | success | | | Community | | `resource.repository` | `update` | `change` | success | | | Community | | `resource.repository` | `delete` | `deletion` | success | | | Community | diff --git a/docs/user-guide/inventory.md b/docs/user-guide/inventory.md index ef7f5643..6e6aeafd 100644 --- a/docs/user-guide/inventory.md +++ b/docs/user-guide/inventory.md @@ -58,9 +58,10 @@ If you are not sure which resources are being used in an environment, follow ste A managed inventory keeps your hosts as records instead of inventory text. Use it when you add, change, or switch off hosts often, and you do not want to edit one big text. -Click the name of the inventory in the list. The page has two tabs: +Click the name of the inventory in the list. The page has three tabs: -* **Hosts**: search hosts by name, add, edit, and delete them. The **Variables** column shows how many variables a host has. +* **Hosts**: search hosts by name, filter them by group, add, edit, and delete them. The **Groups** column shows the groups of a host. The **Variables** column shows how many variables a host has. +* **Groups**: groups of hosts. See [Groups](#managed-inventory-groups). * **Variables**: variables of the whole inventory. A host has a name, an optional description, and variables. The name is what Ansible sees as the host. It must be unique in the inventory, it is case-sensitive, and it must not contain spaces, commas, square brackets, or colons. Put the address and the port into the variables `ansible_host` and `ansible_port`. @@ -79,3 +80,15 @@ To skip a host, turn off its switch in the list of hosts. Tasks created after th * You cannot change the type of an inventory to or from `managed` after you create it. * Hosts and variables of a managed inventory are part of the project backup. * Users who can only view the project can open the page, but they cannot change it. + +### Groups {#managed-inventory-groups} + +A group lets you run a playbook on a part of the hosts, for example with `hosts: web`, and set a variable once for many hosts. + +Add a group on the **Groups** tab. A group has a name, an optional description, variables, and child groups. The name must be unique in the inventory, and the names `all` and `ungrouped` are taken. The hosts of a child group also belong to the parent group. A group can not be its own ancestor. + +To put a host into groups, choose them in the **Groups** field when you add or edit the host. To change several hosts at once, select them on the **Hosts** tab and click **Add to groups** or **Remove from groups**. A host can be in several groups. + +To see the hosts of a group, choose the group in the filter on the **Hosts** tab. The list includes the hosts of its child groups. + +A value set on a host wins over the same variable set on a group, and a value set on a group wins over the inventory. A task that targets a group runs on its hosts that are switched on. diff --git a/i18n/de/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/de/docusaurus-plugin-content-docs/current/user-guide/inventory.md index 8350587e..4cf5995d 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Wenn Sie nicht sicher sind, welche Ressourcen in einer Umgebung verwendet werden Ein Managed Inventory speichert Ihre Hosts als Datensätze statt als Inventory-Text. Verwenden Sie es, wenn Sie Hosts oft hinzufügen, ändern oder ausschalten und keinen großen Text bearbeiten möchten. -Klicken Sie in der Liste auf den Namen des Inventory. Die Seite hat zwei Tabs: +Klicken Sie in der Liste auf den Namen des Inventory. Die Seite hat drei Tabs: -* **Hosts**: Hosts nach Namen suchen, hinzufügen, bearbeiten und löschen. Die Spalte **Variables** zeigt, wie viele Variablen ein Host hat. +* **Hosts**: Hosts nach Namen suchen, nach Gruppe filtern, hinzufügen, bearbeiten und löschen. Die Spalte **Groups** zeigt die Gruppen eines Hosts. Die Spalte **Variables** zeigt, wie viele Variablen ein Host hat. +* **Groups**: Gruppen von Hosts. Siehe [Gruppen](#managed-inventory-groups). * **Variables**: Variablen des gesamten Inventory. Ein Host hat einen Namen, eine optionale Beschreibung und Variablen. Der Name ist das, was Ansible als Host sieht. Er muss im Inventory eindeutig sein, Groß- und Kleinschreibung wird unterschieden, und er darf keine Leerzeichen, Kommas, eckigen Klammern oder Doppelpunkte enthalten. Schreiben Sie die Adresse und den Port in die Variablen `ansible_host` und `ansible_port`. @@ -74,3 +75,15 @@ Um einen Host zu überspringen, schalten Sie seinen Schalter in der Host-Liste a * Den Typ eines Inventory können Sie nach dem Erstellen nicht zu `managed` oder von `managed` weg ändern. * Hosts und Variablen eines Managed Inventory sind Teil des Projekt-Backups. * Benutzer, die das Projekt nur ansehen dürfen, können die Seite öffnen, aber nichts ändern. + +### Gruppen {#managed-inventory-groups} + +Mit einer Gruppe können Sie ein Playbook auf einem Teil der Hosts ausführen, zum Beispiel mit `hosts: web`, und eine Variable einmal für viele Hosts setzen. + +Fügen Sie eine Gruppe im Tab **Groups** hinzu. Eine Gruppe hat einen Namen, eine optionale Beschreibung, Variablen und untergeordnete Gruppen. Der Name muss im Inventory eindeutig sein, und die Namen `all` und `ungrouped` sind vergeben. Die Hosts einer untergeordneten Gruppe gehören auch zur übergeordneten Gruppe. Eine Gruppe kann nicht ihr eigener Vorfahre sein. + +Um einen Host in Gruppen aufzunehmen, wählen Sie sie im Feld **Groups** aus, wenn Sie den Host hinzufügen oder bearbeiten. Um mehrere Hosts auf einmal zu ändern, wählen Sie sie im Tab **Hosts** aus und klicken Sie auf **Add to groups** oder **Remove from groups**. Ein Host kann in mehreren Gruppen sein. + +Um die Hosts einer Gruppe zu sehen, wählen Sie die Gruppe im Filter im Tab **Hosts**. Die Liste enthält auch die Hosts ihrer untergeordneten Gruppen. + +Ein Wert, der an einem Host gesetzt ist, hat Vorrang vor derselben Variable in einer Gruppe, und ein Wert in einer Gruppe hat Vorrang vor dem Inventory. Ein Task, der auf eine Gruppe zielt, läuft auf ihren eingeschalteten Hosts. diff --git a/i18n/es/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/es/docusaurus-plugin-content-docs/current/user-guide/inventory.md index 59d66670..82e305f2 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Si no está seguro de qué recursos se usan en un entorno, siga los pasos 1 y 2 Un inventario administrado guarda sus hosts como registros en lugar de texto de inventario. Úselo cuando agregue, cambie o desactive hosts con frecuencia y no quiera editar un texto largo. -Haga clic en el nombre del inventario en la lista. La página tiene dos pestañas: +Haga clic en el nombre del inventario en la lista. La página tiene tres pestañas: -* **Hosts**: busque hosts por nombre, agréguelos, edítelos y elimínelos. La columna **Variables** muestra cuántas variables tiene un host. +* **Hosts**: busque hosts por nombre, fíltrelos por grupo, agréguelos, edítelos y elimínelos. La columna **Groups** muestra los grupos de un host. La columna **Variables** muestra cuántas variables tiene un host. +* **Groups**: grupos de hosts. Consulte [Grupos](#managed-inventory-groups). * **Variables**: variables de todo el inventario. Un host tiene un nombre, una descripción opcional y variables. El nombre es lo que Ansible ve como host. Debe ser único en el inventario, distingue mayúsculas de minúsculas y no debe contener espacios, comas, corchetes ni dos puntos. Ponga la dirección y el puerto en las variables `ansible_host` y `ansible_port`. @@ -74,3 +75,15 @@ Para omitir un host, desactive su interruptor en la lista de hosts. Las tareas c * No puede cambiar el tipo de un inventario a `managed` ni desde `managed` después de crearlo. * Los hosts y las variables de un inventario administrado forman parte de la copia de seguridad del proyecto. * Los usuarios que solo pueden ver el proyecto pueden abrir la página, pero no pueden cambiarla. + +### Grupos {#managed-inventory-groups} + +Un grupo le permite ejecutar un playbook en una parte de los hosts, por ejemplo con `hosts: web`, y definir una variable una sola vez para muchos hosts. + +Agregue un grupo en la pestaña **Groups**. Un grupo tiene un nombre, una descripción opcional, variables y grupos hijos. El nombre debe ser único en el inventario, y los nombres `all` y `ungrouped` están reservados. Los hosts de un grupo hijo también pertenecen al grupo padre. Un grupo no puede ser su propio ancestro. + +Para poner un host en grupos, elíjalos en el campo **Groups** al agregar o editar el host. Para cambiar varios hosts a la vez, selecciónelos en la pestaña **Hosts** y haga clic en **Add to groups** o **Remove from groups**. Un host puede estar en varios grupos. + +Para ver los hosts de un grupo, elija el grupo en el filtro de la pestaña **Hosts**. La lista incluye los hosts de sus grupos hijos. + +Un valor definido en un host prevalece sobre la misma variable definida en un grupo, y un valor definido en un grupo prevalece sobre el inventario. Una tarea dirigida a un grupo se ejecuta en sus hosts que están activados. diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/inventory.md index af4fa526..5edee93d 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Si vous ne savez pas quelles ressources sont utilisées dans un environnement, s Un inventaire géré conserve vos hôtes sous forme d'enregistrements plutôt que de texte d'inventaire. Utilisez-le si vous ajoutez, modifiez ou désactivez souvent des hôtes et que vous ne voulez pas modifier un long texte. -Cliquez sur le nom de l'inventaire dans la liste. La page comporte deux onglets : +Cliquez sur le nom de l'inventaire dans la liste. La page comporte trois onglets : -* **Hosts** : recherchez des hôtes par nom, ajoutez-les, modifiez-les et supprimez-les. La colonne **Variables** indique combien de variables possède un hôte. +* **Hosts** : recherchez des hôtes par nom, filtrez-les par groupe, ajoutez-les, modifiez-les et supprimez-les. La colonne **Groups** indique les groupes d'un hôte. La colonne **Variables** indique combien de variables possède un hôte. +* **Groups** : groupes d'hôtes. Voir [Groupes](#managed-inventory-groups). * **Variables** : variables de l'inventaire entier. Un hôte a un nom, une description facultative et des variables. Le nom est ce qu'Ansible voit comme hôte. Il doit être unique dans l'inventaire, il distingue les majuscules des minuscules, et il ne doit pas contenir d'espaces, de virgules, de crochets ni de deux-points. Placez l'adresse et le port dans les variables `ansible_host` et `ansible_port`. @@ -74,3 +75,15 @@ Pour ignorer un hôte, désactivez son interrupteur dans la liste des hôtes. Le * Vous ne pouvez pas changer le type d'un inventaire vers `managed` ni depuis `managed` après sa création. * Les hôtes et les variables d'un inventaire géré font partie de la sauvegarde du projet. * Les utilisateurs qui peuvent seulement consulter le projet peuvent ouvrir la page, mais ils ne peuvent pas la modifier. + +### Groupes {#managed-inventory-groups} + +Un groupe vous permet d'exécuter un playbook sur une partie des hôtes, par exemple avec `hosts: web`, et de définir une variable une seule fois pour de nombreux hôtes. + +Ajoutez un groupe dans l'onglet **Groups**. Un groupe a un nom, une description facultative, des variables et des groupes enfants. Le nom doit être unique dans l'inventaire, et les noms `all` et `ungrouped` sont réservés. Les hôtes d'un groupe enfant appartiennent aussi au groupe parent. Un groupe ne peut pas être son propre ancêtre. + +Pour placer un hôte dans des groupes, choisissez-les dans le champ **Groups** lorsque vous ajoutez ou modifiez l'hôte. Pour modifier plusieurs hôtes à la fois, sélectionnez-les dans l'onglet **Hosts** et cliquez sur **Add to groups** ou **Remove from groups**. Un hôte peut appartenir à plusieurs groupes. + +Pour voir les hôtes d'un groupe, choisissez le groupe dans le filtre de l'onglet **Hosts**. La liste inclut les hôtes de ses groupes enfants. + +Une valeur définie sur un hôte l'emporte sur la même variable définie sur un groupe, et une valeur définie sur un groupe l'emporte sur l'inventaire. Une tâche qui cible un groupe s'exécute sur ses hôtes activés. diff --git a/i18n/it/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/it/docusaurus-plugin-content-docs/current/user-guide/inventory.md index 0607a738..a32a461a 100644 --- a/i18n/it/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/it/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Se non si è sicuri di quali risorse utilizzino un ambiente, seguire i passaggi Un Inventory gestito conserva gli host come record invece che come testo di Inventory. Utilizzarlo quando si aggiungono, modificano o disattivano host spesso e non si vuole modificare un testo lungo. -Fare clic sul nome dell'Inventory nell'elenco. La pagina ha due schede: +Fare clic sul nome dell'Inventory nell'elenco. La pagina ha tre schede: -* **Hosts**: cercare gli host per nome, aggiungerli, modificarli ed eliminarli. La colonna **Variables** mostra quante variabili ha un host. +* **Hosts**: cercare gli host per nome, filtrarli per gruppo, aggiungerli, modificarli ed eliminarli. La colonna **Groups** mostra i gruppi di un host. La colonna **Variables** mostra quante variabili ha un host. +* **Groups**: gruppi di host. Vedere [Gruppi](#managed-inventory-groups). * **Variables**: variabili dell'intero Inventory. Un host ha un nome, una descrizione facoltativa e variabili. Il nome è ciò che Ansible vede come host. Deve essere univoco nell'Inventory, distingue tra maiuscole e minuscole e non deve contenere spazi, virgole, parentesi quadre o due punti. Inserire l'indirizzo e la porta nelle variabili `ansible_host` e `ansible_port`. @@ -74,3 +75,15 @@ Per saltare un host, disattivare il suo interruttore nell'elenco degli host. I t * Dopo la creazione non è possibile cambiare il tipo di un Inventory in `managed` né da `managed`. * Gli host e le variabili di un Inventory gestito fanno parte del backup del progetto. * Gli utenti che possono solo visualizzare il progetto possono aprire la pagina, ma non possono modificarla. + +### Gruppi {#managed-inventory-groups} + +Un gruppo consente di eseguire un playbook su una parte degli host, ad esempio con `hosts: web`, e di impostare una variabile una sola volta per molti host. + +Aggiungere un gruppo nella scheda **Groups**. Un gruppo ha un nome, una descrizione facoltativa, variabili e gruppi figli. Il nome deve essere univoco nell'Inventory, e i nomi `all` e `ungrouped` sono riservati. Gli host di un gruppo figlio appartengono anche al gruppo padre. Un gruppo non può essere un proprio antenato. + +Per inserire un host in gruppi, sceglierli nel campo **Groups** quando si aggiunge o si modifica l'host. Per modificare più host insieme, selezionarli nella scheda **Hosts** e fare clic su **Add to groups** o **Remove from groups**. Un host può appartenere a più gruppi. + +Per vedere gli host di un gruppo, scegliere il gruppo nel filtro della scheda **Hosts**. L'elenco include gli host dei suoi gruppi figli. + +Un valore impostato su un host ha la precedenza sulla stessa variabile impostata su un gruppo, e un valore impostato su un gruppo ha la precedenza sull'Inventory. Un task destinato a un gruppo viene eseguito sui suoi host attivati. diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/ja/docusaurus-plugin-content-docs/current/user-guide/inventory.md index e5e7c585..d5f8a9d8 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Managed インベントリのホストと変数を変更する方法は、[Manag Managed インベントリは、インベントリのテキストではなく、ホストをレコードとして保持します。ホストを頻繁に追加、変更、無効化し、長いテキストを編集したくない場合に使用します。 -一覧でインベントリの名前をクリックします。ページには 2 つのタブがあります。 +一覧でインベントリの名前をクリックします。ページには 3 つのタブがあります。 -* **Hosts**: ホストを名前で検索し、追加、編集、削除します。**Variables** 列には、ホストの変数の数が表示されます。 +* **Hosts**: ホストを名前で検索し、グループで絞り込み、追加、編集、削除します。**Groups** 列には、ホストが属するグループが表示されます。**Variables** 列には、ホストの変数の数が表示されます。 +* **Groups**: ホストのグループです。[グループ](#managed-inventory-groups)を参照してください。 * **Variables**: インベントリ全体の変数です。 ホストには、名前、任意の説明、変数があります。名前は、Ansible がホストとして認識するものです。インベントリ内で一意である必要があり、大文字と小文字は区別されます。スペース、カンマ、角括弧、コロンは使用できません。アドレスとポートは、変数 `ansible_host` と `ansible_port` に設定します。 @@ -74,3 +75,15 @@ ansible_user: deploy * 作成後に、インベントリの種類を `managed` に変更したり、`managed` から変更したりすることはできません。 * Managed インベントリのホストと変数は、プロジェクトのバックアップに含まれます。 * プロジェクトの閲覧のみ可能なユーザーは、このページを開けますが、変更はできません。 + +### グループ {#managed-inventory-groups} + +グループを使うと、たとえば `hosts: web` のようにホストの一部に対してプレイブックを実行したり、多くのホストに変数を一度に設定したりできます。 + +**Groups** タブでグループを追加します。グループには、名前、任意の説明、変数、子グループがあります。名前はインベントリ内で一意である必要があり、`all` と `ungrouped` という名前は予約されています。子グループのホストは、親グループにも属します。グループを自身の祖先にすることはできません。 + +ホストをグループに入れるには、ホストを追加または編集するときに **Groups** フィールドでグループを選択します。複数のホストをまとめて変更するには、**Hosts** タブでホストを選択し、**Add to groups** または **Remove from groups** をクリックします。1 つのホストを複数のグループに入れることができます。 + +グループのホストを確認するには、**Hosts** タブのフィルターでグループを選択します。一覧には、子グループのホストも含まれます。 + +ホストに設定した値は、グループに設定した同じ変数より優先され、グループに設定した値はインベントリより優先されます。グループを対象とするタスクは、そのグループのホストのうち、スイッチがオンのホストで実行されます。 diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/ko/docusaurus-plugin-content-docs/current/user-guide/inventory.md index 7779a19e..4b9d170a 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Managed 인벤토리의 호스트와 변수를 변경하려면 [Managed 인벤 Managed 인벤토리는 인벤토리 텍스트 대신 호스트를 레코드로 보관합니다. 호스트를 자주 추가, 변경, 비활성화하고 긴 텍스트를 편집하고 싶지 않을 때 사용하십시오. -목록에서 인벤토리 이름을 클릭합니다. 페이지에는 두 개의 탭이 있습니다. +목록에서 인벤토리 이름을 클릭합니다. 페이지에는 세 개의 탭이 있습니다. -* **Hosts**: 이름으로 호스트를 검색하고, 추가, 편집, 삭제합니다. **Variables** 열은 호스트의 변수 개수를 보여 줍니다. +* **Hosts**: 이름으로 호스트를 검색하고, 그룹으로 필터링하고, 추가, 편집, 삭제합니다. **Groups** 열은 호스트가 속한 그룹을 보여 줍니다. **Variables** 열은 호스트의 변수 개수를 보여 줍니다. +* **Groups**: 호스트 그룹입니다. [그룹](#managed-inventory-groups)을 참조하십시오. * **Variables**: 인벤토리 전체의 변수입니다. 호스트에는 이름, 선택 사항인 설명, 변수가 있습니다. 이름은 Ansible이 호스트로 인식하는 값입니다. 인벤토리 안에서 고유해야 하고, 대소문자를 구분하며, 공백, 쉼표, 대괄호, 콜론을 포함할 수 없습니다. 주소와 포트는 변수 `ansible_host`와 `ansible_port`에 넣습니다. @@ -74,3 +75,15 @@ ansible_user: deploy * 생성한 후에는 인벤토리 유형을 `managed`로 바꾸거나 `managed`에서 다른 유형으로 바꿀 수 없습니다. * Managed 인벤토리의 호스트와 변수는 프로젝트 백업에 포함됩니다. * 프로젝트를 보기만 할 수 있는 사용자는 페이지를 열 수 있지만 변경할 수는 없습니다. + +### 그룹 {#managed-inventory-groups} + +그룹을 사용하면 예를 들어 `hosts: web`처럼 호스트의 일부에서 플레이북을 실행하고, 여러 호스트에 변수를 한 번에 설정할 수 있습니다. + +**Groups** 탭에서 그룹을 추가합니다. 그룹에는 이름, 선택 사항인 설명, 변수, 하위 그룹이 있습니다. 이름은 인벤토리 안에서 고유해야 하며, `all`과 `ungrouped`라는 이름은 이미 예약되어 있습니다. 하위 그룹의 호스트는 상위 그룹에도 속합니다. 그룹은 자기 자신의 조상이 될 수 없습니다. + +호스트를 그룹에 넣으려면 호스트를 추가하거나 편집할 때 **Groups** 필드에서 그룹을 선택합니다. 여러 호스트를 한 번에 변경하려면 **Hosts** 탭에서 호스트를 선택하고 **Add to groups** 또는 **Remove from groups**를 클릭합니다. 호스트 하나는 여러 그룹에 속할 수 있습니다. + +그룹의 호스트를 보려면 **Hosts** 탭의 필터에서 그룹을 선택합니다. 목록에는 하위 그룹의 호스트도 포함됩니다. + +호스트에 설정한 값은 그룹에 설정한 같은 변수보다 우선하고, 그룹에 설정한 값은 인벤토리보다 우선합니다. 그룹을 대상으로 하는 태스크는 그 그룹의 호스트 중 스위치가 켜진 호스트에서 실행됩니다. diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/pt/docusaurus-plugin-content-docs/current/user-guide/inventory.md index 49d2e6a0..118dd094 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Se você não tem certeza de quais recursos estão sendo usados em um ambiente, Um inventário gerenciado guarda seus hosts como registros em vez de texto de inventário. Use-o quando você adiciona, altera ou desativa hosts com frequência e não quer editar um texto longo. -Clique no nome do inventário na lista. A página tem duas abas: +Clique no nome do inventário na lista. A página tem três abas: -* **Hosts**: pesquise hosts pelo nome, adicione, edite e exclua. A coluna **Variables** mostra quantas variáveis um host tem. +* **Hosts**: pesquise hosts pelo nome, filtre por grupo, adicione, edite e exclua. A coluna **Groups** mostra os grupos de um host. A coluna **Variables** mostra quantas variáveis um host tem. +* **Groups**: grupos de hosts. Veja [Grupos](#managed-inventory-groups). * **Variables**: variáveis do inventário inteiro. Um host tem um nome, uma descrição opcional e variáveis. O nome é o que o Ansible vê como host. Ele deve ser único no inventário, diferencia maiúsculas de minúsculas e não deve conter espaços, vírgulas, colchetes ou dois-pontos. Coloque o endereço e a porta nas variáveis `ansible_host` e `ansible_port`. @@ -74,3 +75,15 @@ Para pular um host, desligue a chave dele na lista de hosts. As tarefas criadas * Você não pode mudar o tipo de um inventário para `managed` nem a partir de `managed` depois de criá-lo. * Os hosts e as variáveis de um inventário gerenciado fazem parte do backup do projeto. * Usuários que só podem ver o projeto podem abrir a página, mas não podem alterá-la. + +### Grupos {#managed-inventory-groups} + +Um grupo permite executar um playbook em uma parte dos hosts, por exemplo com `hosts: web`, e definir uma variável uma única vez para muitos hosts. + +Adicione um grupo na aba **Groups**. Um grupo tem um nome, uma descrição opcional, variáveis e grupos filhos. O nome deve ser único no inventário, e os nomes `all` e `ungrouped` são reservados. Os hosts de um grupo filho também pertencem ao grupo pai. Um grupo não pode ser seu próprio ancestral. + +Para colocar um host em grupos, escolha-os no campo **Groups** ao adicionar ou editar o host. Para alterar vários hosts de uma vez, selecione-os na aba **Hosts** e clique em **Add to groups** ou **Remove from groups**. Um host pode estar em vários grupos. + +Para ver os hosts de um grupo, escolha o grupo no filtro da aba **Hosts**. A lista inclui os hosts dos seus grupos filhos. + +Um valor definido em um host prevalece sobre a mesma variável definida em um grupo, e um valor definido em um grupo prevalece sobre o inventário. Uma tarefa que tem um grupo como alvo é executada nos hosts dele com a chave ligada. diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/ru/docusaurus-plugin-content-docs/current/user-guide/inventory.md index a71bedac..bfe2ebba 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Semaphore UI может читать инвентарь либо из файла Управляемый инвентарь хранит хосты как записи, а не как текст инвентаря. Используйте его, если вы часто добавляете, меняете или отключаете хосты и не хотите редактировать большой текст. -Нажмите на имя инвентаря в списке. На странице две вкладки: +Нажмите на имя инвентаря в списке. На странице три вкладки: -* **Hosts**: поиск хостов по имени, добавление, изменение и удаление хостов. Колонка **Variables** показывает, сколько переменных у хоста. +* **Hosts**: поиск хостов по имени, фильтр по группе, добавление, изменение и удаление хостов. Колонка **Groups** показывает группы хоста. Колонка **Variables** показывает, сколько переменных у хоста. +* **Groups**: группы хостов. См. [Группы](#managed-inventory-groups). * **Variables**: переменные всего инвентаря. У хоста есть имя, необязательное описание и переменные. Имя — это то, что Ansible видит как хост. Оно должно быть уникальным в инвентаре, регистр учитывается, а пробелы, запятые, квадратные скобки и двоеточия в нём недопустимы. Адрес и порт укажите в переменных `ansible_host` и `ansible_port`. @@ -74,3 +75,15 @@ ansible_user: deploy * После создания нельзя сменить тип инвентаря на `managed` или с `managed` на другой. * Хосты и переменные управляемого инвентаря входят в резервную копию проекта. * Пользователи, которые могут только просматривать проект, могут открыть страницу, но не могут её менять. + +### Группы {#managed-inventory-groups} + +Группа позволяет запустить playbook на части хостов, например с `hosts: web`, и задать переменную один раз для многих хостов. + +Добавьте группу на вкладке **Groups**. У группы есть имя, необязательное описание, переменные и дочерние группы. Имя должно быть уникальным в инвентаре, а имена `all` и `ungrouped` заняты. Хосты дочерней группы также входят в родительскую группу. Группа не может быть своим собственным предком. + +Чтобы добавить хост в группы, выберите их в поле **Groups**, когда добавляете или изменяете хост. Чтобы изменить несколько хостов сразу, выберите их на вкладке **Hosts** и нажмите **Add to groups** или **Remove from groups**. Хост может входить в несколько групп. + +Чтобы увидеть хосты группы, выберите группу в фильтре на вкладке **Hosts**. В список входят и хосты её дочерних групп. + +Значение, заданное на хосте, важнее такой же переменной, заданной в группе, а значение, заданное в группе, важнее инвентаря. Задача, нацеленная на группу, выполняется на тех её хостах, у которых включён переключатель. diff --git a/i18n/sr/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/sr/docusaurus-plugin-content-docs/current/user-guide/inventory.md index d9d28ff7..37e6f0fe 100644 --- a/i18n/sr/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/sr/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Ako niste sigurni koji resursi koriste okruženje, pratite korake 1 i 2 ispod. P Upravljani inventar čuva vaše hostove kao zapise umesto kao tekst inventara. Koristite ga kada često dodajete, menjate ili isključujete hostove i ne želite da uređujete dugačak tekst. -Kliknite na naziv inventara u listi. Stranica ima dve kartice: +Kliknite na naziv inventara u listi. Stranica ima tri kartice: -* **Hosts**: pretražujte hostove po nazivu, dodajte ih, izmenite i obrišite. Kolona **Variables** prikazuje koliko promenljivih host ima. +* **Hosts**: pretražujte hostove po nazivu, filtrirajte ih po grupi, dodajte ih, izmenite i obrišite. Kolona **Groups** prikazuje grupe hosta. Kolona **Variables** prikazuje koliko promenljivih host ima. +* **Groups**: grupe hostova. Pogledajte [Grupe](#managed-inventory-groups). * **Variables**: promenljive celog inventara. Host ima naziv, opcioni opis i promenljive. Naziv je ono što Ansible vidi kao host. Mora biti jedinstven u inventaru, razlikuju se velika i mala slova, i ne sme sadržati razmake, zapete, uglaste zagrade ni dvotačke. Adresu i port upišite u promenljive `ansible_host` i `ansible_port`. @@ -74,3 +75,15 @@ Da biste preskočili host, isključite njegov prekidač u listi hostova. Zadaci * Posle kreiranja ne možete promeniti tip inventara u `managed` niti iz `managed`. * Hostovi i promenljive upravljanog inventara deo su rezervne kopije projekta. * Korisnici koji mogu samo da pregledaju projekat mogu da otvore stranicu, ali ne mogu da je menjaju. + +### Grupe {#managed-inventory-groups} + +Grupa vam omogućava da pokrenete playbook na delu hostova, na primer sa `hosts: web`, i da jednom postavite promenljivu za mnogo hostova. + +Dodajte grupu na kartici **Groups**. Grupa ima naziv, opcioni opis, promenljive i podređene grupe. Naziv mora biti jedinstven u inventaru, a nazivi `all` i `ungrouped` su zauzeti. Hostovi podređene grupe pripadaju i nadređenoj grupi. Grupa ne može biti sopstveni predak. + +Da biste stavili host u grupe, izaberite ih u polju **Groups** kada dodajete ili menjate host. Da biste promenili više hostova odjednom, izaberite ih na kartici **Hosts** i kliknite na **Add to groups** ili **Remove from groups**. Host može biti u više grupa. + +Da biste videli hostove grupe, izaberite grupu u filteru na kartici **Hosts**. Lista obuhvata i hostove njenih podređenih grupa. + +Vrednost postavljena na hostu ima prednost nad istom promenljivom postavljenom na grupi, a vrednost postavljena na grupi ima prednost nad inventarom. Zadatak koji cilja grupu pokreće se na njenim hostovima čiji je prekidač uključen. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/inventory.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/inventory.md index 3bbafc3d..5c2edae2 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/inventory.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/inventory.md @@ -53,9 +53,10 @@ Semaphore UI 既可以从服务器上 Semaphore 用户拥有读取权限的文 托管清单(Managed inventory)把主机保存为记录,而不是清单文本。如果你经常添加、修改或停用主机,又不想编辑一大段文本,可以使用它。 -在列表中点击清单名称。页面有两个选项卡: +在列表中点击清单名称。页面有三个选项卡: -* **Hosts**:按名称搜索主机,添加、编辑和删除主机。**Variables** 列显示主机有多少个变量。 +* **Hosts**:按名称搜索主机,按组筛选主机,添加、编辑和删除主机。**Groups** 列显示主机所属的组。**Variables** 列显示主机有多少个变量。 +* **Groups**:主机组。参见[组](#managed-inventory-groups)。 * **Variables**:整个清单的变量。 主机包含名称、可选的描述和变量。名称就是 Ansible 看到的主机。它在清单内必须唯一,区分大小写,且不能包含空格、逗号、方括号或冒号。把地址和端口写入变量 `ansible_host` 和 `ansible_port`。 @@ -74,3 +75,15 @@ ansible_user: deploy * 清单创建后,不能把类型改为 `managed`,也不能从 `managed` 改为其他类型。 * 托管清单的主机和变量包含在项目备份中。 * 只能查看项目的用户可以打开该页面,但不能修改。 + +### 组 {#managed-inventory-groups} + +通过组,你可以在一部分主机上运行 playbook(例如使用 `hosts: web`),并为许多主机一次性设置变量。 + +在 **Groups** 选项卡中添加组。组包含名称、可选的描述、变量和子组。名称在清单内必须唯一,且名称 `all` 和 `ungrouped` 已被占用。子组的主机也属于父组。组不能成为自己的祖先。 + +要把主机加入组,请在添加或编辑主机时,在 **Groups** 字段中选择这些组。要一次修改多个主机,请在 **Hosts** 选项卡中选中它们,然后点击 **Add to groups** 或 **Remove from groups**。一个主机可以属于多个组。 + +要查看某个组的主机,请在 **Hosts** 选项卡的筛选器中选择该组。列表中也包含其子组的主机。 + +在主机上设置的值优先于在组上设置的同名变量,在组上设置的值优先于清单。以组为目标的任务会在该组中开关已开启的主机上运行。