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 2255346 - Updating an Ansible array in host ui produces escape characters
Summary: Updating an Ansible array in host ui produces escape characters
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.14.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 6.15.0
Assignee: Girija Soni
QA Contact: amolpati
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-12-20 09:42 UTC by Stefan Meyer
Modified: 2024-04-23 17:16 UTC (History)
7 users (show)

Fixed In Version: rubygem-foreman_ansible-13.0.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-04-23 17:16:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Screenshot of Host UI (34.72 KB, image/png)
2023-12-20 09:42 UTC, Stefan Meyer
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36594 0 Normal New Ansible variables input form displays '/' instead of allowing editing for certain types 2023-12-31 09:35:53 UTC
Github theforeman foreman_ansible pull 682 0 None Merged Fixes #36594 - Fix addition of '\' when editing ansible variables 2024-01-17 13:47:31 UTC
Red Hat Issue Tracker SAT-22057 0 None None None 2023-12-20 09:44:43 UTC
Red Hat Product Errata RHSA-2024:2010 0 None None None 2024-04-23 17:16:32 UTC

Description Stefan Meyer 2023-12-20 09:42:49 UTC
Created attachment 2005106 [details]
Screenshot of Host UI

Description of problem:
- When overriding an array in the host ui will create a lot of escape characters (\\\)

Version-Release number of selected component (if applicable):
- Satellite 6.14
- Satellite 6.15 (Snap 3)

How reproducible:
- Only in the new host ui
- Not when defining a global parameter
- No when overriding the variable in Configure => Ansible Variables

Steps to Reproduce:
1. Create a custom Ansible role as documented in Additional info
2. Import the role into Satellite
3. Make variable overridable
4. Set default Parameter Type to "array"
5. Set the Default Value to ["Default Text"]
6. Assign the role to a host
7. Try to override that value in the new host ui

Actual results:
- When trying to override the array for a specific host it creates escape characters. Example
  "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"[\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Default Text\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"] \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  \\\\\\\"a\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"l\\\\\\\\\\\\\\\"d\\\

Expected results:
- Overriding an array should not produce escape characters


Additional info:
- See screenshot

Custom Role:
- filename testrole/tasks/main.yml:
  ---

- filename testrole/defaults/main.yml:
  ---
  testrole.test.input: "Default Text"

Comment 3 amolpati 2024-01-31 10:16:55 UTC
Verified.

Tested on: Satellite 6.15 Snap 8.0

Steps followed:

1. Register Host with Satellite
2. Create a custom Ansible role (/etc/ansible/roles/aaxc.test)
3. Configure -> Ansible -> Roles (Import the custom role into Satellite)
4. Configure -> Ansible -> variable -> New Ansible Variable
5. Make variable overridable
6. Set default Parameter Type to "array"
7. Set the Default Value to ["Default Text"]
8. Hosts -> All Hosts -> Select Host
9. Ansible -> Roles -> Assign the role to a host
10. Variables -> Try to override that value

Additional info: 

Able to override an array and it is not producing escape characters

Comment 7 errata-xmlrpc 2024-04-23 17:16:31 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.15.0 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-2024:2010


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