Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fact gathering module for amq #145

Conversation

guidograzioli
Copy link
Member

@guidograzioli guidograzioli commented Aug 12, 2024

The new module calls into the jolokia API and returns activemq configuration / runtime info as Ansible facts.

Sample usage:

- name: Populate activemq facts
  middleware_automation.amq.activemq_facts:
    base_url: http://0.0.0.0:8161
    auth_username: ...
    auth_password: ...

- name: Print activemq gathered facts
  ansible.builtin.debug:
    var: ansible_facts.activemq

returns:

TASK [debug] *******************************************************************
task path: /home/guido/Development/redhat/amq/molecule/default/verify.yml:15
ok: [instance] => {
    "ansible_facts.activemq": {
        "Acceptors": [
            [
                "artemis",
                "org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory",
                {
                    "host": "localhost",
                    "port": "61616",
                    "protocols": "CORE,MQTT",
                    "scheme": "tcp",
                    "tcpReceiveBufferSize": "1048576",
                    "tcpSendBufferSize": "1048576",
                    "useEpoll": "True"
                }
            ],
            [
                "amqp",
                "org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory",
                {
        [...]
        "PersistenceEnabled": true,
        "QueueCount": 6,
        "QueueNames": [
            "$sys.mqtt.sessions",
            "DLQ",
            "queue.out",
            "client123.pubsub.foo",
            "ExpiryQueue",
            "queue.in"
        ],
        "ReplicaSync": false,
        "ScheduledThreadPoolMaxSize": 5,
        "SecurityEnabled": true,
        "SecurityInvalidationInterval": 10000,
        "SharedStore": false,
        "Started": true,
        "Status": "{\"configuration\":{\"properties\":{\"system-brokerconfig.\":{\"alder32\":\"1\"}}},\"server\":{\"jaas\":{\"properties\":{\"artemis-users.properties\":{\"reloadTime\":\"1723459747305\",\"Alder32\":\"2937610211\"},\"artemis-roles.properties\":{\"reloadTime\":\"1723459747305\",\"Alder32\":\"3310360534\"}}},\"state\":\"STARTED\",\"version\":\"2.34.0\",\"nodeId\":\"893d5e73-5890-11ef-a186-0242ac110002\",\"identity\":null,\"uptime\":\"2 hours 32 minutes\"}}",
        "ThreadPoolMaxSize": 30,
        "TotalConnectionCount": 8,
        "TotalConsumerCount": 0,
        "TotalMessageCount": 0,
        "TotalMessagesAcknowledged": 0,
        "TotalMessagesAdded": 0,
        "TransactionTimeout": 300000,
        "TransactionTimeoutScanPeriod": 1000,
        "Uptime": "2 hours 32 minutes",
        "UptimeMillis": 9121059,
        "Version": "2.34.0",
        "WildcardRoutingEnabled": true

@guidograzioli guidograzioli added the minor_changes New parameters added to modules, or non-breaking behavior changes to existing parameters; no bugfix label Aug 12, 2024
Copy link
Contributor

@rpelisse rpelisse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spot a typo in the doc, but apart from that LGTM 👌

type: complex
contains:
activemq:
description: THe factual representation of an activemq instance configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THe => The

@guidograzioli guidograzioli merged commit e4b8ae4 into ansible-middleware:main Aug 12, 2024
16 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor_changes New parameters added to modules, or non-breaking behavior changes to existing parameters; no bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants