Many years ago I built and demoed a prototype of a simple web ui with a slider, and as you moved it left and right, it started up or shutdown some number of virtual machines. The webui was standalone code, but the rough idea of having events from a high-level overview flow into mgmt, was what I wanted to test out. At this stage, I didn't even have the language built yet. This prototype helped convince me of the way a web ui would fit into everything. Years later, I build an autogrouping prototype which looks quite similar to what we have today. I recently picked it back up to polish it a bit more. It's certainly not perfect, and might even be buggy, but it's useful enough that it's worth sharing. If I had more cycles, I'd probably consider removing the "store" mode, and replace it with the normal "value" system, but we would need the resource "mutate" API if we wanted this. This would allow us to directly change the "value" field, without triggering a graph swap, which would be a lot less clunky than the "store" situation. Of course I'd love to see a GTK version of this concept, but I figured it would be more practical to have a web ui over HTTP. One notable missing feature, is that if the "web ui" changes (rather than just a value changing) we need to offer to the user to reload it. It currently doesn't get an event for that, and so don't confuse your users. We also need to be better at validating "untrusted" input here. There's also no major reason to use the "gin" framework, we should probably redo this with the standard library alone, but it was easier for me to push out something quick this way. We can optimize that later. Lastly, this is all quite ugly since I'm not a very good web dev, so if you want to make this polished, please do! The wasm code is also quite terrible due to limitations in the compiler, and maybe one day when that works better and doesn't constantly deadlock, we can improve it.
mgmt: next generation config management!
Tip
Tip
About:
Mgmt is a real-time automation tool. It is familiar to existing configuration
management software, but is drastically more powerful as it can allow you to
build real-time, closed-loop feedback systems, in a very safe way, and with a
surprisingly small amount of our mcl code. For example, the following code
will ensure that your file server is set to read-only when it's friday.
import "datetime"
$is_friday = datetime.weekday(datetime.now()) == "friday"
file "/srv/files/" {
state => $const.res.file.state.exists,
mode => if $is_friday { # this updates the mode, the instant it changes!
"0550"
} else {
"0770"
},
}
It can run continuously, intermittently, or on-demand, and in the first case, it will guarantee that your system is always in the desired state for that instant! In this mode it can run as a decentralized cluster of agents across your network, each exchanging information with the others in real-time, to respond to your changing needs. For example, if you want to ensure that some resource runs on a maximum of two hosts in your cluster, you can specify that as well:
import "sys"
import "world"
# we'll set a few scheduling options:
$opts = struct{strategy => "rr", max => 2, ttl => 10,}
# schedule in a particular namespace with options:
$set = world.schedule("xsched", $opts)
if sys.hostname() in $set {
# use your imagination to put something more complex right here...
print "i got scheduled" {} # this will run on the chosen machines
}
As you add and remove hosts from the cluster, the real-time schedule function
will dynamically pick up to two hosts from the available pool. These specific
functions aren't intrinsic to the core design, and new ones can be easily added.
Please read on if you'd like to learn more...
Community:
Come join us in the mgmt community!
| Medium | Link |
|---|---|
| Matrix | #mgmtconfig on Matrix.org |
| IRC | #mgmtconfig on Libera.Chat |
| @mgmtconfig & #mgmtconfig | |
| Mailing list | looking for a new home, suggestions welcome |
| Patreon | purpleidea on Patreon |
Status:
Mgmt is a next generation automation tool. It has similarities to other tools in the configuration management space, but has a fast, modern, distributed systems approach. The project contains an engine and a language. Please have a look at an introductory video or blog post.
Mgmt is a fairly new project. It is usable today, but not yet feature complete. With your help you'll be able to influence our design and get us to 1.0 sooner! Interested users should read the quick start guide.
Documentation:
Please read, enjoy and help improve our documentation!
| Documentation | Additional Notes |
|---|---|
| quick start guide | for everyone |
| frequently asked questions | for everyone |
| general documentation | for everyone |
| resource reference | for everyone |
| function reference | for everyone |
| language guide | for everyone |
| function guide | for mgmt developers |
| resource guide | for mgmt developers |
| style guide | for mgmt developers |
| contributing guide | for mgmt contributors |
| service API guide | for external developers |
| godoc API reference | for mgmt developers |
| prometheus guide | for everyone |
| puppet guide | for puppet sysadmins |
| development | for mgmt developers |
| videos | for everyone |
| blogs | for everyone |
Questions:
Please ask in the community! If you have a well phrased question that might benefit others, consider asking it by sending a patch to the FAQ section. I'll merge your question, and a patch with the answer!
Get involved:
Feel free to grab one of the straightforward #mgmtlove issues if you're a first time contributor to the project or if you're unsure about what to hack on! Please get involved by working on one of these items or by suggesting something else! There are some lower priority issues and harder issues available in our TODO file. Please have a look.
Bugs:
Please set the DEBUG constant in main.go
to true, and post the logs when you report the issue.
Feel free to read my article on debugging golang programs.
Patches:
We'd love to have your patches! Please send them by email, or as a pull request.
On the web:
Blog posts and recorded talks about mgmt are listed here!
Happy hacking!
