Giter VIP home page Giter VIP logo

uchiwa-chef's Introduction

Installs and configures Uchiwa. A simple dashboard for Sensu. This cookbook uses the omnibus packages.

Build Status pullreminders

Installation methods

The cookbook supports the following installation methods:

  • repo (default)
  • http

Supported platforms

These plateforms have been tested successfully.

  • Centos/RHEL 6 and 7 x86_64
  • Ubuntu 12.04 and 14.04 amd64

Contributing

  • Smaller commits are better if we need to cherry pick.
  • Make sure foodcritic runs without errors.
  • Make sure 'knife cookbook test' runs without errors.
  • Make sure 'kitchen test' runs without errors.
  • Make sure 'rubocop' runs without errors.
  • Write tests for your change.

Authors

Build and Release

For maintainers looking to release new versions of this cookbook you should follow this process:

  1. Add any README.md and CHANGELOG.md changes with links to Pull Requests. Commit this to develop branch.
  2. Update CHANGELOG.md with new version header and update diff links.
  3. Create a commit to then tag for release I would suggest something like this git commit -am 'prep for v$MAJOR.$MINOR.$RELEASE release'. Commit this to develop and make sure that everything is good to go (ci passing and such).
  4. Push from develop to master: git push origin develop:master
  5. checkout master branch and pull in changes: git checkout master && git pull
  6. Create a tagged release: hub release create v$MAJOR.$MINOR.$PATCH this should prompt you in an editor to modify the tag message. I typically leave it default, but feel free to include any useful release notes.
  7. Use the stove command to push the newly versioned cookbook to the supermarket: stove --no-git. This assumes that you have installed stove, properly configured authentication, and have been granted access to the supermarket.
  8. Optionally but recommended to update any associated PRs with a release link.

uchiwa-chef's People

Contributors

abinoda avatar amdprophet avatar bleything avatar dgillman avatar eheydrick avatar failshell avatar jonathanporta avatar majormoses avatar mark-wagner avatar osigida avatar palourde avatar tas50 avatar zarry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uchiwa-chef's Issues

Verify uchiwa is not installed

http.rb will download and install the package on every chef run. It should only try to install the package if it is not already installed. Probably want to use chef only_if

remote_file "#{Chef::Config[:file_cache_path]}/#{pkg}" do
source url
end

package pkg do
options package_options
source "#{Chef::Config[:file_cache_path]}/#{pkg}"
end

Support Disabling uchiwa auth

Hi,
I use an oauth2 proxy in front of uchiwa to identify my users, i don't need a second authentication layer.
My problem is the uchiwa cookbook forces me to use uchiwa authentication. While i could do a recipe who unsets theses attributes that would be a hack.

Perhaps you could remove default['uchiwa']['settings']['user'] = 'admin' and default['uchiwa']['settings']['pass'] = 'supersecret' in attributes/default.rb ?

Regards

Default uchiwa.json config is broken

The default configuration laid down by uchiwa-chef lacks port and path arguments. When uchiwa processes the config file the port and path become undefined. When uchiwa creates REST URLs these variables are interpolated as the string 'undefined' creating bogus URLs like "http://localhost:undefined" or "http://localhost/undefined/stashes".

The default configuration is defined in attributes/default.rb

# APIs Settings
default['uchiwa']['api'] = [
  {
    'name' => 'Sensu',
    'host' => '127.0.0.1',
    'ssl' => false,
    'timeout' => 5000
  }
]

Please update repo url

Please change

default['uchiwa']['apt_repo_url'] = 'http://repos.sensuapp.org/apt'
default['uchiwa']['yum_repo_url'] = 'http://repos.sensuapp.org'

to

default["uchiwa"]["apt_repo_url"] = "http://repositories.sensuapp.org/apt"
default["uchiwa"]["yum_repo_url"] = "http://repositories.sensuapp.org"

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

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": [

  ]
}

Uchiwa initd script from the repo has a bad name

Currently the cookbook fails on ubuntu 14.04.1, due to the /etc/init.d script coming from the repo has the name uchiwa.dpkg-dist instead of uchiwa. Had to be manually renamed before the cookbook runs successfully.

