azure.azcollection.azure_rm_servicebus_info (2.3.0) — module

Get servicebus facts

| "added in version" 0.1.2 of azure.azcollection"

Authors: Yuwei Zhou (@yuwzho)

Install collection

Install with ansible-galaxy collection install azure.azcollection:==2.3.0


Add to requirements.yml

  collections:
    - name: azure.azcollection
      version: 2.3.0

Description

Get facts for a specific servicebus or all servicebus in a resource group or subscription.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get all namespaces under a resource group
  azure_rm_servicebus_info:
    resource_group: myResourceGroup
    type: namespace
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get all topics under a namespace
  azure_rm_servicebus_info:
    resource_group: myResourceGroup
    namespace: bar
    type: topic
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get a single queue with SAS policies
  azure_rm_servicebus_info:
    resource_group: myResourceGroup
    namespace: bar
    type: queue
    name: sbqueue
    show_sas_policies: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get all subscriptions under a resource group
  azure_rm_servicebus_info:
    resource_group: myResourceGroup
    type: subscription
    namespace: bar
    topic: sbtopic

Inputs

    
name:
    description:
    - Limit results to a specific servicebus.
    type: str

tags:
    description:
    - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'.
    elements: str
    type: list

type:
    choices:
    - namespace
    - queue
    - topic
    - subscription
    description:
    - Type of the resource.
    required: true
    type: str

topic:
    description:
    - Topic name.
    - Required when I(type=subscription).
    type: str

secret:
    description:
    - Azure client secret. Use when authenticating with a Service Principal.
    type: str

tenant:
    description:
    - Azure tenant ID. Use when authenticating with a Service Principal.
    type: str

ad_user:
    description:
    - Active Directory username. Use when authenticating with an Active Directory user
      rather than service principal.
    type: str

profile:
    description:
    - Security profile found in ~/.azure/credentials file.
    type: str

log_mode:
    description:
    - Parent argument.
    type: str

log_path:
    description:
    - Parent argument.
    type: str

password:
    description:
    - Active Directory user password. Use when authenticating with an Active Directory
      user rather than service principal.
    type: str

client_id:
    description:
    - Azure client ID. Use when authenticating with a Service Principal or Managed Identity
      (msi).
    - Can also be set via the C(AZURE_CLIENT_ID) environment variable.
    type: str

namespace:
    description:
    - Servicebus namespace name.
    - A namespace is a scoping container for all messaging components.
    - Multiple queues and topics can reside within a single namespace, and namespaces
      often serve as application containers.
    - Required when I(type=namespace).
    type: str

thumbprint:
    description:
    - The thumbprint of the private key specified in I(x509_certificate_path).
    - Use when authenticating with a Service Principal.
    - Required if I(x509_certificate_path) is defined.
    type: str
    version_added: 1.14.0
    version_added_collection: azure.azcollection

api_profile:
    default: latest
    description:
    - Selects an API profile to use when communicating with Azure services. Default value
      of C(latest) is appropriate for public clouds; future values will allow use with
      Azure Stack.
    type: str
    version_added: 0.0.1
    version_added_collection: azure.azcollection

auth_source:
    choices:
    - auto
    - cli
    - credential_file
    - env
    - msi
    default: auto
    description:
    - Controls the source of the credentials to use for authentication.
    - Can also be set via the C(ANSIBLE_AZURE_AUTH_SOURCE) environment variable.
    - When set to C(auto) (the default) the precedence is module parameters -> C(env)
      -> C(credential_file) -> C(cli).
    - When set to C(env), the credentials will be read from the environment variables
    - When set to C(credential_file), it will read the profile from C(~/.azure/credentials).
    - When set to C(cli), the credentials will be sources from the Azure CLI profile.
      C(subscription_id) or the environment variable C(AZURE_SUBSCRIPTION_ID) can be used
      to identify the subscription ID if more than one is present otherwise the default
      az cli subscription is used.
    - When set to C(msi), the host machine must be an azure resource with an enabled MSI
      extension. C(subscription_id) or the environment variable C(AZURE_SUBSCRIPTION_ID)
      can be used to identify the subscription ID if the resource is granted access to
      more than one subscription, otherwise the first subscription is chosen.
    - The C(msi) was added in Ansible 2.6.
    type: str
    version_added: 0.0.1
    version_added_collection: azure.azcollection

resource_group:
    description:
    - Limit results in a specific resource group.
    type: str

subscription_id:
    description:
    - Your Azure subscription Id.
    type: str

cloud_environment:
    default: AzureCloud
    description:
    - For cloud environments other than the US public cloud, the environment name (as
      defined by Azure Python SDK, eg, C(AzureChinaCloud), C(AzureUSGovernment)), or a
      metadata discovery endpoint URL (required for Azure Stack). Can also be set via
      credential file profile or the C(AZURE_CLOUD_ENVIRONMENT) environment variable.
    type: str
    version_added: 0.0.1
    version_added_collection: azure.azcollection

