示例#1
0
	chefDir       = client.Flag("chef-dir", "Chef directory.").Short('C').Default("/etc/chef").ExistingDir()

	disable       = app.Command("disable", "Disable chef runs for this cluster.")
	disableReason = disable.Arg("reason", "Reason for disabling.").Required().String()

	enable = app.Command("enable", "Enable chef runs for this cluster.")

	shell          = app.Command("shell", "Drop into interactive shell in chef container")
	shellImage     = shell.Flag("image", "Chef image to use").Short('i').Default("quay.io/lumoslabs/chef:latest").String()
	shellContainer = shell.Flag("container", "Chef container to use. Overrides image if set.").Short('c').String()
	shellCache     = shell.Flag("cache-name", "Chef cache container name.").Default("chef-cache").String()

	client          = app.Command("client", "Execute a chef-client run.")
	clientEnv       = client.Flag("environment", "Chef environment.").Short('e').Default("_default").Envar("CHEF_ENVIRONMENT").String()
	clientRunlist   = client.Flag("runlist", "Chef runlist.").Short('r').Default(`''`).Envar("CHEF_RUNLIST").String()
	clientName      = client.Flag("node-name", "Chef node name.").Short('n').Default(namefmt.GetName("{role}-{env}-{instanceid}.aws.lumoslabs.com")).String()
	clientImage     = client.Flag("image", "Chef image to use").Short('i').Default("quay.io/lumoslabs/chef:latest").String()
	clientContainer = client.Flag("container", "Chef container to use. Overrides image if set.").Short('c').String()
	clientCache     = client.Flag("cache-name", "Chef cache container name.").Default("chef-cache").String()
	clientForceFmt  = client.Flag("force-formatter", "Show formatter output instead of logger output.").Short('F').Default("false").Bool()
	clientLocal     = client.Flag("local", "Run in local or chef-zero mode.").Short('z').Default("false").Bool()

	clientDefault = &clientRB{
		p: "/etc/chef/client.rb",
		v: map[string]string{
			"log_location":              "STDOUT",
			"chef_server_url":           "https://chef-priv.lumoslabs.com/organizations/lumoslabs",
			"validation_client_name":    "lumoslabs-validator",
			"validation_key":            "/etc/chef/validation.pem",
			"encrypted_data_bag_secret": "/etc/chef/encrypted_data_bag_secret",
			"trusted_certs_dir":         "/etc/chef/trusted_certs",
示例#2
0
func main() {
	kingpin.Version(version)
	kingpin.Parse()
	fmt.Print(namefmt.GetName(*format))
}