ansible-middleware / amq

A collection to manage AMQ brokers
Apache License 2.0
16 stars 12 forks source link

Cannot download/install Red Hat AMQ version 7.09.4 #104

Closed christianmasopust closed 10 months ago

christianmasopust commented 11 months ago
SUMMARY

we are starting with Red Hat AMQ deployment and planning to use the redhat.amq_broker collection. For later tests of upgrading Artemis, we want to start deploying Red Hat AMQ version 7.09.4.

First attempt was to set amq_broker_version to "7.9.4", result was that redhat.runtimes_common.product_search did not find any product:

ok: [localhost] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "api_url": "https://jbossnetwork.api.redhat.com",
            "client_id": "xxxxxxxxxx",
            "client_secret": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "product_category": "jboss.amq.broker",
            "product_id": null,
            "product_type": "DISTRIBUTION",
            "product_version": "7.9.4",
            "sso_url": "https://sso.redhat.com",
            "validate_certs": true
        }
    },
    "msg": "",
    "results": []
}

After changing amq_broker_version to "7.09.4", product search finds the version but still we cannot download because the "rhn_filtered_products" fact is empty:

TASK [Determine install zipfile from search results] **********************************************************************************************
task path: /home/cmaso/Artemis/test/download.yml:43
ok: [localhost] => {
    "ansible_facts": {
        "rhn_filtered_products": []
    },
    "changed": false
}

this is because the returned file_path of the search result don't use the version 7.09.4, the files are named 7.9.4 ...

        {
            "category": "jboss.amq.broker",
            "description": "AMQ Broker 7.9.4",
            "distribution_status": "AVAILABLE",
            "download_path": "https://access.redhat.com/cspdownload/0e54ee2328428c00bc535af93e96f44a/654499be/AMQ-BROKER-7.9.4/amq-broker-7.9.4-bin.zip",
            "file_path": "AMQ-BROKER-7.9.4/amq-broker-7.9.4-bin.zip",
            "id": 104297,
            "md5": "d208b3a4b25a6f741dc3b5d097eea76b",
            "name": "Red Hat AMQ Broker",
            "sha256": "ccdc930df014c84d131b2e74da0937d04a6c5ceb6096a37968c2ad36f1ae4207",
            "title": "AMQ Broker 7.9.4",
            "type": "DISTRIBUTION",
            "version": "7.09.4",
            "visibility": "PUBLIC"
        }
ISSUE TYPE
ANSIBLE VERSION
ansible [core 2.14.6]
  config file = /home/cmaso/.ansible.cfg
  configured module search path = ['/home/cmaso/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/cmaso/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.16 (main, Sep 12 2023, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
redhat.amq_broker                   1.3.10
guidograzioli commented 11 months ago

Hello, can you show versions of installed collections and playbook please? However, supported versions are 7.10 and 7.11.

christianmasopust commented 11 months ago

Hello, can you show versions of installed collections and playbook please? However, supported versions are 7.10 and 7.11.

It's just this part of your tasks in install.yml that is failing:

    - name: Retrieve product download using JBoss Network API
      redhat.runtimes_common.product_search:
        client_id: "{{ rhn_username }}"
        client_secret: "{{ rhn_password }}"
        product_type: DISTRIBUTION
        product_version: "{{ amq_broker_version }}"
        product_category: "{{ amq_broker_product_category }}"
      register: rhn_products
      delegate_to: localhost
      run_once: yes

    - name: Determine install zipfile from search results
      ansible.builtin.set_fact:
        rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', '.*/amq-broker-' + amq_broker_version + '-bin.zip') }}"
      delegate_to: localhost
      run_once: yes

    - name: Download AMQ Broker
      redhat.runtimes_common.product_download:
        client_id: "{{ rhn_username }}"
        client_secret: "{{ rhn_password }}"
        product_id: "{{ (rhn_filtered_products | first).id }}"
        dest: "{{ local_path.stat.path }}/{{ amq_broker.bundle }}"
      no_log: "{{ omit_rhn_output | default(true) }}"
      delegate_to: localhost
      run_once: yes

Is it somewhere mentioned that only versions >= 7.10 are supported? And even the roles README still mentions version 7.8 and 7.9...

But anyway... if you think it's not worth to fix this, feel free to close this issue :)

guidograzioli commented 11 months ago

Good point; in general terms of Red Hat support for the collection, it will get support when used to install AMQ broker versions which are also supported.

This problem turns out to be metadata in the download portal, we are looking for a fix there or eventually in the collection.

guidograzioli commented 11 months ago

For a quick workaround, i suggest to set

amq_broker_offline_install: True
amq_broker_version: 7.9.4

and run the playbook with the downloaded file (amq-broker-7.9.4-bin.zip) in the controller directory.

christianmasopust commented 11 months ago

Thanks for the offline installation hint, we already tried that :) And, as we currently are testing/evaluating the Red Hat AMQ, it's not a big issue for us, later in production, we most likely will install one of the newest releases, so...

We can continue our tests so it's up to you how to fix it, just wanted to notice you about the issue.

Thanks for your help!