Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quoting default_settings.py #35

Closed
djjudas21 opened this issue Jun 9, 2014 · 10 comments
Closed

Quoting default_settings.py #35

djjudas21 opened this issue Jun 9, 2014 · 10 comments

Comments

@djjudas21
Copy link

Some attributes in the puppetboard class are not quoted properly when their values are written out to default_settings.py.

This is my calling syntax, and for some variables I have had to double-encapsulate strings in single quotes and double quotes, so they are written out to default_settings.py with single quotes.

  class { 'puppetboard':
    manage_virtualenv => true,
    puppetdb_host => 'puppet.example.com',
    puppetdb_port => "'8081'",
    puppetdb_key  => "'/var/lib/puppet/ssl/private_keys/${::fqdn}.pem'",
    puppetdb_ssl  => "'true'",
    puppetdb_cert => "'/var/lib/puppet/ssl/public_keys/${::fqdn}.pem'",
  }

When these variables are not double-quoted, this happens in the apache log because config values are written without quotes:

[Mon Jun 09 08:57:12 2014] [error] [client x.x.x.x]      PUPPETDB_KEY = /var/lib/puppet/ssl/private_keys/node.example.com.pem
[Mon Jun 09 08:57:12 2014] [error] [client x.x.x.x]                     ^
[Mon Jun 09 08:57:12 2014] [error] [client x.x.x.x]  SyntaxError: invalid syntax

I'm using nibalizer-puppetboard 2.4.0 with Puppet 3.6.1. Thanks.

@nibalizer
Copy link
Member

I saw some chatter about this on IRC today. Is the report here the latest
update/status on the issue you are having?

On Mon, Jun 9, 2014 at 2:57 AM, Jonathan [email protected] wrote:

Some attributes in the puppetboard class are not quoted properly when
their values are written out to default_settings.py.

This is my calling syntax, and for some variables I have had to
double-encapsulate strings in single quotes and double quotes, so they are
written out to default_settings.py with single quotes.

class { 'puppetboard':
manage_virtualenv => true,
puppetdb_host => 'puppet.example.com',
puppetdb_port => "'8081'",
puppetdb_key => "'/var/lib/puppet/ssl/private_keys/${::fqdn}.pem'",
puppetdb_ssl => "'true'",
puppetdb_cert => "'/var/lib/puppet/ssl/public_keys/${::fqdn}.pem'",
}

When these variables are not double-quoted, this happens in the apache log
because config values are written without quotes:

[Mon Jun 09 08:57:12 2014] [error] [client x.x.x.x] PUPPETDB_KEY = /var/lib/puppet/ssl/private_keys/node.example.com.pem
[Mon Jun 09 08:57:12 2014] [error] [client x.x.x.x] ^
[Mon Jun 09 08:57:12 2014] [error] [client x.x.x.x] SyntaxError: invalid syntax

I'm using nibalizer-puppetboard 2.4.0 with Puppet 3.6.1. Thanks.


Reply to this email directly or view it on GitHub
https://github.com/nibalizer/puppet-module-puppetboard/issues/35.

Spencer Krum
(619)-980-7820

@djjudas21
Copy link
Author

During the day I found that it is not necessary to quote integers like puppetdb_port => "'8081'". I still have to double-quote strings as in puppetdb_key and puppetdb_cert.

@nibalizer
Copy link
Member

Can you provide a complete example of your instantiation class?

Thanks

On Mon, Jun 9, 2014 at 3:12 PM, Jonathan [email protected] wrote:

During the day I found that it is not necessary to quote integers like puppetdb_port
=> "'8081'". I still have to double-quote strings as in puppetdb_key and
puppetdb_cert.


Reply to this email directly or view it on GitHub
https://github.com/nibalizer/puppet-module-puppetboard/issues/35#issuecomment-45550991
.

Spencer Krum
(619)-980-7820

@djjudas21
Copy link
Author

What do you need that's not in my original post? That is the complete instantiation of class { 'puppetboard':, the other stuff in my manifest does noddy things like add firewall rules.

@nibalizer
Copy link
Member

I am poking at this now.

@nibalizer
Copy link
Member

Couple early responses. Yes this is a bug, we should be handling the quoting for you. Second your invocation is wrong, you need to be passing in 'True' for the ssl_verify because that gets handed to python directly as a string. That could be considered a bug in the module probably. Also you need to pass it the certificate under puppetdb_cert not the private key. This file will be found at puppet config print hostcert

@nibalizer
Copy link
Member

Hi @djjudas21 I've added quoting for the puppetdb_cert and puppetdb_key parameters. Setting the path to your ca file is still really janky. I've added documentation for this into the README and added some beaker tests as well.

Can you try #37 out? Or if it's been merged before you read this, can you try master as well?

Thanks,
Spencer

@djjudas21
Copy link
Author

Hi, just picked up your message. The diffs look good to me but our puppet modules are all deployed from puppet forge directly, so it's hard to slipstream in non-official releases.

Thanks for your tips about what I'm passing in. I think I'd fixed most of these myself after talking to the the developer of puppetboard itself.

I'm heading off home for the weekend now but on Monday I'll have a think about deploying this test code without using puppet forge. Thanks for your effort checking this issue out.

Cheers,
Jonathan

@nibalizer
Copy link
Member

I think we fixed this ya?

@djjudas21
Copy link
Author

Yes, I'm happy with the latest code. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants