Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1878034 - [RFE] Add/override interfaces to provisioned hosts
Summary: [RFE] Add/override interfaces to provisioned hosts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible Collection
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: 6.9.0
Assignee: Evgeni Golov
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-11 06:48 UTC by Luka Bac
Modified: 2024-10-01 16:51 UTC (History)
5 users (show)

Fixed In Version: ansible-collection-redhat-satellite-1.5.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-21 13:17:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman-ansible-modules issues 757 0 None closed allow host interfaces management 2021-02-18 08:33:08 UTC
Red Hat Product Errata RHSA-2021:1313 0 None None None 2021-04-21 13:17:58 UTC

Description Luka Bac 2020-09-11 06:48:41 UTC
Description of problem:
When trying to provision a machine using the host module from the Red Hat Satellite collection, there is currently no way to add extra network interfaces or override the settings of the ones provided by the compute profile/compute resource pair.

The API offers the `interfaces_attributes` parameter to pass to the /api/hosts/ POST call that creates a host, which should be available in the host module as well. 

Version-Release number of selected component (if applicable):
1.0.1

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
There is an issue already opened upstream on this matter: https://github.com/theforeman/foreman-ansible-modules/issues/757

Comment 1 Luka Bac 2020-09-11 07:01:39 UTC
Currently, the customer that has this feature request works around this issue by providing the following patch to the Red Hat Satellite Collection host module:

--- plugins/modules/host.py 2020-09-11 08:50:37.761582620 +0200
+++ plugins/modules/host.py 2020-09-11 08:50:34.532578390 +0200
@@ -191,6 +191,7 @@
             owner_type=dict(type='invisible'),
             provision_method=dict(choices=['build', 'image', 'bootdisk']),
             image=dict(type='entity'),
+            interfaces_attributes=dict(type='list'),
         ),
         mutually_exclusive=[
             ['owner', 'owner_group']



This then allows the customer (that provisions on VMware) to pass the interfaces_attributes list parameter to the host module like so:

    [...]
    interfaces_attributes:
      - {}
      - primary: 1
        managed: 1
        compute_attributes:
          type: VirtualVmxnet3
          network: portgroup123

Passing it like this means that we can now override the NICs provided by default by the compute_profile/compute_resource pair and also create new ones.

However, this is suboptimal for at least two reasons
- if we want to add a NIC we have to know exactly how many NICs are provided by default so that we pass as many empty elements to the list
- We cannot pass the 'friendly' network name that is available in the Satellite UI because it is not looked up by the module, and instead have to pass the raw portgroup, which has no relation to the VLAN for instance.

Comment 2 Evgeni Golov 2020-09-11 13:03:26 UTC
Dropping the Patch keyword as the provided patch is incomplete.

Comment 8 Peter Ondrejka 2021-01-22 11:15:17 UTC
Verified on Satellite 6.9 snap 9 via automation (test_crud[host_interface_attributes])

Comment 11 errata-xmlrpc 2021-04-21 13:17:42 UTC
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.9 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:1313


Note You need to log in before you can comment on or make changes to this bug.