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

Client.json integers are saved as double quoted strings on first run #399

Closed
hhtpcd opened this issue Aug 5, 2015 · 2 comments
Closed

Comments

@hhtpcd
Copy link

hhtpcd commented Aug 5, 2015

I've noticed that when I provision a client with this module, and include client_keepalives options, on the first run the services will fail to start because the threshold/critical/warning values are double quoted strings and not integers in the JSON. If I do a second puppet apply run then the values are noticed as different and changed to integers in client.json.

I've poked around the providers/types and can see the logic that compares is vs should and enacts changes, but I can't figure out why the initial config is being written without integers. I can re-create this by deleting the contents of client.json and doing another manual puppet run to get double quoted strings then integers.

I've included the sensu dec below. This is with the latest module pulled today b3afef6 1.5.5 I believe, on Ubuntu 14.04 x64 and Puppet 3.8.1.

class { '::sensu':
    client                      => true,
    server                      => false,
    rabbitmq_user               => 'sensu',
    rabbitmq_password           => 'password',
    rabbitmq_host               => '192.168.0.123',
    rabbitmq_vhost              => '/sensu',
    rabbitmq_port               => '5671',
    subscriptions               => 'sensu-test',
    rabbitmq_ssl                => true,
    rabbitmq_ssl_cert_chain     => "puppet:///modules/base_config/cert.pem",
    rabbitmq_ssl_private_key    => "puppet:///modules/base_config/key.pem",
    use_embedded_ruby           => true,
    sensu_plugin_provider       => sensu_gem,
    sensu_plugin_version        => 'present',
    rabbitmq_reconnect_on_error => true,
    # install_repo                => true,
    purge_config                => true,
    client_keepalive            => {
        "refresh"    => 120,
        "thresholds" => {
            "critical" => 60,
            "warning"  => 30
        }
    }
}
@hhtpcd
Copy link
Author

hhtpcd commented Aug 6, 2015

I've added a client_custom block to the above ::sensu, and numbers in that block are not being double quoted on first run or when no client.json config exists.

client_custom => {
    'things'  => 'happening',
    'more'    => 20,
    'another' => {
        'thing' => 90,
    },
},
{
  "client": {
    "name": "computer-name",
    "address": "192.168.131.33",
    "subscriptions": [
      "Webserver"
    ],
    "bind": "127.0.0.1",
    "port": "3030",
    "safe_mode": false,
    "things": "happening",
    "more": 20,
    "another": {
      "thing": 90
    },
    "keepalive": {
      "refresh": "120",
      "thresholds": {
        "critical": "90",
        "warning": "60"
      }
    }
  }
}

jlambert121 added a commit that referenced this issue Dec 14, 2015
@jlambert121
Copy link
Contributor

Would you make sure #458 merged into master solves this? 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