Giter Club home page Giter Club logo

bakeit's People

Contributors

1dustindavis avatar clburlison avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bakeit's Issues

For local config purposes

It would be awesome if bakeit could download a chef-repo from a git repo and then run chef-client locally. This would allow users to set up their own personal machines.

Here is a pure go git (https://github.com/src-d/go-git). Once that is implemented we could then extend the config options to embed a read-only ssh key. Then add the tasks to setup a local machine.

For the a private ssh key example see: src-d/go-git#397 (comment)

Use errors package

All error returns should be rewritten with the errors package. fmt.Errorf swallows the original type and we're not consistent on returning the errors. All sub packages in the /src/ directory should return errors to the setup_*.go files.

Another bonus is this should make tracking where an error came from easier.

resource.syso warning message

Purely cosmetic but annoying.

After implementing #2 the following warning message is printed to standard out on macOS and Linux during make build-all, make build, & make test. Since this compiled file, resource.syso is only compatible with windows we get the following warning often.

# github.com/clburlison/bakeit/cmd/bakeit
ld: warning: ignoring file /var/folders/50/llszyjb949ggdgsg9mcqdg8w0000gn/T/go-link-450050931/000000.o, file was built for unsupported file format ( 0x64 0x86 0x01 0x00 0x00 0x00 0x00 0x00 0x07 0x06 0x00 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): /var/folders/50/llszyjb949ggdgsg9mcqdg8w0000gn/T/go-link-450050931/000000.o

Maybe we can detect the host platform and move this file into place for Windows builds and delete the file afterwards? It would be great if we could exclude this file on none windows platform builds/testing but I haven't found any information on this yet.

Windows version limit

Make sure this is ran on Windows 7+. This should also be able to support windows server flavors. Basically make sure Vista and XP fail.

As such this might become more important in the future when Windows 7 is end of life.

Template out client.rb file

Need to dynamically create the client.rb file. Ideally this would be setup so we have a base config then layer platform specific variables on top of the base config.

make lint should fail CI

When the lint tasks (specifically the golint command) fails we should exit 1. The only gotcha with this is the failure needs to allow the task to run first then check and fail. This way users can get the full golint output.

#!/bin/bash -eo pipefail
make lint
vendor/github.com/groob/mackit/example/password.go:24:2: comment not terminated
vendor/github.com/groob/mackit/example/password.go:38:3: expected '}', found 'EOF'
All .go files formatted correctly
/go/src/github.com/clburlison/bakeit/src/setup_linux.go:9:1: exported function Setup should have comment or be unexported
/go/src/github.com/clburlison/bakeit/src/chef/client.go:1:1: package comment should be of the form "Package chef ..."
/go/src/github.com/clburlison/bakeit/src/config/config.go:66:2: exported var ChefClientLogLevel should have comment or be unexported
/go/src/github.com/clburlison/bakeit/src/config/config.go:68:2: comment on exported var ChefClientSSLVerifyMode should be of the form "ChefClientSSLVerifyMode ..."
/go/src/github.com/clburlison/bakeit/src/node/node.go:4:6: type name will be used as node.NodeInfoObject by other packages, and that stutters; consider calling this InfoObject
/go/src/github.com/clburlison/bakeit/src/serial/serial_linux.go:3:1: exported function GetSerialNumber should have comment or be unexported

See https://circleci.com/gh/clburlison/bakeit/37

Vendor mackit code

Groob maintains the mackit project as test code and it could break at anytime. Move the pkg and dmg code into bakeit directly.

Unable to disable multiple ohai plugins

Currently we can't disable multiple ohai plugins since the template code below don't properly handle the comma and line break.

bakeit/client/client.go

Lines 48 to 55 in 0e41518

{{- if .OhaiDisabledPlugins}}
{{ $disabled_plugins := .OhaiDisabledPlugins }}
ohai.disabled_plugins = [
{{ range $disabled_plugins }}
{{- . -}}
{{ end }}
]
{{end}}

Use the following config code to create a broken client.rb file.

	ChefClientOhaiDisabledPlugins = map[string][]string{
		"darwin":  {":Passwd", ":SomethingElse"},
		"windows": {},
		"linux":   {},
	}

Change default verbose output

Right now the verbose output to stdout is set to true

RootCmd.PersistentFlags().BoolVarP(&config.Verbose, "verbose", "v", true, "verbose output")
in a future release this should default to false. This will make the output to stdout cleaner and easier to follow. Then it can still be turned on with bakeit --verbose.

Add timeout option for pre/post commands

When #33 was implemented we didn't worry about commands that might never finish running. We are checking for exit codes which should cover us 99% of the time. The next level is to add a timeout option so if the command never completes bakeit will continue with the workflow.

Need better error handling in checkExt

Crash in checkExt

testing
Downloading https://packages.chef.io/files/stable/chef/13.6.4/mac_os_x/10.13/chef-13.6.4-1.dmg...
  200 OK
  transferred 12548617 / 49166602 bytes (25.52%)
  transferred 29211100 / 49166602 bytes (59.41%)
  transferred 44546569 / 49166602 bytes (90.60%)
Download saved to ./chef-13.6.4-1.dmg 
File type: zlib. MIME: application/zlib
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x42db227]

goroutine 1 [running]:
main.checkExt.func1(0x0, 0x0, 0x0, 0x0, 0x4523720, 0xc42042c420, 0x20, 0x434b900)
	/Users/clayton.burlison/Documents/src/go/src/github.com/clburlison/bakeit/cmd/bakeit/main.go:114 +0x47
path/filepath.Walk(0x0, 0x0, 0xc42021d0c0, 0xc4201502d0, 0xc4202ae000)
	/usr/local/go/src/path/filepath/path.go:401 +0x76
main.checkExt(0x438a705, 0x4, 0x0, 0x0, 0x0, 0xc42021d080, 0x2)
	/Users/clayton.burlison/Documents/src/go/src/github.com/clburlison/bakeit/cmd/bakeit/main.go:113 +0xa4
main.main()
	/Users/clayton.burlison/Documents/src/go/src/github.com/clburlison/bakeit/cmd/bakeit/main.go:78 +0xd73

icon for macOS

I think we don’t actually want this but let us investigate. On macOS we would need to wrap out binary into a .app so that we can give it an icon. Seems very overkill since this will mostly be called for the command line.

https://github.com/Xeoncross/macappshell

Install Apple cli tools

This should default to False since chef client no longer requires this. Will need pkg receipts parsing and lots of extra bits for this to work.

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.