awx.awx.organization 模块 – 创建、更新或销毁 Automation Platform Controller 组织

注意

此模块是 awx.awx 集合 (版本 24.6.1) 的一部分。

如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install awx.awx

要在 playbook 中使用它,请指定:awx.awx.organization

概要

别名:tower_organization

参数

参数

注释

controller_config_file

别名:tower_config_file

路径

控制器配置文件的路径。

如果提供,则不会考虑其他配置文件位置。

controller_host

别名:tower_host

字符串

您 Automation Platform Controller 实例的 URL。

如果未设置值,将尝试使用环境变量 CONTROLLER_HOST,然后是配置文件。

如果任何方式都没有指定值,则将使用 127.0.0.1 的值。

controller_oauthtoken

别名:tower_oauthtoken

任意

在 awx.awx 3.7.0 中添加

要使用的 OAuth 令牌。

此值可以采用两种格式之一。

一个字符串,即令牌本身。(即 bqV5txm97wqJqtkxlMkhQz0pKhRMMX)

令牌模块返回的字典结构。

如果未设置值,将尝试使用环境变量 CONTROLLER_OAUTH_TOKEN,然后是配置文件。

controller_password

别名:tower_password

字符串

控制器实例的密码。

如果未设置值,将尝试使用环境变量 CONTROLLER_PASSWORD,然后是配置文件。

controller_username

别名:tower_username

字符串

控制器实例的用户名。

如果未设置值,将尝试使用环境变量 CONTROLLER_USERNAME,然后是配置文件。

custom_virtualenv

字符串

包含要使用的自定义 Python virtualenv 的本地绝对文件路径。

仅与较旧版本的 AWX/Tower 兼容

已弃用,将来会被删除

default_environment

字符串

要用于组织拥有的作业的默认执行环境名称、ID 或命名 URL。

description

字符串

要用于组织的描述。

galaxy_credentials

列表 / 元素=字符串

要与组织关联的 Ansible Galaxy 凭据名称、ID 或命名 URL 列表

instance_groups

列表 / 元素=字符串

此组织要在其上运行的实例组名称、ID 或命名 URL 列表。

max_hosts

整数

此组织允许的最大主机数

name

字符串 / 必需

要用于组织的名称。

new_name

字符串

设置此选项将更改现有名称(通过名称字段查找)。

notification_templates_approvals

列表 / 元素=字符串

启动时要发送的通知列表

notification_templates_error

列表 / 元素=字符串

出错时要发送的通知列表

notification_templates_started

列表 / 元素=字符串

启动时要发送的通知列表

notification_templates_success

列表 / 元素=字符串

成功时要发送的通知列表

request_timeout

浮点数

指定 Ansible 应在对控制器主机请求中使用的超时时间。

默认为 10 秒,但这由共享的 module_utils 代码处理。

state

字符串

资源的所需状态。

选项

  • "present" ← (默认)

  • "absent"

  • "exists"

validate_certs

别名:tower_verify_ssl

布尔值

是否允许与 AWX 进行不安全连接。

如果为 no,则不会验证 SSL 证书。

这仅应在使用自签名证书的个人控制站点上使用。

如果未设置值,将尝试使用环境变量 CONTROLLER_VERIFY_SSL,然后是配置文件。

选项

  • false

  • true

备注

注意

  • 如果没有提供 *config_file*,我们将尝试使用 tower-cli 库默认值来查找您的主机信息。

  • *config_file* 应采用以下格式:host=hostname username=username password=password

示例

- name: Create organization
  organization:
    name: "Foo"
    description: "Foo bar organization"
    state: present
    controller_config_file: "~/tower_cli.cfg"

- name: Create organization using 'foo-venv' as default Python virtualenv
  organization:
    name: "Foo"
    description: "Foo bar organization using foo-venv"
    state: present
    controller_config_file: "~/tower_cli.cfg"

- name: Create organization that pulls content from galaxy.ansible.com
  organization:
    name: "Foo"
    state: present
    galaxy_credentials:
      - Ansible Galaxy
    controller_config_file: "~/tower_cli.cfg"

作者

  • Wayne Witzel III (@wwitzel3)