Skip to content

Instantly share code, notes, and snippets.

View ripienaar's full-sized avatar

R.I.Pienaar ripienaar

View GitHub Profile
go get github.com/choria-io/go-config@xxxxxxxx
#!/opt/puppetlabs/puppet/bin/ruby
require "mcollective"
include MCollective::RPC
c = rpcclient("your_agent")
printrpc(c.exporter(:url => "...", :metrics => [...,...,...]))
=== RUN TestAckFloor
--- FAIL: TestAckFloor (1.08s)
util_test.go:25: next DISPATCH: nats: timeout
FAIL
Process finished with exit code 1
package choria
default allow = false
# run puppet only in development, with a fact filter and in USEAST1
allow {
input.action = "runonce"
input.agent = "puppet"
input.collective = "development"
count(input.filter.fact) > 0
// Run puppet, unsplayed in noop mode, on all machines for customer acme
// in batches of 10 at a time with a 30 second sleep between batches
// against a specific puppet server
//
// This is all you need, there's no boilerplate removed other than imports
// this does:
//
// - connect to your choria network
// - handles all the security including pkcs11 (yubikeys)
// - discovery etc - though discovery is pluggable even here
@ripienaar
ripienaar / 1enable.go
Last active December 9, 2019 16:09
generated golang choria client
// equivelant of:
//
// mco rpc puppet enable -W country=mt
package main
import (
"context"
"fmt"
"github.com/ripienaar/puppet/puppetclient"
exec{"/bin/echo one": refreshonly => true}
exec{"/bin/echo two": refreshonly => true}
file{"/tmp/test": content => "hello world"}
File["/tmp/test"] ~> Exec <| |>

This talk will discuss the design and implementation of a bespoke Continuous Delivery system suitable for delivering packaged software to 100s of thousands of nodes in a developer driven git based deployment scenario.

We will discus:

  • What came before - twice yearly deploys and how that impact velocity and software
  • How a system was designed and built that can today support 10s of deploys a day as well as handling initial node provision continuously at scale and in many locations across the world.
  • We'll look at developer CLI tooling to interact with the CD system
  • Observability of the system for real time global view
  • Manageability of the system wrt things like circuit breakers and big red buttons to stop bad deployments
  • A contract based packaging approach that was used to embed in each package its configuration management and monitoring.
#!/usr/sbin/choria yaegi
package main
import (
external "github.com/choria-io/go-external-agent"
)
type echoRequest struct {
Message string `json:"message"`
@ripienaar
ripienaar / hello.go
Last active September 20, 2019 14:44
#!/usr/bin/yaegi
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
)