Bug 2255346

Summary: Updating an Ansible array in host ui produces escape characters
Product: Red Hat Satellite Reporter: Stefan Meyer <smeyer>
Component: Ansible - Configuration ManagementAssignee: Girija Soni <gisoni>
Status: CLOSED ERRATA QA Contact: amolpati
Severity: medium Docs Contact:
Priority: medium    
Version: 6.14.0CC: ahumbe, gisoni, lstejska, nalfassi, rlavi, shwsingh, zhunting
Target Milestone: 6.15.0Keywords: Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_ansible-13.0.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-23 17:16:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot of Host UI none

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