show_sas_policies:
    description:
    - Whether to show the SAS policies.
    - Not support when I(type=subscription).
    - Note if enable this option, the facts module will raise two more HTTP call for each
      resources, need more network overhead.
    type: bool

adfs_authority_url:
    description:
    - Azure AD authority url. Use when authenticating with Username/password, and has
      your own ADFS authority.
    type: str
    version_added: 0.0.1
    version_added_collection: azure.azcollection

cert_validation_mode:
    choices:
    - ignore
    - validate
    description:
    - Controls the certificate validation behavior for Azure endpoints. By default, all
      modules will validate the server certificate, but when an HTTPS proxy is in use,
      or against Azure Stack, it may be necessary to disable this behavior by passing
      C(ignore). Can also be set via credential file profile or the C(AZURE_CERT_VALIDATION)
      environment variable.
    type: str
    version_added: 0.0.1
    version_added_collection: azure.azcollection

x509_certificate_path:
    description:
    - Path to the X509 certificate used to create the service principal in PEM format.
    - The certificate must be appended to the private key.
    - Use when authenticating with a Service Principal.
    type: path
    version_added: 1.14.0
    version_added_collection: azure.azcollection

disable_instance_discovery:
    default: false
    description:
    - Determines whether or not instance discovery is performed when attempting to authenticate.
      Setting this to true will completely disable both instance discovery and authority
      validation. This functionality is intended for use in scenarios where the metadata
      endpoint cannot be reached such as in private clouds or Azure Stack. The process
      of instance discovery entails retrieving authority metadata from https://login.microsoft.com/
      to validate the authority. By setting this to **True**, the validation of the authority
      is disabled. As a result, it is crucial to ensure that the configured authority
      host is valid and trustworthy.
    - Set via credential file profile or the C(AZURE_DISABLE_INSTANCE_DISCOVERY) environment
      variable.
    type: bool
    version_added: 2.3.0
    version_added_collection: azure.azcollection

Outputs

