Project

General

Profile

Actions

Bug #35993

open

Hash variable turns into "[object Object]" string when trying to override it on Host level

Added by Alec Jonson over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Foreman Version 3.4.1 from repository https://yum.theforeman.org/releases/3.4/el8/x86_64
rubygem-smart_proxy_ansible-3.4.0-2.fm3_4.el8.noarch

Using role oasis_roles.system.users_and_groups as an example but I see this problem with other roles.

Variable users_and_groups_add_modify_users is set to override with value `[{"name":"mentor"},{"name":"labstaff","generate_ssh_key":true},{"name":"max"}]` globally on `https:/foreman.tld/ansible/ansible_variables`.

Role is assigned to a host where I don't want user "max" to be created. I can see this Variable in Host properties:

I want to edit it and remove the `,{"name":"max"}` portion. I click the "pencil" button and get "[object Object],[object Object],[object Object]" inside Edit field instead of the default value:

It is pointless to edit `[object Object],[object Object],[object Object]` as is and, say, try to remove the last `,[object Object]`. It is being saved as `["object Object"]` and becomes useless. I'm copying default value to clipboard, click on "pensil", then paste the value back before editing it. This way it works so there is an easy workaround. But it is inconvenient and feels completely broken.

Expected behaviour is to be able to edit the value itself.

How to reproduce:
  • assign a Hash variable to a Role
  • input a complex non-empty default value
  • assign Role to a host
  • try to override the default value in Host settings

I also see this bug with earlier versions of Foreman. E.g. with 3.4.0.


Files

AnsibleVarWhenEditing.png View AnsibleVarWhenEditing.png 53.5 KB Alec Jonson, 01/25/2023 11:14 AM
AnsibleVarDisplayed.png View AnsibleVarDisplayed.png 50.1 KB Alec Jonson, 01/25/2023 11:14 AM

No data to display

Actions

Also available in: Atom PDF