Project

General

Profile

Actions

Bug #29787

open

Foreman removes quotes from hashes in parameters

Added by Dirk Götz almost 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
External Nodes
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:

Description

Foreman silently removes quotes from values of hashes in parameters when storing them and also if erb is used.

In our use case it did so from the hardware address used in an interfaces hash which makes the mac address an integer (converted from hex to binary) instead of a string resulting a misconfigured network and connection loss.

To reproduce you do not need a puppet class expecting hashes, you can also define a host parameter and create a hash like

eth0:
  hwaddress: "00:11:22:33:44:55:66" 

This results in the enc output:

    eth0:
      hwaddress: 00:11:22:33:44:55:66

A simplified version of the puppet parameter code which I did not get working as a host parameter:

<% @host.interfaces.each do |i| -%>
<%= i.identifier %>:
  hwaddress: "<%= i.mac %>" 
<% end -%>

As an ugly workaround I added a string suffix to the mac address and removed it in the template from the puppet module.

This come up while I was updating a very old version and we did recognize very late, so I am not sure when this changed, but it was working at least in 1.14 and 1.15.

No data to display

Actions

Also available in: Atom PDF