ansible.builtin.gcpubsub (v2.4.2.0-1) — module

Create and Delete Topics/Subscriptions, Publish and pull messages on PubSub.

| "added in version" 2.3 of ansible.builtin"

Authors: Tom Melendez (@supertom) <tom@supertom.com>

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.2.0.post1

Description

Create and Delete Topics/Subscriptions, Publish and pull messages on PubSub. See U(https://cloud.google.com/pubsub/docs) for an overview.


Requirements

Inputs

    
name:
    description: Subfield of subscription. Required if subscription is specified. See
      examples.
    required: false

pull:
    description:
    - Subfield of subscription. Not required. If specified, messages will be retrieved
      from topic via the provided subscription name. max_messages (int; default None;
      max number of messages to pull), message_ack (bool; default False; acknowledge the
      message) and return_immediately (bool; default True, don't wait for messages to
      appear). If the messages are acknowledged, changed is set to True, otherwise, changed
      is False.

state:
    default: present
    description:
    - State of the topic or queue (absent, present). Applies to the most granular resource.
      Remove the most granular resource.  If subcription is specified we remove it.  If
      only topic is specified, that is what is removed. Note that a topic can be removed
      without first removing the subscription.
    required: false

topic:
    description:
    - GCP pubsub topic name.  Only the name, not the full path, is required.
    required: true

publish:
    description:
    - List of dictionaries describing messages and attributes to be published.  Dictionary
      is in message(str):attributes(dict) format. Only message is required.
    required: false

ack_deadline:
    description: Subfield of subscription. Not required. Default deadline for subscriptions
      to ACK the message before it is resent. See examples.
    required: false

subscription:
    description:
    - Dictionary containing a subscripton name associated with a topic (required), along
      with optional ack_deadline, push_endpoint and pull. For pulling from a subscription,
      message_ack (bool), max_messages (int) and return_immediate are available as subfields.
      See subfields name, push_endpoint and ack_deadline for more information.
    required: false

push_endpoint:
    description:
    - Subfield of subscription.  Not required.  If specified, message will be sent to
      an endpoint. See U(https://cloud.google.com/pubsub/docs/advanced#push_endpoints)
      for more information.
    required: false

Outputs

publish:
  description: List of dictionaries describing messages and attributes to be published.  Dictionary
    is in message(str):attributes(dict) format. Only message is required.
  returned: Only when specified
  sample: 'publish: [''message'': ''my message'', attributes: {''key1'': ''value1''}]'
  type: list
pulled_messages:
  description: list of dictionaries containing message info.  Fields are ack_id, attributes,
    data, message_id.
  returned: Only when subscription.pull is specified
  sample:
  - ack_id: XkASTCcYREl...
    attributes:
      '...': null
      key1: val1
    data: this is message 1
    message_id: '49107464153705'
  - ..
  type: list
state:
  description: The state of the topic or subscription. Value will be either 'absent'
    or 'present'.
  returned: Always
  sample: present
  type: str
subscription:
  description: Name of subscription.
  returned: When subscription fields are specified
  sample: mysubscription
  type: str
topic:
  description: Name of topic.
  returned: Always
  sample: mytopic
  type: str