servicebuses:
  contains:
    accessed_at:
      description:
      - Last time the message was sent, or a request was received for this topic.
      returned: always
      sample: '2019-01-25 02:46:55.543953+00:00'
      type: str
    auto_delete_on_idle_in_seconds:
      description:
      - ISO 8061 timeSpan idle interval after which the  queue or topic is automatically
        deleted.
      - The minimum duration is 5 minutes.
      returned: always
      sample: true
      type: int
    count_details:
      contains:
        active_message_count:
          description:
          - Number of active messages in the C(queue), C(topic), or C(subscription).
          returned: always
          sample: 0
          type: int
        dead_letter_message_count:
          description:
          - Number of messages that are dead lettered.
          returned: always
          sample: 0
          type: int
        scheduled_message_count:
          description:
          - Number of scheduled messages.
          returned: always
          sample: 0
          type: int
        transfer_dead_letter_message_count:
          description:
          - Number of messages transferred into dead letters.
          returned: always
          sample: 0
          type: int
        transfer_message_count:
          description:
          - Number of messages transferred to another C(queue), C(topic), or C(subscription).
          returned: always
          sample: 0
          type: int
      description:
      - Message count details.
      returned: always
      type: complex
    created_at:
      description:
      - Exact time the message was created.
      returned: always
      sample: '2019-01-25 02:46:55.543953+00:00'
      type: str
    dead_lettering_on_filter_evaluation_exceptions:
      description:
      - Value that indicates whether a subscription has dead letter support on filter
        evaluation exceptions.
      returned: always
      sample: 0
      type: int
    dead_lettering_on_message_expiration:
      description:
      - A value that indicates whether this C(queue) or C(topic) has dead letter support
        when a message expires.
      returned: always
      sample: 0
      type: int
    default_message_time_to_live_seconds:
      description:
      - ISO 8061 Default message timespan to live value.
      - This is the duration after which the message expires, starting from when the
        message is sent to Service Bus.
      - This is the default value used when TimeToLive is not set on a message itself.
      returned: always
      sample: 0
      type: int
    duplicate_detection_time_in_seconds:
      description:
      - ISO 8601 timeSpan structure that defines the duration of the duplicate detection
        history.
      returned: always
      sample: 600
      type: int
    enable_batched_operations:
      description:
      - Value that indicates whether server-side batched operations are enabled.
      returned: always
      sample: true
      type: bool
    enable_express:
      description:
      - Value that indicates whether Express Entities are enabled.
      - An express topic holds a message in memory temporarily before writing it to
        persistent storage.
      returned: always
      sample: true
      type: bool
    enable_partitioning:
      description:
      - Value that indicates whether the C(queue) or C(topic) to be partitioned across
        multiple message brokers is enabled.
      returned: always
      sample: true
      type: bool
    forward_dead_lettered_messages_to:
      description:
      - C(queue) or C(topic) name to forward the Dead Letter message.
      returned: always
      sample: corge
      type: str
    forward_to:
      description:
      - C(queue) or C(topic) name to forward the messages.
      returned: always
      sample: quux
      type: str
    id:
      description:
      - Resource ID.
      returned: always
      sample: /subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/foo/providers/Microsoft.ServiceBus/
        namespaces/bar/topics/baz/subscriptions/qux
      type: str
    location:
      description:
      - The Geo-location where the resource lives.
      returned: always
      sample: eastus
      type: str
    lock_duration_in_seconds:
      description:
      - ISO 8601 timespan duration of a peek-lock.
      - The amount of time that the message is locked for other receivers.
      - The maximum value for LockDuration is 5 minutes.
      returned: always
      sample: 60
      type: int
    max_delivery_count:
      description:
      - The maximum delivery count.
      - A message is automatically deadlettered after this number of deliveries.
      returned: always
      sample: 10
      type: int
    max_size_in_mb:
      description:
      - Maximum size of the C(queue) or C(topic) in megabytes, which is the size of
        the memory allocated for the C(topic).
      returned: always
      sample: 5120
      type: int
    message_count:
      description:
      - Number of messages.
      returned: always
      sample: 10
      type: int
    metric_id:
      description:
      - Identifier for Azure Insights metrics of namespace.
      returned: always
      sample: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:bar
      type: str
    name:
      description:
      - Resource name.
      returned: always
      sample: qux
      type: str
    namespace:
      description:
      - I(namespace) name of the C(queue) or C(topic), C(subscription).
      returned: always
      sample: bar
      type: str
    private_endpoint_connections:
      description:
      - Properties of the PrivateEndpointConnection.
      returned: always
      sample:
      - id: /subscriptions/xxxxxx/resourceGroups/myRG/providers/Microsoft.ServiceBus/namespaces/fredVM/privateEndpointConnections/xxxxxxxx
        name: xxxxxx
        private_endpoint:
          id: /subscriptions/xxxxx/resourceGroups/myRG/providers/Microsoft.Network/privateEndpoints/fredprivateendpoint
        private_link_service_connection_state:
          description: Auto-Approved
          status: Approved
        provisioning_state: Succeeded
        type: Microsoft.ServiceBus/Namespaces/PrivateEndpointConnections
      type: list
    provisioning_state:
      description:
      - Provisioning state of the namespace.
      returned: always
      sample: Succeeded
      type: str
    requires_duplicate_detection:
      description:
      - A value indicating if this C(queue) or C(topic) requires duplicate detection.
      returned: always
      sample: true
      type: bool
    requires_session:
      description:
      - A value that indicates whether the C(queue) or C(topic) supports the concept
        of sessions.
      returned: always
      sample: true
      type: bool
    sas_policies:
      description:
      - Dict of SAS policies.
      - Will not be returned until I(show_sas_policy) set.
      returned: always
      sample:
        testpolicy1:
          id: /subscriptions/XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/ foo/providers/Microsoft.ServiceBus/namespaces/bar/queues/qux/authorizationRules/testpolicy1
          keys:
            key_name: testpolicy1
            primary_connection_string: Endpoint=sb://bar.servicebus.windows.net/;
              SharedAccessKeyName=testpolicy1;SharedAccessKey=XXXXXXXXXXXXXXXXX;EntityPath=qux
            primary_key: XXXXXXXXXXXXXXXXX
            secondary_connection_string: Endpoint=sb://bar.servicebus.windows.net/;
              SharedAccessKeyName=testpolicy1;SharedAccessKey=XXXXXXXXXXXXXXX;EntityPath=qux
            secondary_key: XXXXXXXXXXXXXXX
          name: testpolicy1
          rights: listen_send
          type: Microsoft.ServiceBus/Namespaces/Queues/AuthorizationRules
      type: dict
    service_bus_endpoint:
      description:
      - Endpoint you can use to perform Service Bus operations.
      returned: always
      sample: https://bar.servicebus.windows.net:443/
      type: str
    size_in_bytes:
      description:
      - The size of the C(queue) or C(topic) in bytes.
      returned: always
      sample: 0
      type: int
    sku:
      description:
      - Properties of namespace's SKU.
      returned: always
      sample: Standard
      type: str
    status:
      description:
      - The status of a messaging entity.
      returned: always
      sample: active
      type: str
    subscription_count:
      description:
      - Number of subscriptions under a topic.
      returned: always
      sample: 1
      type: int
    support_ordering:
      description:
      - Value that indicates whether the C(topic) supports ordering.
      returned: always
      sample: true
      type: bool
    tags:
      description:
      - Resource tags.
      returned: always
      sample:
        env: sandbox
      type: dict
    topic:
      description:
      - Topic name of a subscription.
      returned: always
      sample: baz
      type: str
    type:
      description:
      - Resource type.
      - Namespace is a scoping container for all messaging components.
      - Queue enables you to store messages until the receiving application is available
        to receive and process them.
      - Topic and subscriptions enable 1:n relationships between publishers and subscribers.
      returned: always
      sample: Microsoft.ServiceBus/Namespaces/Topics
      type: str
    updated_at:
      description:
      - The exact time the message was updated.
      returned: always
      sample: '2019-01-25 02:46:55.543953+00:00'
      type: str
  description:
  - List of servicebus dicts.
  returned: always
  type: complex

See also