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 1777298 - When importing multiple ansible role variables in satellite that have the same variable name, they are considered globally unique and not local to the rule
Summary: When importing multiple ansible role variables in satellite that have the sam...
Keywords:
Status: CLOSED DUPLICATE of bug 1777293
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.6.0
Hardware: Unspecified
OS: Linux
urgent
high
Target Milestone: 6.6.1
Assignee: satellite6-bugs
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-27 10:54 UTC by Francisco Peralta
Modified: 2023-09-07 21:07 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-12 22:45:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 28612 0 Normal Closed Ansible runs fail when proxy batch triggering is disabled 2021-02-16 15:36:26 UTC
Foreman Issue Tracker 29236 0 Urgent Duplicate When importing multiple ansible role variables in foreman that have the same variable name, they are considered globally... 2021-02-16 15:36:26 UTC

Description Francisco Peralta 2019-11-27 10:54:59 UTC
This bug was initially created as a copy of Bug #1777293

I am copying this bug because: 

We are not sure if it will be considered a bug or an enhancement but we think the variables of imported rules should be considered local to the rule and not as currently imported as a global flat unique list of variables in satellite (with the risk to have conflicting names of variables when you have many roles, coming from different sources and community like galaxy).

Description of problem:

If you try to import some ansible roles in satellite 6.6 that contain the same variable name the GUI will not warn nor give an error but silently import the variables and the last imported variable with the same name wins.


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

Satellite 6.6.0

How reproducible:

1. Create two roles that have a default variable with the same name.
2. Import them: only the last variable will be visible/used in the GUI.

Actual results:

Only the last imported variable with the same name will be present/used.

Expected results:

We would expect that the two or more variables would be considered locally to the related role (so not overwriting each other) or at least have a warning message for the user to know that he just overwrote a variable with another in two roles (he could eventually rename them and reimport them again)

Additional info:

If roles are developed by different teams or as often is the case imported from galaxy or the comunity you cannot be sure or enforce that the variable name will be unique for *all* roles, thus you should foresee this and avoid them to be global, but local to the rule or at least give a warning to take countermeasures by using best practices in variable naming (prefixing with role name etc).

Comment 4 Marek Hulan 2019-12-09 09:23:29 UTC
This is definitely a bug. The patch from BZ 1741187 may have caused it, though looking at the code, it should actually work exactly as expected. Variable needs to be unique but scoped by ansible role it's attached to.

Comment 7 Dominik Matoulek 2020-03-02 12:34:33 UTC
Created redmine issue https://projects.theforeman.org/issues/29236 from this bug


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