Description of problem: The value of roles should be a string Version-Release number of selected component (if applicable): openshift-openshift_origin (v4.1.2) How reproducible: 100% Steps to Reproduce: 1. Install node according to the following configuration: node /^node2/ { class { 'openshift_origin': roles => ["node"], msgserver_tls_enabled => 'enabled', msgserver_tls_ca => '/etc/puppetlabs/puppet/ssl/certs/ca.pem', msgserver_tls_cert => inline_template('<%= "/etc/puppetlabs/puppet/ssl/certs/#{fqdn.downcase}.pem" %>'), msgserver_tls_key => inline_template('<%= "/etc/puppetlabs/puppet/ssl/private_keys/#{fqdn.downcase}.pem" %>'), install_cartridges_optional_deps => ["php", "jbosseap"], install_cartridges => ["php", "jbosseap"], node_hostname => 'node2.ose22-test.com.cn', domain => 'ose22-test.com.cn', bind_key => '4q9vJH2UPhtwHfQJzl8zu8XXtCYzExBMevU5SLG7VuGsLRi4hk8AuPVozb2fx3BJ4y1ejFZvpPJk1rtaOGEmqg==', install_method => 'none', node_ip_addr => '10.66.79.136', nameserver_ip_addr => '10.66.79.142', ose_version => '2.2', conf_nameserver_upstream_dns => ['10.66.127.17'], register_host_with_nameserver => true, } } 2. Check the script '/usr/local/bin/puppet-oo-admin-yum-validator' #vim /usr/local/bin/puppet-oo-admin-yum-validator ooayv=$( /usr/bin/oo-admin-yum-validator -a [" -r node", " -r node-eap"] ) ooayv=$( /usr/bin/oo-admin-yum-validator [" -r node", " -r node-eap"] ) if [ $? -eq 0 ] then touch /etc/yum-validator/.oo_admin_yum_validator_success exit 0 else exit 1 fi Actual results: The value of roles is as below ooayv=$( /usr/bin/oo-admin-yum-validator -a [" -r node", " -r node-eap"] ) ooayv=$( /usr/bin/oo-admin-yum-validator [" -r node", " -r node-eap"] ) Expected results: The roles should be transfered as "ooayv=$( /usr/bin/oo-admin-yum-validator -a -r node -r node-eap ) Should run oo-admin-yum-validator with specified version of ose Additional info:
Interesting find, I can only reproduce this when using a puppet master or when using puppet enterprise, one of the two. Masterless configs using puppet opensource are fine.
Ruby 1.8.7 flattens arrays into strings automatically where as Ruby 1.9.x doesn't. So we must call join to explicitly flatten the array into a string with no separators. I've pushed an additional commit to the pull request which should address this. commit ef11e2d6329290ed9baf56aebec6654ed69dad47 Author: Scott Dodson <sdodson> Date: Wed Jan 7 15:40:35 2015 -0500 Use join to flatten the array into a string. Ruby 1.8.7 seems to automatically flatten the array into a string where as Ruby 1.9.1 (as packaged in PE3.3.2 and PE3.7) don't. diff --git a/manifests/oo_admin_yum_validator.pp b/manifests/oo_admin_yum_validator.pp index 31e09ab..ad1a203 100644 --- a/manifests/oo_admin_yum_validator.pp +++ b/manifests/oo_admin_yum_validator.pp @@ -19,7 +19,7 @@ class openshift_origin::oo_admin_yum_validator { if member($roles, 'node') { $role_node = 'node' } else { $role_node = '' } if member($roles, 'broker') { $role_broker = 'broker -r client' } else { $role_broker = '' } $role_list = [$role_node, $role_amq, $role_eap, $role_fuse, $role_broker] - $role_string = prefix(delete($role_list,''), ' -r ') + $role_string = join( prefix( delete( $role_list, '' ), ' -r ' ), '' ) # oo-admin-yum-validator -a returns 1 if it made changes and 0 if no changes # so use a wrapper to fix everything then call it again to check for issues
Please specify the version of ose in 'puppet-oo-admin-yum-validator.erb' file, or oo-admin-yum-validator will prompt that it can not detect the version of ose.
Ma, Ok I pushed another change. The version should be carried through from ose_version parameter now. I tested this on a clean machine and it ran fine without any prior setup other than ensuring the repos were available. Hopefully everything works now, thanks for your attention to detail! -- Scott
it works fine.
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:1065