clburlison / bakeit Goto Github PK
View Code? Open in Web Editor NEWA platform agnostic chef bootstrap tool
License: MIT License
A platform agnostic chef bootstrap tool
License: MIT License
Need to run chef once the chef client has been installed, the client.rb file laid on disk, etc.
Implement admin configured commands that could be called before or after the actual chef bootstrap. This would require additional config parameters for the commands and maybe a timeout for each.
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)
Once this project is open sourced add AppVeyor
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.
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.
Before we can run chef we need to lay down all of the configuration files.
Need to log run data to a specific file.
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.
Once this project is opened add coveralls.io
Or codecov.io
We should investigate signing bakeit on macOS.
sign: codesign -f -s "Mac Developer: Clayton Burlison (XXX)" $binary --deep
verify: codesign -dvvv build/darwin/bakeit
We will gain this ability for free once we implement https://github.com/josephspurrier/goversioninfo to solve #2. As such we should look into how much extra work it would be to add an icon for our windows binary.
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.
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
Groob maintains the mackit project as test code and it could break at anytime. Move the pkg and dmg code into bakeit directly.
Should be able to parse Chef's download page for latest
, or specific version for the OS that the bakeit
binary is running on.
Before releasing we need to bump the windows specific keys and run make generate
IE -
cb27b6c
It would be great if we could script this process.
The ability to check downloads against a known hash.
Currently we can't disable multiple ohai plugins since the template code below don't properly handle the comma and line break.
Lines 48 to 55 in 0e41518
Use the following config code to create a broken client.rb file.
ChefClientOhaiDisabledPlugins = map[string][]string{
"darwin": {":Passwd", ":SomethingElse"},
"windows": {},
"linux": {},
}
Right now the verbose output to stdout is set to true
Line 37 in 95fcdbc
bakeit --verbose
.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.
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
Wrap a LaunchDaemon + bakeit
into a package for macOS distribution.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.