Uchiwa does not start

I tried starting Uchiwa with the service init script but it fails, running it manually results in the following error:

[email protected]:/etc/sensu# /opt/uchiwa/embedded/bin/node /opt/uchiwa/usr/src/uchiwa/app.js -c /etc/sensu/uchiwa.json  
{"name":"uchiwa","hostname":"ip-ip-X.X.X.X","pid":18046,"level":30,"msg":"Uchiwa is now listening on 0.0.0.0:8080","time":"2014-09-26T21:21:02.921Z","src":{"file":"/opt/uchiwa/usr/src/uchiwa/app.js","line":88},"v":0}

/opt/uchiwa/usr/src/uchiwa/lib/sensu.js:351
      name: fullClient.name,
                      ^
TypeError: Cannot read property 'name' of null
    at Sensu.eventData (/opt/uchiwa/usr/src/uchiwa/lib/sensu.js:351:23)
    at /opt/uchiwa/usr/src/uchiwa/lib/sensu.js:382:24
    at Array.forEach (native)
    at Function._.each._.forEach (/opt/uchiwa/usr/src/uchiwa/node_modules/underscore/underscore.js:79:11)
    at Sensu.buildEvents (/opt/uchiwa/usr/src/uchiwa/lib/sensu.js:381:5)
    at /opt/uchiwa/usr/src/uchiwa/lib/dc.js:76:18
    at IncomingMessage.<anonymous> (/opt/uchiwa/usr/src/uchiwa/lib/rest.js:37:9)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:919:16
    at process._tickCallback (node.js:419:13)

Package is not getting updated when using http as the install method

I updated the value of default['uchiwa']['version'] to 0.14.1-1 and when I re-run chef I see the package is downloaded and stored in /var/chef/cache but it is not upgraded. To upgrade the package I had to manually run dpkg -i on the package. The chef recipe should download the new package and and attempt to install it.

Password is saved as a node attribute!

Passwords and sensitive data should not be saved as a node attribute. This is a security issue, I've tried using node.run_state but that won't work. There needs to be an option to use an encrypted data bag (or chef vault), since that is where sensitive data in chef should live.

Package version automatically updated after `apt-get ugrade`

As stated in the title I have an issue where Uchiwa (installed from package) is upgraded to the latest version when apt-get upgrade is run. This wouldn't be a terrible issue if I wasn't installing a specific version via attributes, also the latest version seems to have some bugs and doesn't allow me to silence alarms.

This cookbook should probably pin the version used by apt. (Im using Ubuntu 14.04 FYI)

See: https://help.ubuntu.com/community/PinningHowto

testing slack integration.

Cookbook version

[Version of the cookbook where you are encountering the issue]

Chef-client version

[Version of chef-client in your environment]

Platform Details

[Operating system distribution and release version. Cloud provider if running in the cloud]

Scenario:

[What you are trying to achieve and you can't?]

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]

Actual Result:

[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]

Repo installation is handled by uchiwa and sensu itself

Right now, the sensu repo is added by the sensu-chef and the uchiwa-chef cookbook. This creates chef warnings and leads to other funny problems.

I would recommend these steps:

  • move the repo.rb to the sensu-chef cookbook
  • add a package.rb recipe to uchiwa-chef cookbook which installs only the uchiwa package itself
  • remove the repo handling from _linux.rb in sensu-chef cookbook

0.4.1-1 of deb package does not exist

Package no longer exists in debian repo?

Output of

kitchen converge repo-ubuntu-1404 
Reading package lists...       
[2015-02-20T12:19:35+00:00] INFO: execute[apt-get update] ran successfully       

      - execute apt-get update -o Dir::Etc::sourcelist='sources.list.d/sensu.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'       
[2015-02-20T12:19:35+00:00] INFO: execute[apt-get update] sending run action to execute[apt-cache gencaches] (immediate)       
    * execute[apt-cache gencaches] action run[2015-02-20T12:19:35+00:00] INFO: Processing execute[apt-cache gencaches] action run (/tmp/kitchen/cache/cookbooks/apt/providers/repository.rb line 151)       
