fins

package module
v0.0.0-...-8989b1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2015 License: MIT Imports: 15 Imported by: 0

README

fins

Inspect your Chef server

###Install Clone repo Run 'make && sudo make install'

###Usage

####Outdated fins outdated shows all cookbooks that are outdated in a Chef server based on what is currently marked as the latest in the supermarket.

A future release will allow for the specification of git repos to check for cookbooks.

# fins outdated
bin/fins -c ./fins.json outdated
consul:
  Chef Server: 0.9.0
  Supermarket: 0.9.1
aws:
  Chef Server: 2.5.0
  Supermarket: 2.7.0
yum:
  Chef Server: 3.5.4
  Supermarket: 3.6.0
ntp:
  Chef Server: 1.7.0
  Supermarket: 1.8.2
yum-repoforge:
  Chef Server: 0.5.0
  Supermarket: 0.5.1
runit:
  Chef Server: 1.5.18
  Supermarket: 1.6.0
database:
  Chef Server: 4.0.3
  Supermarket: 4.0.6

####Diff Shows the difference between what is on the chef server and what an environment allows through. So if an environment named staging has been pinned to a version older then it will show up in the diff.

If you pass two chef environments it will show you the difference between them.

Note: This is will only return cookbooks that are different.

# Difference between the chef server and staging
bin/fins -c ./fins.json diff staging
git:
  Environment Constraint: = 4.1.0
  Latest Cookbook Version: 4.2.1

# Difference between staging and production
bin/fins -c ./fins.json diff staging production
iptables:
  staging Constraint: no version constraint
  production Constraint: = 0.14.1
  Latest Cookbook Version: 1.0.0
monit:
  staging Constraint: no version constraint
  production Constraint: = 0.7.5
  Latest Cookbook Version: 0.7.5
pg-multi:
  staging Constraint: no version constraint
  production Constraint: = 0.1.2
  Latest Cookbook Version: 0.1.2
python:
  staging Constraint: no version constraint
  production Constraint: = 1.4.6
  Latest Cookbook Version: 1.4.7
locale:
  staging Constraint: = 1.0.2
  production Constraint: no version constraint
  Latest Cookbook Version: 1.0.2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheFile string = filepath.Join(os.Getenv("HOME"), ".fins_cache.json")

TODO: Implement caching

Functions

This section is empty.

Types

type Config

type Config struct {
	Chef struct {
		ChefServerUrl string `json:"chef_server_url"`
		NodeName      string `json:"node_name"`
		ClientKey     string `json:"client_key"`
		Version       string `json:"version"`
	} `json:"chef"`
	Supermarket struct {
		Endpoint string `json:"endpoint"`
	} `json:"supermarket"`
	SSL struct {
		Verify bool `json:"verify"`
	} `json:"ssl"`
}

func LoadConfig

func LoadConfig(config string) (Config, error)

Loads the fins json config file and returns a populated Config struct.

func (*Config) ChefClient

func (c *Config) ChefClient() (chef.Chef, error)

Returns a Chef struct based on information in the Config struct.

type Fins

type Fins struct {
	// contains filtered or unexported fields
}

Main data structure for fins, keeps the config, client(s)

func Init

func Init(config string, logLevel string) Fins

Returns a Fins struct

func (*Fins) ChefServerCookbooks

func (f *Fins) ChefServerCookbooks() ServerCookbooks

func (*Fins) DiffEnvironments

func (f *Fins) DiffEnvironments(env1 string, env2 string) int

Displays a diff between two chef environments

func (*Fins) DiffServer

func (f *Fins) DiffServer(envName string) int

Displays a diff between the chef server and an environment

func (*Fins) Environment

func (f *Fins) Environment(name string) (chef.Environment, bool)

func (*Fins) LatestSupermarketCookbook

func (f *Fins) LatestSupermarketCookbook(name string) supermarket.Cookbook

func (*Fins) LatestSupermarketCookbooks

func (f *Fins) LatestSupermarketCookbooks() SupermarketCookbooks

Returns a map of all latest cookbooks from supermarket that match the name on the chef server

func (*Fins) LoadCache

func (f *Fins) LoadCache()

Loads a fresh(Less than 10 minutes old) cache from disk if one exists does not error if one is not found

func (*Fins) Outdated

func (f *Fins) Outdated() int

Displays Outdated Versions of Cookbooks in a Chef server

type RemoteCache

type RemoteCache struct {
	// contains filtered or unexported fields
}

type ServerCookbooks

type ServerCookbooks map[string]string

type ServerEnvironments

type ServerEnvironments map[string]chef.Environment

type SupermarketCookbooks

type SupermarketCookbooks map[string]supermarket.Cookbook

Directories

Path Synopsis
Godeps
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/marpaia/chef-golang
This is a Go client for Opscode's Chef.
This is a Go client for Opscode's Chef.
_workspace/src/github.com/op/go-logging
Package logging implements a logging infrastructure for Go.
Package logging implements a logging infrastructure for Go.
pkg
version
Package version provides a VersionComparison method to make comparing versions easy.
Package version provides a VersionComparison method to make comparing versions easy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL