搜索

2.4. hammer ansible

download PDF

管理 foreman ansible

Usage:
    hammer ansible [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 roles                         Manage ansible roles
 variables                     Manage ansible variables

Options:
 -h, --help                    Print help

2.4.1. hammer ansible 角色

管理 ansible 角色

Usage:
    hammer ansible roles [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 delete, destroy               Deletes Ansible role
 fetch                         Fetch Ansible roles available to be synced
 import                        DEPRECATED: Import Ansible roles
 info, show                    Show role
 list, index                   List Ansible roles
 obsolete                      DEPRECATED: Obsolete Ansible roles
 play-hostgroups               Runs all Ansible roles on hostgroups
 play-hosts                    Runs all Ansible roles on hosts
 sync                          Sync Ansible roles

Options:
 -h, --help                    Print help

2.4.1.1. hammer ansible 角色删除

删除 Ansible 角色

Usage:
    hammer ansible roles <delete|destroy> [OPTIONS]

Options:
 --id ID
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --name NAME                             Name to search by
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 -h, --help                              Print help

2.4.1.2. hammer ansible 角色获取

获取可用于同步的 Ansible 角色

Usage:
    hammer ansible roles fetch [OPTIONS]

Options:
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 --proxy-id PROXY_ID                     Capsule to fetch from
 -h, --help                              Print help

2.4.1.3. hammer ansible 角色导入

DEPRECATED: 导入 Ansible 角色

Usage:
    hammer ansible roles import [OPTIONS]

Options:
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 --proxy-id PROXY_ID                     Capsule to import from
 --role-names ROLE_NAMES                 Ansible role names to be imported
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 -h, --help                              Print help

2.4.1.4. hammer ansible 角色信息

show role

Usage:
    hammer ansible roles <info|show> [OPTIONS]

Options:
 --fields FIELDS                         Show specified fields or predefined field sets only. (See below)
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --id ID
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --name NAME                             Name to search by
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 -h, --help                              Print help

Predefined field sets:
  ------------|-----|---------|-----
  FIELDS      | ALL | DEFAULT | THIN
  ------------|-----|---------|-----
  Id          | x   | x       | x
  Name        | x   | x       | x
  Imported at | x   | x       |
  ------------|-----|---------|-----

2.4.1.5. hammer ansible 角色列表

列出 Ansible 角色

Usage:
    hammer ansible roles <list|index> [OPTIONS]

Options:
 --fields FIELDS                         Show specified fields or predefined field sets only. (See below)
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --order ORDER                           Sort field and order, eg. ‘id DESC’
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 --page PAGE                             Page number, starting at 1
 --per-page PER_PAGE                     Number of results per page to return, 'all' to return all results
 --search SEARCH                         Filter results
 -h, --help                              Print help

Predefined field sets:
  ------------|-----|---------|-----
  FIELDS      | ALL | DEFAULT | THIN
  ------------|-----|---------|-----
  Id          | x   | x       | x
  Name        | x   | x       | x
  Imported at | x   | x       |
  ------------|-----|---------|-----

Search / Order fields:
  host                string
  host_id             integer
  hostgroup           string
  hostgroup_id        integer
  id                  integer
  name                string
  updated_at          datetime

2.4.1.6. hammer ansible 角色已过时

DEPRECATED: Obsolete Ansible 角色

Usage:
    hammer ansible roles obsolete [OPTIONS]

Options:
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 --proxy-id PROXY_ID                     Capsule to import from
 -h, --help                              Print help

2.4.1.7. hammer ansible 角色 play-hostgroups

在 hostgroups 上运行所有 Ansible 角色

Usage:
    hammer ansible roles play-hostgroups [OPTIONS]

Options:
 --hostgroup-ids HOSTGROUP_IDS           IDs of hostgroups to play roles on
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --hostgroup-titles HOSTGROUP_TITLES     Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --hostgroups HOSTGROUP_NAMES            Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 -h, --help                              Print help

2.4.1.8. hammer ansible 角色 play-hosts

在主机上运行所有 Ansible 角色

Usage:
    hammer ansible roles play-hosts [OPTIONS]

Options:
 --host-ids HOST_IDS                     IDs of hosts to play roles on
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --hosts HOST_NAMES                      Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 -h, --help                              Print help

2.4.1.9. hammer ansible 角色同步

同步 Ansible 角色

Usage:
    hammer ansible roles sync [OPTIONS]

Options:
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 --proxy-id PROXY_ID                     Capsule to sync from
 --role-names ROLE_NAMES                 Ansible role names to be synced
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 -h, --help                              Print help

2.4.2. hammer ansible 变量

管理 ansible 变量

Usage:
    hammer ansible variables [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 add-matcher                   Create an override value for a specific ansible variable
 create                        Create Ansible variable
 delete, destroy               Deletes Ansible variable
 import                        DEPRECATED: Import Ansible variables. This will only import variables for already existing roles, it will not import any new roles
 info, show                    Show variable
 list, index                   List Ansible variables
 obsolete                      DEPRECATED: Obsolete Ansible variables. This will only obsolete variables for already existing roles, it will not delete any old roles
 remove-matcher                Destroy an override value
 update                        Updates Ansible variable

Options:
 -h, --help                    Print help

2.4.2.1. hammer ansible 变量 add-matcher

为特定 ansible 变量创建覆盖值

Usage:
    hammer ansible variables add-matcher [OPTIONS]

Options:
 --ansible-variable ANSIBLE_VARIABLE_NAME  Name to search by
 --ansible-variable-id ANSIBLE_VARIABLE_ID
 --location LOCATION_NAME                  Set the current location context for the request
 --location-id LOCATION_ID                 Set the current location context for the request
 --location-title LOCATION_TITLE           Set the current location context for the request
 --match MATCH                             Override match
 --organization ORGANIZATION_NAME          Set the current organization context for the request
 --organization-id ORGANIZATION_ID         Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE   Set the current organization context for the request
 --value VALUE                             Override value, required if omit is false
 -h, --help                                Print help

2.4.2.2. hammer ansible 变量创建

创建 Ansible 变量

Usage:
    hammer ansible variables create [OPTIONS]

Options:
 --ansible-role ANSIBLE_ROLE_NAME            Name to search by
 --ansible-role-id ANSIBLE_ROLE_ID           Role ID
 --avoid-duplicates AVOID_DUPLICATES         Remove duplicate values (only array type)
                                             One of true/false, yes/no, 1/0.
 --default-value DEFAULT_VALUE               Default value of variable
 --description DESCRIPTION                   Description of variable
 --hidden-value HIDDEN_VALUE                 When enabled the parameter is hidden in the UI
                                             One of true/false, yes/no, 1/0.
 --location LOCATION_NAME                    Set the current location context for the request
 --location-id LOCATION_ID                   Set the current location context for the request
 --location-title LOCATION_TITLE             Set the current location context for the request
 --merge-default MERGE_DEFAULT               Include default value when merging all matching values
                                             One of true/false, yes/no, 1/0.
 --merge-overrides MERGE_OVERRIDES           Merge all matching values (only array/hash type)
                                             One of true/false, yes/no, 1/0.
 --organization ORGANIZATION_NAME            Set the current organization context for the request
 --organization-id ORGANIZATION_ID           Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE     Set the current organization context for the request
 --override OVERRIDE                         Whether to override variable or not
                                             One of true/false, yes/no, 1/0.
 --override-value-order OVERRIDE_VALUE_ORDER The order in which values are resolved
 --validator-rule VALIDATOR_RULE             Used to enforce certain values for the parameter values
 --validator-type VALIDATOR_TYPE             Types of validation values
                                             Possible value(s): 'regexp', 'list'
 --variable VARIABLE                         Name of variable
 --variable-type VARIABLE_TYPE               Types of variable values
                                             Possible value(s): 'string', 'boolean', 'integer', 'real', 'array', 'hash', 'yaml', 'json'
 -h, --help                                  Print help

2.4.2.3. hammer ansible 变量删除

删除 Ansible 变量

Usage:
    hammer ansible variables <delete|destroy> [OPTIONS]

Options:
 --id ID
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --name NAME                             Name to search by
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 -h, --help                              Print help

2.4.2.4. hammer ansible 变量导入

DEPRECATED :导入 Ansible 变量。这只会为已存在的角色导入变量,它不会导入任何新角色

Usage:
    hammer ansible variables import [OPTIONS]

Options:
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 --proxy-id PROXY_ID                     Capsule to import from
 -h, --help                              Print help

2.4.2.5. hammer ansible 变量信息

show 变量

Usage:
    hammer ansible variables <info|show> [OPTIONS]

Options:
 --fields FIELDS                         Show specified fields or predefined field sets only. (See below)
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --id ID
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --name NAME                             Name to search by
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 -h, --help                              Print help

Predefined field sets:
  ------------------------------------|-----|--------
  FIELDS                              | ALL | DEFAULT
  ------------------------------------|-----|--------
  Id                                  | x   | x
  Variable                            | x   | x
  Default value                       | x   | x
  Type                                | x   | x
  Role                                | x   | x
  Role id                             | x   | x
  Description                         | x   | x
  Hidden value?                       | x   | x
  Validator/type                      | x   | x
  Validator/rule                      | x   | x
  Override values/override            | x   | x
  Override values/merge overrides     | x   | x
  Override values/merge default value | x   | x
  Override values/avoid duplicates    | x   | x
  Override values/order               | x   | x
  Override values/values/id           | x   | x
  Override values/values/match        | x   | x
  Override values/values/value        | x   | x
  Created at                          | x   | x
  Updated at                          | x   | x
  ------------------------------------|-----|--------

2.4.2.6. hammer ansible 变量列表

列出 Ansible 变量

Usage:
    hammer ansible variables <list|index> [OPTIONS]

Options:
 --fields FIELDS                         Show specified fields or predefined field sets only. (See below)
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --order ORDER                           Sort field and order, eg. ‘id DESC’
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 --page PAGE                             Page number, starting at 1
 --per-page PER_PAGE                     Number of results per page to return, 'all' to return all results
 --search SEARCH                         Filter results
 -h, --help                              Print help

Predefined field sets:
  --------------|-----|--------
  FIELDS        | ALL | DEFAULT
  --------------|-----|--------
  Id            | x   | x
  Variable      | x   | x
  Default value | x   | x
  Type          | x   | x
  Role          | x   | x
  Role id       | x   | x
  --------------|-----|--------

Search / Order fields:
  ansible_role        string
  avoid_duplicates    Values: true, false
  imported            Values: true, false
  key                 string
  merge_default       Values: true, false
  merge_overrides     Values: true, false
  name                string
  override            Values: true, false
  parameter           string

2.4.2.7. hammer ansible 变量已过时

DEPRECATED: Obsolete Ansible 变量。这只会为已存在的角色提供过时的变量,它不会删除任何旧角色

Usage:
    hammer ansible variables obsolete [OPTIONS]

Options:
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 --proxy-id PROXY_ID                     Capsule to import from
 -h, --help                              Print help

2.4.2.8. hammer ansible 变量 remove-matcher

销毁覆盖值

Usage:
    hammer ansible variables remove-matcher [OPTIONS]

Options:
 --id ID
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --name NAME                             Name to search by
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 -h, --help                              Print help

2.4.2.9. hammer ansible 变量更新

更新 Ansible 变量

Usage:
    hammer ansible variables update [OPTIONS]

Options:
 --ansible-role ANSIBLE_ROLE_NAME            Name to search by
 --ansible-role-id ANSIBLE_ROLE_ID           Role ID
 --avoid-duplicates AVOID_DUPLICATES         Remove duplicate values (only array type)
                                             One of true/false, yes/no, 1/0.
 --default-value DEFAULT_VALUE               Default value of variable
 --description DESCRIPTION                   Description of variable
 --hidden-value HIDDEN_VALUE                 When enabled the parameter is hidden in the UI
                                             One of true/false, yes/no, 1/0.
 --id ID
 --location LOCATION_NAME                    Set the current location context for the request
 --location-id LOCATION_ID                   Set the current location context for the request
 --location-title LOCATION_TITLE             Set the current location context for the request
 --merge-default MERGE_DEFAULT               Include default value when merging all matching values
                                             One of true/false, yes/no, 1/0.
 --merge-overrides MERGE_OVERRIDES           Merge all matching values (only array/hash type)
                                             One of true/false, yes/no, 1/0.
 --name NAME                                 Name to search by
 --new-name NEW_NAME
 --organization ORGANIZATION_NAME            Set the current organization context for the request
 --organization-id ORGANIZATION_ID           Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE     Set the current organization context for the request
 --override OVERRIDE                         Whether to override variable or not
                                             One of true/false, yes/no, 1/0.
 --override-value-order OVERRIDE_VALUE_ORDER The order in which values are resolved
                                             Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                             JSON is acceptable and preferred way for complex parameters
 --validator-rule VALIDATOR_RULE             Used to enforce certain values for the parameter values
 --validator-type VALIDATOR_TYPE             Types of validation values
                                             Possible value(s): 'regexp', 'list'
 --variable VARIABLE                         Name of variable
 --variable-type VARIABLE_TYPE               Types of variable values
                                             Possible value(s): 'string', 'boolean', 'integer', 'real', 'array', 'hash', 'yaml', 'json'
 -h, --help                                  Print help
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.