Project

General

Profile

Actions

Bug #2726

closed

Smart Class Parameter - over-ride match value unable to set yaml

Added by Matthew Ceroni almost 11 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Parameters
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When creating a Smart Class Parameter, I am able to over ride the default value, set type to yaml and input validated yaml into the default value box.

If I then add a matcher-value combination of hostgroup = engineering and try to override with yaml it fails to save. I am however able to set the value to a simple value (ie: string). There are no errors reported in the foreman log.

I am running version 1.1stable on CentOS v6.


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #3889: No validation errors for nested class parameters on Puppet class edit pageClosedDominic Cleal12/16/2013Actions
Actions #1

Updated by Luke Kreczko almost 11 years ago

Same problem here with foreman 1.2 (latest) on Scientific Linux 6.4. It is possible to save the document if specifying 'hash' instead of 'yaml' (and 'string' would work as well I guess).

Actions #2

Updated by Matthew Ceroni almost 11 years ago

Luke Kreczko wrote:

Same problem here with foreman 1.2 (latest) on Scientific Linux 6.4. It is possible to save the document if specifying 'hash' instead of 'yaml' (and 'string' would work as well I guess).

Are you able to specify complex data structures using string or hash? I was using yaml to define an array with embedded hashes, which in turn contain arrays.

As an example I had the following in JSON:

{"pam_files":["system-auth-ac","password-auth-ac"],"access_control_list":[{"comment":"User root should be allowed to get access via cron .. tty5 tty6","permission":"+","name":"root","origins":["cron","crond",":0","tty1","tty2","tty3","tty4","tty5","tty6"]}]}

Not being able to over-ride is kind of a big issue for me right now. This above data structure is used in a module that configures the /etc/security/access.conf file. I was trying to over-ride it based on the hostgroup (each hostgroup represents a specific department).

Actions #3

Updated by Tim Robinson almost 11 years ago

Same issue here with YAML working when input as an override from the host paramaters screen but not saving when using 'Add Matcher-Value' in class config. Foreman 1.1

Actions #4

Updated by Andy Bohne almost 11 years ago

+1

Foreman 1.2 on RHEL 6 here.

Actions #5

Updated by Dominic Cleal almost 11 years ago

  • Description updated (diff)
  • Target version set to 1.3.0
Actions #6

Updated by Lukas Zapletal almost 11 years ago

  • Target version deleted (1.3.0)
Actions #7

Updated by Jason Ashby over 10 years ago

This bug is still open, right? I had this issue on 1.2.2 and now also 1.3.0 with yaml and hashes, whether nested or just one level deep. Right now I'm using heira as a "workaround", but would prefer to have my data all in Foreman.

Actions #8

Updated by Jason Ashby over 10 years ago

Actually, looks like I was entering hashes incorrectly. I was using JSON format, but it seems Foreman expects a hash as yaml, e.g.:

node: 
  network: 
    host: 127.0.0.1
  index: 
    number_of_shards: 5
    number_of_replicas: 0
  path:
    data: /usr/local/elasticsearch/data

This sounds different than the problem described in this issue.

An error message would be helpful when submitting changes to class parameters if they fail. Currently, it just redirects to the same edit page with no message. FYI when I set log_level to debug, I see this in the logs:

#<OrderedHash {:"class_params.default_value"=>["is invalid"]}>

Actions #9

Updated by Andy Bohne over 10 years ago

Jason Ashby wrote:

An error message would be helpful when submitting changes to class parameters if they fail. Currently, it just redirects to the same edit page with no message.

This is probably my biggest aggravation with foreman. An error message in the UI would be invaluable in helping to determine what the issue is.

Actions #10

Updated by Dominic Cleal over 10 years ago

  • Related to Bug #3889: No validation errors for nested class parameters on Puppet class edit page added
Actions #11

Updated by Dominic Cleal over 10 years ago

I've sent a patch in the related issue #3889, if you get the chance to try it. I haven't tried reproducing this YAML issue yet, but at least that small patch should cause validation errors to be displayed in the UI.

Actions #12

Updated by Peter Gustafsson over 10 years ago

Hi, I'm hitting the same issue in foreman 1.3.2:

i can add below yaml to override default value, but when i'm trying to add the yaml as an hostgroup match it fails to save.

test1:
network_address: 192.168.122.0
netmask: 255.255.255.0
gateway: 192.168.122.1
test2:
network_address: 192.168.123.0
netmask: 255.255.255.0
gateway: 192.168.122.1

Br, Peter

Actions #13

Updated by Stephen Benjamin over 10 years ago

  • Assignee set to Stephen Benjamin
  • Target version set to 1.9.1
Actions #14

Updated by Dominic Cleal over 10 years ago

  • Category set to Parameters
  • Status changed from New to Ready For Testing
Actions #15

Updated by Dominic Cleal over 10 years ago

  • Translation missing: en.field_release set to 5
Actions #16

Updated by Anonymous over 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF