Bug 1241249
Summary: | Smart Class Parameter override default values are changed by the system, causing faulty YAML generation or error when generating YAML | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Harald Jensås <hjensas> |
Component: | Configuration Management | Assignee: | orabin |
Status: | CLOSED ERRATA | QA Contact: | Kedar Bidarkar <kbidarka> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.1.0 | CC: | ahumbe, aperotti, bbuckingham, bkearney, casmith, clasohm, daniele, ehelms, kbidarka, kshirsal, ktordeur, mklika, ohadlevy, orabin, oshtaier, rankumar, riehecky, sthirugn, tasander, xdmoon |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-07-27 08:53:30 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: |
Description
Harald Jensås
2015-07-08 20:21:45 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release. When using ERB we evaluate the value only when creating the ENC output. This is done so erb values can use parameters that haven't been evaluated yet and you do not need all of the information available when editing the erb. As a result the erb values are left untouched (as strings) so your value was converted to a string. When using the Ruby array your value gets evaluated and then cast to an array as needed. Workaround: instead, use a Ruby array: <%= [@host.subnet.dns_primary, @host.subnet.dns_secondary] %> For those interested: there is another workaround for json parameter types. We've found that these exhibit the same problem as with arrays. We've just updated Satellite 6.0.8 to 6.1.2 and have encountered the exact same error. But not only with arrays, also with json parameter types. After trial and error, we've found a workaround to get json parsed as YAML. Perhaps it's a feature but we haven't found it in documentation (or haven't searched hard enough). Without further a do: On overriding, check the paramater type to be a hash, and enter a json string into the value box. Upon clicking the submit button, the json string is converted in correct, parsing YAML (which is what we needed). The YAML output for a host is now accepted and puppet agents can run again. For instance, what we had working before the Satellite upgrade was: {"zabbix":{"priority":"10","content":"Cmnd_Alias ZABBIX_CMNDS = /usr/sbin/dmidecode , /usr/bin/facter , /usr/bin/zems\nzabbix ALL = NOPASSWD : ZABBIX_CMNDS\nDefaults:zabbix !requiretty"}} Which didn't work after the upgrade. Following the example above, this json string was converted to: zabbix: priority: '10' content: ! 'Cmnd_Alias ZABBIX_CMNDS = /usr/sbin/dmidecode , /usr/bin/facter , /usr/bin/zems zabbix ALL = NOPASSWD : ZABBIX_CMNDS Defaults:zabbix !requiretty' (for those interested, we are overriding the config for this puppet module: https://forge.puppetlabs.com/saz/sudo/readme) *** Bug 1319383 has been marked as a duplicate of this bug. *** VERIFIED this with sat62-snap19(GA) 1) added those parameters and submitted 2) the YAML file for the host displayed both "nameserver" and "searchpath" 3) Edited the pupp-class parameters and submitted 4) The YAML file now can still be viewed from the UI without any issues. Please feel free to reopen this bug if this issue is seen for other types or with other puppet-class parameters. 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, 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/RHBA-2016:1500 *** Bug 1320572 has been marked as a duplicate of this bug. *** |