Description of problem: redhat.satellite.host resource cannot create the host on the Satellite, based on the host group predefinitions, when using image-based deploy on Azure, as the following example. ~~~ - hosts: localhost tasks: - name: "Create a host {{ hostname }} on Azure" redhat.satellite.host: username: "admin" password: "mysecpassword" server_url: "https://satellite.hostname.com" name: "{{ hostname }}.{{ domain }}" domain: "{{ domain }}" organization: "Default Organization" validate_certs: no location: "Default Location" hostgroup: Azure_Deploy build: true state: present ~~~ Version-Release number of selected component (if applicable): ansible-collection-redhat-satellite-1.3.0-1.el7sat.noarch How reproducible: Try to deploy a host-based on an image on Azure via Satellite using the host resource. Steps to Reproduce: 1. 2. 3. Actual results: It fails with the following error. ~~~ fatal: [localhost]: FAILED! => {"changed": false, "error": {"errors": {"base": ["Failed to create a compute AZURE_RBERTOL_FREE (Azure Resource Manager) instance nuevo.gsslab.rdu2.redhat.com: undefined method `split' for nil:NilClass\n "]}, "full_messages": ["Failed to create a compute AZURE_RBERTOL_FREE (Azure Resource Manager) instance nuevo.gsslab.rdu2.redhat.com: undefined method `split' for nil:NilClass\n "], "id": null}, "msg": "Error while performing create on hosts: 422 Client Error: Unprocessable Entity"} ~~~ Expected results: The host should be created. Additional info:
Okay, I think I found the culprit, even tho I am not totally sure how to best fix it. To deploy on Azure, we need to provide a boot image (like 'marketplace://RedHat:RHEL:7-RAW:latest' or similar), but neither the HG nor the Compute Profile does that automatically for us. Now the Ansible module has an "image" param, but setting it doesn't help, as that somehow is not properly translated to Azure. However, setting "compute_attributes: {image_id: 'marketplace://RedHat:RHEL:7-RAW:latest'}" helps. Absolutely nothing we should require our users to do (they should set "image: RHEL7" and the rest should be looked up magically). There is a similar-ish workaround in hammer: https://github.com/theforeman/hammer-cli-foreman/commit/f163dd9fc9a232f711621f81a16752624edd5de7
Successfully deployed an image-based host on Azure without need to provide the 'image_id' (only 'image' was defined in the playbook) Verified at: Satellite 6.10.0 snap 18 ansible-collection-redhat-satellite-2.1.2-1.el7sat.noarch
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 (Moderate: Satellite 6.10 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-2021:4702