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

sensu config block of uchiwa.json not generating properly with chef 13 #63

Open
JHBoricua opened this issue Feb 20, 2018 · 4 comments
Open

Comments

@JHBoricua
Copy link

Cookbook version

1.4.0

Chef-client version

version 13.7.16

Platform Details

Ubuntu 16.04.3

Scenario:

The /etc/sensu/uchiwa.json file being generated by chef-client when executing this recipe has an empty 'sensu' section. It seemst that the ['uchiwa']['api'] settings are not getting parsed by the default recipe.

Steps to Reproduce:

The cookbook is being run with default settings with the exception of these three changed attributes:

default['uchiwa']['version'] = '1.1.3-2'
default['uchiwa']['settings']['user'] = 'myuserchoice'
default['uchiwa']['settings']['pass'] = 'mypasswordchoice'

The "API Setting's" section in the attributes file has been left untouched.

Expected Result:

The dashboard should be populated.

Actual Result:

The dashboard is empty. If I manually enter the values for the sensu section in the uchiwa.json file and restart the service the dashboard populates, but the next chef run blows away the sensu settings from the json file.

This is what the uchiwa.json file looks like after chef runs:

linuxadmin@sensu01:~$ sudo cat /etc/sensu/uchiwa.json
{
  "uchiwa": {
    "user": "myadmin",
    "pass": "mypass",
    "refresh": 5,
    "host": "0.0.0.0",
    "port": 3000
  },
  "sensu": [

  ]
}

@majormoses
Copy link
Contributor

Does this work with chef 12? I am running it with chef 12 and it works as expected:

sudo cat /etc/sensu/uchiwa.json
{
  "uchiwa": {
    "user": "admin",
    "pass": "<REDACTED>",
    "refresh": 5,
    "host": "0.0.0.0",
    "port": 3000
  },
  "sensu": [
    {
      "name": "Sensu",
      "host": "127.0.0.1",
      "url": "http://127.0.0.1:4567",
      "path": "",
      "ssl": false,
      "timeout": 5
    }
  ]
}

The only attributes I touch are:

node['uchiwa']['settings']['pass'] = SecureRandom.urlsafe_base64(16)
node['uchiwa']['version'] = '0.26.3-1'
node['uchiwa']['install_method'] = 'http'

@JHBoricua
Copy link
Author

JHBoricua commented Feb 20, 2018

I downgraded this particular server to Chef Client 12.21.31 and the uchiwa.json file got properly created. So it seems to be an issue if you're running chef client version 13.

@majormoses majormoses changed the title sensu config block of uchiwa.json not generating. sensu config block of uchiwa.json not generating properly with chef 13 Feb 20, 2018
@thomasriley
Copy link

Pretty sure I used the Uchiwa cookbook with a Chef 13.x version a couple of months back with success. I will double check that fact and report back.

@majormoses
Copy link
Contributor

majormoses commented Feb 20, 2018

it might be a hidden breaking change somewhere in chef 13 then. I had similar (as in fun breaking changes that were not doccumented) problems in chef 12.

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

No branches or pull requests

3 participants