An Inventory is a collection of hosts against which jobs may be launched, the same as an Ansible inventory file. Inventories are divided into groups and these groups contain the actual hosts. Groups may be sourced manually, by entering host names into Tower, or from one of Ansible Tower's supported cloud providers.
注解
If you have a custom dynamic inventory script, or a cloud provider that is not yet supported natively in Tower, you can also import that into Tower. Refer to 清单文件导入 in the Automation Controller Administration Guide.
Inventories 窗口显示目前可用的清单列表。可以按照 Name、Type 或 Organization 对清单列表进行排序和搜索。
清单详情列表包括:
清单同步 ():绿色表示清单中同步的成功,红色表示失败同步。点击此图标会显示最后五次清单源同步的同步状态和源信息(如果清单有可以同步的源)。
状态点:这显示了此清单的最近作业的状态。
Name:清单名称。点击清单名称可以进入所选清单的属性屏幕,其中显示了清单的组和主机。(也可以从 图标访问此视图。)
Type:标识它是标准清单还是智能清单。
Organization:清单所属的机构。
Actions:所选的清单可以使用以下操作:
编辑 ():编辑所选清单的属性
复制 ():制作现有清单的副本作为创建新清单的模板
删除 ():删除所选清单。此操作无法撤销!
注解
如果删除了由其他工作项目使用的项,则会打开一条信息,列出会受到删除影响的项,并提示您确认删除。一些界面会包括无效的或以前已被删除的项,因此它们将无法运行。以下是这类信息的一个示例:
A Smart Inventory is a collection of hosts defined by a stored search that can be viewed like a standard inventory and made to be easily used with job runs. Organization administrators have admin permission to inventories in their organization and can create Smart Inventories. A Smart Inventory is identified by KIND=smart
. You can define a Smart Inventory using the same method being used with Tower Search. InventorySource
is directly associated with an Inventory.
Inventory
模型具有以下新字段,这些字段默认为空白,但会针对智能清单进行相应的设置:
对于智能清单,kind
会设置为 smart
对于智能清单,会设置 host_filter
且 kind
会设置为 smart
。
host
模型具有一个相关的端点 smart_inventories
,用于标识主机所关联的所有智能清单的集合。每次针对智能清单运行作业时,都会更新成员资格表。
注解
要更频繁地更新成员资格,您可以将基于文件的设置 AWX_REBUILD_SMART_MEMBERSHIP
更改为 **True**(默认为 False)。这将在以下事件中更新成员资格:
添加了新主机
修改(更新或删除)了现有主机
添加了新智能清单
修改(更新或删除)了现有智能清单
您可以查看实际清单而无需变为可编辑状态:
清单源同步后创建的主机和组的名称
组记录无法编辑或移动
您无法像普通清单一样从智能清单主机端点 (/inventories/N/hosts/
) 创建主机。智能清单的管理员有权限编辑名称、描述、变量和删除功能等字段,但没有修改 host_filter
的权限,因为这会影响智能清单中包含哪些主机(在另一个清单中具有主要成员资格)。请注意,host_filter
只适用于智能清单所属机构内的清单内主机。
若要修改 host_filter
,您需要成为清单所属机构的机构管理员。机构管理员已经具有对机构内所有清单的隐式“管理员”访问权限,因此,这不会使他们具有尚未拥有的任何权限。
智能清单管理员可以授予其他用户(不是您机构的管理员的用户)权限,如对智能清单的“使用”、“临时”权限,这些权限将允许执行角色所指示的操作,就像其他标准清单一样。但是,这不会赋予他们对(位于不同清单中的)主机的任何特殊权限。它不赋予他们对主机的直接读取权限,或允许他们看到 /#/hosts/
下的其他主机,虽然他们仍然可以查看智能清单主机列表下的主机。
在有些情况下,您可以修改以下内容:
在包含清单源的清单上手动创建的新主机
在清单源同步后创建的组中
主机和组上的变量可更改
与智能清单关联的主机会在查看时显示。如果智能清单的结果包含多个具有相同主机名的主机,则只会包含一个匹配的主机作为智能清单的一部分,按主机 ID 排序。
Inventory updates use dynamically-generated YAML files which are parsed by their respective inventory plugin. In Automation Controller Version 4.0.0, users can provide the new style inventory plugin config directly to Tower via the inventory source source_vars
for all the following inventory sources:
Newly created configurations for inventory sources will contain the default plugin configuration values. If you want your newly created inventory sources in 3.8 to match the output of a 3.7 source, you must apply a specific set of configuration values for that source. To ensure backward compatibility, Tower uses "templates" for each of these sources to force the output of inventory plugins into the legacy format. Refer to Supported Inventory Plugin Templates section of this guide for each source and their respective templates to help you migrate to the new style inventory plugin output.
在运行时会根据 InventorySource
源,把包括了``plugin: foo.bar.baz`` 作为顶层键的 source_vars
替换为正确的、完全限定的清单插件名称。例如,如果 InventorySource
为 ec2,则在运行时会将插件设置为 amazon.aws.aws_ec2
。
添加新清单涉及几个组件。请在下方点击以跳到特定的组件:
要创建新清单或智能清单,请执行以下操作:
Click the Add button, and select the type of inventory to create.
清单的类型由创建表单顶部的标签和标签页行来标识。
在以下字段中输入相关信息:
Name:输入适合此清单的名称。
Description:根据需要输入任意描述(可选)。
Organization:必需。在可用机构中进行选择。
Smart Host Filter:(仅适用于智能清单)点击 按钮,打开单独的 Dynamic Hosts 窗口对此清单的主机进行过滤。这些选项基于您选择的机构。
过滤器与标签类似,因为标签用于过滤某些包含这些名称的主机。因此,要填充 Smart Host Filter 字段,您需要指定包含您所需主机的标签,而不是实际选择主机本身。请在 Search 字段中输入标签,然后按 [Enter] 键。过滤器区分大小写。如需了解更多信息,请参阅 智能主机过滤器 部分。
Instance Groups:点击 按钮以打开单独的窗口。选择要在其上面运行此清单的实例组。如果列表较长,请使用搜索功能来缩小选项范围。
Variables:要应用到此清单中所有主机的变量定义和值。使用 JSON 或 YAML 语法输入变量。使用单选按钮在两者之间切换。
完成后请点击 Save。
After Tower saves the new inventory, you can proceed with configuring permissions, groups, hosts, sources, and view completed jobs, if applicable to the type of inventory. For more instructions, refer to the subsequent sections.
In the Access tab, click the Add button.
Select a user or team to add and click Next
Select one or more users or teams from the list by clicking the check box(es) next to the name(s) to add them as members and click Next.
In this example, two users have been selected to be added.
Select the role(s) you want the selected user(s) or team(s) to have. Be sure to scroll down for a complete list of roles. Different resources have different options available.
Click the Save button to apply the roles to the selected user(s) or team(s) and to add them as members.
The Add Users/Teams window closes to display the updated roles assigned for each user and team.
To remove roles for a particular user, click the disassociate (x) button next to its resource.
这会出现确认对话框,要求您确认解除关联。
清单被分成若干组,这些组可能包含主机和其他组以及主机。组只适用于标准清单,而且无法直接通过智能清单进行配置。您可以通过与标准清单搭配使用的主机来关联现有的组。有几个操作可用于标准清单:
创建新组
创建新主机
在所选清单上运行命令
编辑清单属性
查看组和主机的活动流
获取构建清单的帮助
注解
清单源不再与组关联。在以前的版本中,生成的组和主机是清单源组的子级。现在,生成的组为顶层。这些组可能仍然有子组,且所有这些生成的组都可能含有主机。
要为清单创建新组,请执行以下操作:
Click the Add button to open the Create Group window.
在必填和可选字段中输入相关详情:
Name:(必需)
Description:根据需要输入任意描述(可选)
Variables:输入要应用到此组中所有主机的定义和值。使用 JSON 或 YAML 语法输入变量。使用单选按钮在两者之间切换。
完成后,点击 保存。
要在组内添加组,请执行以下操作:
点击 Groups 标签页。
Click the Add button, and select whether to add a group that already exists in your configuration or create a new group.
如果创建新组,请在必填和可选字段中输入相关详情:
Name:(必需)
Description:根据需要输入任意描述(可选)
Variables:输入要应用到此组中所有主机的定义和值。使用 JSON 或 YAML 语法输入变量。使用单选按钮在两者之间切换。
完成后,点击 保存。
Create Group 窗口关闭,在为之创建了新组的组所关联的组列表中,新创建的组会显示为一个条目。
如果您选择了添加现有组,可用组将出现在单独的选择窗口中。
选择了一个组之后,它将在与组关联的组列表中显示为一个条目。
5. To configure additional groups and hosts under the subgroup, click on the name of the subgroup from the list of groups and repeat the same steps described in this section.
从 automation controller 3.5 开始,您可以一次查看所有清单组,或者在过滤后仅显示根组。如果清单组不是另一个组的子集,则被视为根组。
You may be able to delete a subgroup without concern for dependencies, but if you want to delete a root group, Tower will look for dependencies such as any child groups or hosts. If the root group you want to delete has both, a confirmation dialog displays for you to choose whether to delete the root group and all of its subgroups and hosts; or promote the subgroup(s) so they become the top-level inventory group(s), along with their host(s).
如果根组有一个没有任何主机的子组,则确认对话框会只询问您是要删除所有内容,还是否提升您的组。
您可以为清单以及组和组内的组配置主机。要配置主机,请执行以下操作:
点击 Hosts 标签页。
Click the Add button, and select whether to add a host that already exists in your configuration or create a new host.
如果创建新主机,请选择 按钮指定是否在运行作业时包含这个主机。
在必填和可选字段中输入相关详情:
Host Name:(必需)
Description:根据需要输入任意描述(可选)
Variables:输入要应用到此组中所有主机的定义和值。使用 JSON 或 YAML 语法输入变量。使用单选按钮在两者之间切换。
完成后,点击 保存。
Create Host 窗口关闭,在为之创建了新主机的组所关联的组列表中,新创建的主机会显示为一个条目。
注解
您也可以在此屏幕中运行临时命令。更多详情请参阅 运行临时(Ad Hoc)命令。
如果您选择了添加现有主机,可用主机将出现在单独的选择窗口中。
选择了一个主机之后,它将在与组关联的主机列表中显示为一个条目。
6. To configure facts and additional groups for the host, click on the name of the host from the list of hosts.
这会打开所选主机的 Details 标签页。
点击 Facts 标签页输入您想收集的事实。有关事实的更多信息,请参阅 事实缓存 部分。
点击 Groups 标签页为主机配置组。
Click the Add button to associate the host with an existing group.
可用的组会出现在单独的选择窗口中。
点击以选择与主机关联的组,然后点击 Save。
关联了一个组之后,它将在与主机关联的组列表中显示为一个条目。
如果使用了某个主机来运行作业,您可以在此主机的 Completed Jobs 标签页中查看这些作业的详情,并点击 Expanded 查看每个作业的详情。
清单源不再与组关联。在 automation controller 3.2 之前,生成的组和主机是我们的清单源组的子级。现在,生成的组为顶层。这些组可能仍然有子组,且所有这些生成的组都可能含有主机。
在清单中添加源只适用于标准清单。智能清单会从与其关联的标准清单中继承其源。要配置清单的源,请执行以下操作:
在您要添加源的清单中,点击**Sources** 标签。
Click the Add button.
这会打开 Create Source 窗口。
在必填和可选字段中输入相关详情:
Name:(必需)
Description:根据需要输入任意描述(可选)
Source:为您的清单选择一个源。请参阅 清单源 部分,以了解有关每个源的更多信息以及用于输入适当信息的详情。从 automation controller 版本 3.2 开始,不再支持 Rackspace Cloud Servers。
Ansible Environment:只有在设置自定义虚拟环境 (venvs) 时才会出现此字段。请选择您要用来运行清单导入的 venv。有关设置自定义 venv 的详情,请参阅 Using virtualenv with Ansible Tower。
为所选 inventory source 提供了所需的信息后,可以继续指定其他可选的常规参数,如详细程度、主机过滤器和变量。
注解
在 automation controller 3.8 中已删除了 Regions、Instance Filters 和 Only Group By 字段。
从 Verbosity 下拉菜单中选择清单源更新作业的适当输出级别。
Use the Host Filter field to specify only matching host names to be imported into Tower.
In the Enabled Variable, specify Tower to retrieve the enabled state from the given dictionary of host variables. The enabled variable may be specified using dot notation as 'foo.bar', in which case the lookup will traverse into nested dicts, equivalent to: from_dict.get('foo', {}).get('bar', default)
.
如果在 Enabled Variable 字段中指定了主机变量字典,则可以提供一个值来在导入时启用。例如,如果 enabled_var='status.power_state'
和 enabled_value='powered_on'
带有以下主机变量,则主机会被标记为启用:
{ "status": { "power_state": "powered_on", "created": "2020-08-04T18:13:04+00:00", "healthy": true }, "name": "foobar", "ip_address": "192.168.2.1" }If
power_state
were any value other thanpowered_on
, then the host would be disabled when imported into Tower. If the key is not found, then the host will be enabled.
所有云清单源都有以下更新选项:
Overwrite: If checked, any hosts and groups that were previously present on the external source but are now removed, will be removed from the Tower inventory. Hosts and groups that were not managed by the inventory source will be promoted to the next manually created group, or if there is no manually created group to promote them into, they will be left in the "all" default group for the inventory.
如果没有选中,外部源上没有的本地子主机和组将在清单更新过程中保持不变。
Overwrite Variables:如果选中,子组和主机的所有变量都将被删除,并替换为外部源上的变量。如果没有选择,就会执行合并,将本地变量与外部源上的变量合并。
Update on Launch:每次使用此清单运行作业时,在执行作业任务前从所选源中刷新清单。如果作业的生成速度快于清单的同步速度,为了避免作业溢出,可以选择此选项来配置一个 Cache Timeout,以将之前的清单同步缓存几秒钟。
The "Update on Launch" setting refers to a dependency system for projects and inventory, and it will not specifically exclude two jobs from running at the same time. If a cache timeout is specified, then the dependencies for the second job is created and it uses the project and inventory update that the first job spawned. Both jobs then wait for that project and/or inventory update to finish before proceeding. If they are different job templates, they can then both start and run at the same time, if the system has the capacity to do so. If you intend to use Tower's provisioning callback feature with a dynamic inventory source, "Update on Launch" should be set for the inventory group.
检查您的条目和选择,完成后点击 Save。这时您可以配置附加详情,如通知和计划。
注解
Notifications 标签页只有在您保存新创建的源后才会显示。
要为源配置通知,请点击 Notifications 标签页。
要配置与这个清单源关联的调度,请点击 Schedules 标签页。
如果已经设置了调度,请检查、编辑或启用/禁用您的调度首选项。
如果还没有设置调度,请参阅 调度 了解更多信息。
检查您的条目和选择,完成后点击 Save。
一旦定义了源,它便会在与清单关联的源列表中显示为一个条目。在 Sources 标签页中,您可以对单个源执行同步,或同时同步所有源。您也可以执行其他操作,如调度同步过程,以及编辑或删除源。
选择与可以作为主机输入的清单类型匹配的源:
An inventory that is sourced from a project means that is uses the SCM type from the project it is tied to. For example, if the project's source is from GitHub, then the inventory will use the same source.
要配置源于项目的清单,请从 Source 字段中选择 Sourced from a Project。
Create Source 窗口会展开更多字段。请输入以下详情:
Credential:指定用于此源的凭证(可选)。
Project:必需。指定此清单使用的项目作为其源。点击 按钮以从项目列表中进行选择。如果列表较长,请使用搜索功能来缩小选项范围。
Inventory File:必需。选择与源项目关联的清单文件。如果尚未填充,则可以将其键入到下拉菜单中的文本字段,以过滤无关的文件类型。除了平面文件清单外,您还可以指向目录或清单脚本。
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
除了可用于云清单源的更新选项外,您还可以指定是否在项目更改后进行更新。请选中 Update on Project Update 选项,以在因 SCM 修订版本变更进行每次项目更新后从所选源中刷新清单,再执行作业任务。如需了解更多详情,请参阅 Automation Controller Administration Guide 中的 Update on Project Update。
要传递到自定义清单脚本,您可以选择性地在 Environment Variables 字段中设置环境变量。
注解
If you are executing a custom inventory script from SCM, please make sure you set the execution bit (i.e. chmod +x
) on the script in your upstream source control. If you do not, Tower will throw a [Errno 13] Permission denied
error upon execution.
要配置源于 AWS EC2 的清单,请从 Source 字段中选择 Amazon EC2。
Create Source 窗口会展开更多字段。请输入以下详情:
Credential: Optionally choose from an existing AWS credential (for more information, refer to 凭证).
If Tower is running on an EC2 instance with an assigned IAM Role, the credential may be omitted, and the security credentials from the instance metadata will be used instead. For more information on using IAM Roles, refer to the IAM_Roles_for_Amazon_EC2_documentation_at_Amazon.
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Source Variables field to override variables used by the aws_ec2
inventory plugin. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two. For a detailed description of these variables, view the aws_ec2 inventory plugin documenation.
要配置源于 Google 的清单,请从 Source 字段中选择 Google Compute Engine。
The Create Source window expands with the required Credential field. Choose from an existing GCE Credential. For more information, refer to 凭证.
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Source Variables field to override variables used by the gcp_compute
inventory plugin. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two. For a detailed description of these variables, view the gcp_compute inventory plugin documenation.
要配置源于 Azure Resource Manager 的清单,请从 Source 字段中选择 Azure Resource Manager。
The Create Source window expands with the required Credential field. Choose from an existing Azure Credential. For more information, refer to 凭证.
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Source Variables field to override variables used by the azure_rm
inventory plugin. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two. For a detailed description of these variables, view the azure_rm inventory plugin documentation.
要配置源于 VMWare 的清单,请从 Source 字段中选择 VMware vCenter。
The Create Source window expands with the required Credential field. Choose from an existing VMware Credential. For more information, refer to 凭证.
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Source Variables field to override variables used by the vmware_inventory
inventory plugin. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two. For a detailed description of these variables, view the vmware_inventory inventory plugin.
Starting with Ansible 2.9, VMWare properties have changed from lower case to camelCase. Tower provides aliases for the top-level keys, but lower case keys in nested properties have been discontinued. For a list of valid and supported properties starting with Ansible 2.9, refer to the primary documentation for hostvars from VMWare inventory imports in GitHub.
要配置源于 Red Hat Satellite 的清单,请从 Source 字段中选择 Red Hat Satellite。
The Create Source window expands with the required Credential field. Choose from an existing Satellite Credential. For more information, refer to 凭证.
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Source Variables field to override variables used by the foreman
inventory plugin. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two. For a detailed description of these variables, view the foreman inventory plugin.
To configure a Red Hat Insights-sourced inventory, select Red Hat Insights from the Source field.
The Create Source window expands with the required Credential field. Choose from an existing Insights Credential. For more information, refer to 凭证.
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Source Variables field to override variables used by the insights
inventory plugin. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two. For a detailed description of these variables, view the insights inventory plugin.
要配置源于 OpenStack 的清单,请从 Source 字段中选择 OpenStack。
The Create Source window expands with the required Credential field. Choose from an existing OpenStack Credential. For more information, refer to 凭证.
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Source Variables field to override variables used by the openstack
inventory plugin. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two. For a detailed description of these variables, view the openstack inventory plugin.
要配置源于 Red Hat Virtualization 的清单,请从 Source 字段中选择 Red Hat Virtualization。
The Create Source window expands with the required Credential field. Choose from an existing Red Hat Virtualization Credential. For more information, refer to 凭证.
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Source Variables field to override variables used by the ovirt
inventory plugin. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two. For a detailed description of these variables, view the ovirt inventory plugin.
注解
Red Hat Virtualization(ovirt)清单源请求默认是安全的。要更改此默认设置,在 source_variables
中将键 ovirt_insecure
设置为 true,这只在 /api/v2/inventory_sources/N/
端点中的清单源 API 详情中可用。
To configure a automation controller-sourced inventory, select Ansible Tower from the Source field.
The Create Source window expands with the required Credential field. Choose from an existing Ansible Automation Platform Credential. For more information, refer to 凭证.
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Source Variables field to override variables used by the controller
inventory plugin. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two. For a detailed description of these variables, view the controller inventory plugin.
Tower allows you to use a custom dynamic inventory script, if your administrator has added one.
To configure a Custom Script-sourced inventory, select Custom Script from the Source field.
Create Source 窗口会展开更多字段。请输入以下详情:
您还可以选择指定详细程度、主机过滤器、启用的变量/值和更新选项,如 adding a source 中所述。
Use the Environment Variables field to set variables in the environment to be used by the inventory update script. The variables would be specific to the script that you have written. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.
For more information on syncing or using custom inventory scripts, refer to 自定义清单脚本 in the Automation Controller Administration Guide.
如果使用了某个清单来运行作业,您可以在此清单的 Completed Jobs 标签页中查看这些作业的详情,并点击 Expanded 查看每个作业的详情。
您可以使用搜索过滤器为一个清单填充主机。此功能使用了事实搜索功能。
Facts generated by an Ansible playbook during a Job Template run are stored by Tower into the database whenever use_fact_cache=True
is set per-Job Template. New facts are merged with existing facts and are per-host. These stored facts can be used to filter hosts via the /api/v2/hosts
endpoint, using the GET
query parameter host_filter
For example: /api/v2/hosts?host_filter=ansible_facts__ansible_processor_vcpus=8
host_filter
参数允许以下操作:
通过 () 进行分组
使用布尔值和运算符:
__
用于引用关系字段中的相关字段
__
在 ansible_facts 上用于分离 JSON 键路径中的键
[]
用于表示路径规格中的 json 数组
""
可在值中需要空格时用于值中
"classic" Django 查询可以嵌入到 host_filter
中
示例:
/api/v2/hosts/?host_filter=name=localhost
/api/v2/hosts/?host_filter=ansible_facts__ansible_date_time__weekday_number="3"
/api/v2/hosts/?host_filter=ansible_facts__ansible_processor[]="GenuineIntel"
/api/v2/hosts/?host_filter=ansible_facts__ansible_lo__ipv6[]__scope="host"
/api/v2/hosts/?host_filter=ansible_facts__ansible_processor_vcpus=8
/api/v2/hosts/?host_filter=ansible_facts__ansible_env__PYTHONUNBUFFERED="true"
/api/v2/hosts/?host_filter=(name=localhost or name=database) and (groups__name=east or groups__name="west coast") and ansible_facts__an
您可以按主机名、组名称和 Ansible 事实来搜索 host_filter
。
组搜索的格式为:
groups.name:groupA
事实搜索的格式为:
ansible_facts.ansible_fips:false
您还可以执行包含主机名和主机描述的智能搜索。
host_filter=name=my_host
If a search term in host_filter
is of string type, to make the value a number (e.g. 2.66
), or a JSON keyword (e.g. null
, true
or false
) valid, add double quotations around the value to prevent Tower from mistakenly parsing it as a non-string:
host_filter=ansible_facts__packages__dnsmasq[]__version="2.66"
要运行临时命令,请执行以下操作:
从主机或组列表中选择清单源。该清单源可以是单个组或主机,也可以是特定的多个主机或特定的多个组。
点击 按钮。
Execute Command 窗口将打开。
输入以下字段的详情:
Module: Select one of the modules that Tower supports running commands against.
命令 |
apt_repository |
mount |
win_service |
shell |
apt_rpm |
ping |
win_updates |
yum |
service |
selinux |
win_group |
apt |
group |
setup |
win_user |
apt_key |
user |
win_ping |
Arguments:提供要与您选择的模块搭配使用的参数。
Limit:输入用于确定清单中的目标主机的限制。要将清单中的所有主机作为目标,请输入 all
或 *
,或将该字段留空。该字段将自动填充在点击启动按钮之前的上一个视图中选择的内容。
Machine Credential:选择要在访问远程主机时用来运行命令的凭证。选择包含 Ansbile 登录远程主机所需的用户名和 SSH 密钥或密码的凭证。
Verbosity:选择标准输出的详细程度。
Forks:如果需要,请选择执行命令时使用的并行或同步进程数量。
Show Changes:选择此项可在标准输出中显示 Ansible 更改。默认值为 OFF。
Enable Privilege Escalation:如果启用此项,则会使用管理员权限运行 playbook。这等同于将 --become
选项传递给 ansible
命令。
Extra Variables:提供要在运行此清单时应用的额外命令行变量。使用 JSON 或 YAML 语法输入变量.。用单选按钮在两者之间切换。
点击 按钮来运行这个临时命令。
结果会显示在 Details 窗格和 Standard Out 窗口中。