Description of problem: Not possible to create content credential through redhat.satellite.content_credentials-role How reproducible: Use collection to create a content credential Steps to Reproduce: 1. Try to execute the example on https://console.redhat.com/ansible/automation-hub/repo/published/redhat/satellite/content/role/content_credentials Actual results: { "ansible_loop_var": "item", "_ansible_item_label": { "content": "test", "name": "test", "content_type": "gpg_key" }, "item": { "content": "test", "name": "test", "content_type": "gpg_key" }, "error": { "displayMessage": "One of parameters [ organization_id ] required but not specified.", "errors": [ "One of parameters [ organization_id ] required but not specified." ] }, "msg": "Error while performing create on content_credentials: 404 Client Error: Not Found for url: https://satellite.MYORG.com/katello/api/content_credentials", "changed": false, "invocation": { "module_args": { "username": "MYUSER", "name": "test", "server_url": "http://satellite.MYORG.com", "content": "test", "state": "present", "content_type": "gpg_key", "organization": "MYORGANIZATION", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "validate_certs": false } }, "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "_ansible_no_log": false } Expected results: A Content Credential is created Additional info:
Hi, - what version of Satellite are you running this against? - can you share the playbook you used? the error "One of parameters [ organization_id ] required but not specified." suggests that for some reason no Organization was passed (which is weird)
Hi Evgeni, - Satellite version is 6.9.0 - sure: - name: CreateContentCredential hosts: localhost become: no gather_facts: no roles: - role: redhat.satellite.content_credentials vars: satellite_username: "{{ API_USERNAME }}" satellite_password: "{{ API_PASSWORD }}" satellite_server_url: "http://satellite.MYORG.com" satellite_organization: "{{ satellite_org }}" satellite_content_credentials: - name: "{{ satellite_product_key }}" content_type: gpg_key content: "{{ satellite_product_gpg_key_plain }}" Environment variables: satellite_org: MYORGANIZATION satellite_product_gpg_key_plain: test satellite_product_key: test Kind regards, Moritz
Thanks! The playbook looks good to me. I'll spin up a 6.9 and see if I can reproduce this. Is your setup really a 6.9.0, nothing newer like 6.9.6/6.9.7? (Not that I think there were any bugfixes in that area, but still, 6.9.0 is rather old ;))
Ha! Is that really 'http' in your server_url? Not httpS?
Yes, 6.9.0 Tried both http and https
So I can reproduce this when I set satellite_server_url: "http://satellite.MYORG.com" But it works fine when I do satellite_server_url: "httpS://satellite.MYORG.com" The reason behind this is: when you issue a HTTP request, Satellite does a redirect to HTTPS, and when the redirect is followed, the POST request data is not sent along. Not sure we can nicely catch this, but I'll see what others think.
Oh my. Didn't push the commit with the change to https. It's working. Sorry for the noise.
Haha, no worries. I'll leave the BZ open, and will try to improve the error reporting :)
Verified in 6.12 snap 3 New warning and failure messages shown when running playbooks with satellite server url starting with or without ["http", "https"]. Steps to Reproduce: 1) Create a playbook using satellite_server_url with "http://" 2) Run playbook 3) Remove "http://" from satellite_server_url in playbook 4) Run playbook Expected Results: Step 2 results with a warning stating "[WARNING]: You have configured a plain HTTP server URL. All communication will happen unencrypted." Step 4 results with a failure stating "The server URL needs to be either HTTPS or HTTP!" Actual Results: Step 2 results with a warning stating "[WARNING]: You have configured a plain HTTP server URL. All communication will happen unencrypted." Step 4 results with a failure stating "The server URL needs to be either HTTPS or HTTP!"
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:8506