community.general.bigpanda 模块 – 通知 BigPanda 关于部署

注意

此模块是 community.general 集合(版本 10.1.0)的一部分。

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

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

要在剧本中使用它,请指定: community.general.bigpanda

概要

  • 在部署开始和结束时(成功或失败)通知 BigPanda。返回一个包含未来模块调用所有参数的部署对象。

参数

参数

注释

组件

别名:名称

字符串 / 必需

正在部署的组件的名称。例如:计费

deployment_message

字符串

在 community.general 0.2.0 中添加

有关部署的消息。

描述

字符串

部署的自由文本描述。

环境

字符串

环境名称,通常为“production”、“staging”等。

主机

别名:主机

字符串

受影响主机名称的名称。可以是列表。

如果未指定,则默认为远程系统的主机名。

所有者

字符串

负责部署的人员。

源系统

字符串

在对 API 的请求中使用的源系统

默认值: "ansible"

状态

字符串 / 必需

部署的状态。

选项

  • "started"

  • "finished"

  • "failed"

令牌

字符串 / 必需

API 令牌。

网址

字符串

API 服务器的基本 URL。

默认值: "https://api.bigpanda.io"

validate_certs

布尔值

如果为 false,则不会验证目标 URL 的 SSL 证书。这仅应在个人控制的使用自签名证书的站点上使用。

选项

  • false

  • true ←(默认)

版本

字符串 / 必需

部署版本。

属性

属性

支持

描述

check_mode

支持:完全

可以在 check_mode 中运行,并在不修改目标的情况下返回更改状态预测。

diff_mode

支持:

在差异模式下运行时,将返回有关已更改内容(或可能需要在 check_mode 中更改的内容)的详细信息。

示例

- name: Notify BigPanda about a deployment
  community.general.bigpanda:
    component: myapp
    version: '1.3'
    token: '{{ bigpanda_token }}'
    state: started

- name: Notify BigPanda about a deployment
  community.general.bigpanda:
    component: myapp
    version: '1.3'
    token: '{{ bigpanda_token }}'
    state: finished

# If outside servers aren't reachable from your machine, use delegate_to and override hosts:
- name: Notify BigPanda about a deployment
  community.general.bigpanda:
    component: myapp
    version: '1.3'
    token: '{{ bigpanda_token }}'
    hosts: '{{ ansible_hostname }}'
    state: started
  delegate_to: localhost
  register: deployment

- name: Notify BigPanda about a deployment
  community.general.bigpanda:
    component: '{{ deployment.component }}'
    version: '{{ deployment.version }}'
    token: '{{ deployment.token }}'
    state: finished
  delegate_to: localhost

作者

  • Hagai Kariti (@hkariti)