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 2055416 - redhat.satellite.content_upload ansible module with unexpected src parameter behavior
Summary: redhat.satellite.content_upload ansible module with unexpected src parameter ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible Collection
Version: 6.9.8
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: 6.12.0
Assignee: Evgeni Golov
QA Contact: Griffin Sullivan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-16 21:20 UTC by Dan Kolepp
Modified: 2022-11-16 13:33 UTC (History)
1 user (show)

Fixed In Version: ansible-collection-redhat-satellite-3.3.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:33:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman-ansible-modules pull 1346 0 None open clarify what src means in content_upload 2022-02-24 08:41:08 UTC
Red Hat Issue Tracker SAT-13534 0 None None None 2022-10-21 15:35:36 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:33:37 UTC

Description Dan Kolepp 2022-02-16 21:20:16 UTC
Description of problem:
I am unable to use the `redhat.satellite.content_upload` module from the certified content collection to upload content to satellite, unless I first transfer that file to actual satellite host.  I should be able to use a `src` value that corresponds to a file on the (local) controller, which is then transfered as part of this task.

The only way to use this (at the moment) is to do the following:
1. Transfer the file to the satellite host (to /tmp)
2. Run the redhat.satellite.content_upload module with the src pointing the location on satellite (/tmp)
3. Remove the transferred file from satellite (from /tmp)

at a minimum, the documentation should be updated if this is indeed the case, so that users know the file must already exist on the satellite host.  But this doesn't seem to follow the conventions of the `copy` module, or other modules, where the `src` parameter references a local file.

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


How reproducible:



Steps to Reproduce:
1.  Pick a file on the controller (localhost probably) and configure a playbook to try and upload this content to a configured satellite file type repository.
2.Modify the playbook to first transfer, and then use the remote file to upload.


Actual results:
described above.

Expected results:
described above.


Additional info:

Comment 1 Evgeni Golov 2022-02-17 06:21:44 UTC
The src points to whatever machine you're running the module against.

So if youre playbook says "hosts: localhsot", it will be localhost, if your playbook says "hosts: satellite.example.com" it will be satellite.example.com

Comment 2 Dan Kolepp 2022-02-17 15:50:05 UTC
This is *unexpected* behavior in my opinion - based on other standard/common modules. For other modules, there is a `remote_src` option to indicate that the "src" is located remotely, and not on the controller.

If this is the case - I would state this explicitly in the documentation.  Right now, the description says:

src:  file to upload

I would change this to something like: "file to upload, which exists on the host targeted by the task", or provide additional information.

Here is the copy module: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html

The "src" definition here is "common" for many modules - like "template", etc.

Comment 3 Brad Buckingham 2022-07-18 09:42:28 UTC
Moving to ON_DEV as this is already included in 6.12: 
ansible-collection-redhat-satellite-3.3.0-1.el8sat.noarch

Comment 4 Griffin Sullivan 2022-07-22 14:09:26 UTC
Verified in 6.12.0 snap 3.0

redhat.satellite.content_upload src description is updated.

Steps to Reproduce:

1) SSH into Satellite

2) # ansible-doc redhat.satellite.content_upload

Expected Result:
src description is updated to "File (on the remote/target machine) to upload"

Actual Result:
src description is updated to "File (on the remote/target machine) to upload"

Comment 8 errata-xmlrpc 2022-11-16 13:33:27 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 (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


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