Reading package lists...       
[2015-02-20T12:19:39+00:00] INFO: execute[apt-cache gencaches] ran successfully       

      - execute apt-cache gencaches       

  * apt_package[uchiwa] action install[2015-02-20T12:19:39+00:00] INFO: Processing apt_package[uchiwa] action install (uchiwa::repo line 56)       


    ================================================================================       
    Error executing action `install` on resource 'apt_package[uchiwa]'       
    ================================================================================       

    Mixlib::ShellOut::ShellCommandFailed       
           ------------------------------------

           Expected process to exit with [0], but received '100'
           ---- Begin output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----

           STDOUT: Reading package lists...
           Building dependency tree...
           Reading state information...
           STDERR: E: Version '0.4.1-1' for 'uchiwa' was not found
           ---- End output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----
           Ran apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 returned 100


       Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/uchiwa/recipes/repo.rb

            56: package 'uchiwa' do

            57:   options package_options
            58:   version node['uchiwa']['version']
            59: end

           Compiled Resource:
           ------------------

       # Declared in /tmp/kitchen/cache/cookbooks/uchiwa/recipes/repo.rb:56:in `from_file'

           apt_package("uchiwa") do
             action :install
             retries 0
             retry_delay 2
             default_guard_interpreter :default

             options "--force-yes -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confnew\""
             package_name "uchiwa"
             version "0.4.1-1"
             timeout 900
             declared_type :package
             cookbook_name "uchiwa"
             recipe_name "repo"
           end


[2015-02-20T12:19:40+00:00] INFO: Running queued delayed notifications before re-raising exception       

Running handlers:       
       [2015-02-20T12:19:40+00:00] ERROR: Running exception handlers

       Running handlers complete

       [2015-02-20T12:19:40+00:00] ERROR: Exception handlers complete
       [2015-02-20T12:19:40+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       Chef Client failed. 12 resources updated in 274.401437097 seconds

[2015-02-20T12:19:40+00:00] ERROR: apt_package[uchiwa] (uchiwa::repo line 56) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'       
---- Begin output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----       
STDOUT: Reading package lists...       
Building dependency tree...       
       Reading state information...
       STDERR: E: Version '0.4.1-1' for 'uchiwa' was not found
       ---- End output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----
       Ran apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 returned 100
[2015-02-20T12:19:41+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)       
>>>>>> Converge failed on instance <repo-ubuntu-1404>.
>>>>>> Please see .kitchen/logs/repo-ubuntu-1404.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sudo -E chef-client -z --config /tmp/kitchen/client.rb --log_level info --chef-zero-port 8889 --json-attributes /tmp/kitchen/dna.json]
>>>>>> ----------------------

uchiwa init.d is forced to /etc/sensu directory so attribute for node[:uchiwa][:sensu_homedir] is broke

Cookbook version

[Version of the cookbook where you are encountering the issue]
2.0.1

Chef-client version

[Version of chef-client in your environment]
12.17.44

Platform Details

[Operating system distribution and release version. Cloud provider if running in the cloud]
RHEL

Scenario:

[What you are trying to achieve and you can't?]
change the uchiwa.json location

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]
modify the uchiwa.sensu_homedir attribute

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]
file will be used and stored in different directory

Actual Result:

[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]
file is not updated in service init script

Bump version

can the version be bumped so we get the new repository changes?

yum repo doesn't work on Amazon Linux

baseurl "#{node['uchiwa']['yum_repo_url']}/#{branch}/$releasever/$basearch/"

When the repo is going to be configured on Amazon Linux AMI, it fails because the $releasever variable is set as "latest" so the repo URL tries to create as "http://repositories.sensuapp.org/yum/latest/..." and latest doesn't exist. In addition, if you try to lock the AMI to a specific version, $releasever changes to the AMI release date. Eg. "2018.02" and that link also doesn't work.

Update Cookbook to use HTTPS repos

The cookbook is currently accessing the Sensu repos via HTTP by default. We should update the cookbook to use HTTPS instead.

Expected Behavior

Packages should be downloaded via HTTPS only.

Current Behavior

Packages are downloaded via HTTP

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.