mgmt

command module
Version: v0.0.0-...-f7e5402 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

README

mgmt: next generation config management!

mgmt!

Go Report Card Build Status Build Status GoDoc IRC Patreon Liberapay

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 amout 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
IRC #mgmtconfig on Libera.Chat
Twitter @mgmtconfig & #mgmtconfig
Mailing list mgmtconfig-list@redhat.com
Patreon purpleidea on Patreon
Liberapay purpleidea on Liberapay

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
language guide for everyone
function guide for mgmt developers
resource guide for mgmt developers
style guide for mgmt developers
godoc API reference for mgmt developers
prometheus guide for everyone
puppet guide for puppet sysadmins
development for mgmt developers

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:

Read what people are saying and publishing about mgmt!

Happy hacking!

Documentation

Overview

Package main provides the main entrypoint for using the `mgmt` software.

Source Files

Directories

Path Synopsis
Package converger is a facility for reporting the converged state.
Package converger is a facility for reporting the converged state.
Package engine represents the implementation of the resource engine that runs the graph of resources in real-time.
Package engine represents the implementation of the resource engine that runs the graph of resources in real-time.
graph
Package graph contains the actual implementation of the resource graph engine that runs the graph of resources in real-time.
Package graph contains the actual implementation of the resource graph engine that runs the graph of resources in real-time.
resources
Package resources contains the implementations of all the core resources.
Package resources contains the implementations of all the core resources.
resources/packagekit
Package packagekit provides an interface to interact with packagekit.
Package packagekit provides an interface to interact with packagekit.
traits
Package traits contains all the definitions and implementations of the core resource traits that are imported by all the resource implementations.
Package traits contains all the definitions and implementations of the core resource traits that are imported by all the resource implementations.
util
Package util contains utility functions that are specific to the resource engine.
Package util contains utility functions that are specific to the resource engine.
Package etcd implements the distributed key value store and fs integration.
Package etcd implements the distributed key value store and fs integration.
fs
Package fs implements a very simple and limited file system on top of etcd.
Package fs implements a very simple and limited file system on top of etcd.
scheduler
Package scheduler implements a distributed consensus scheduler with etcd.
Package scheduler implements a distributed consensus scheduler with etcd.
examples
lib
libmgmt example of send->recv
libmgmt example of send->recv
longpoll
This is an example longpoll client.
This is an example longpoll client.
Package gapi defines the interface that graph API generators must meet.
Package gapi defines the interface that graph API generators must meet.
Package lang is the mcl language frontend that implements the reactive DSL that lets users model their desired state over time.
Package lang is the mcl language frontend that implements the reactive DSL that lets users model their desired state over time.
ast
Package ast contains the structs implementing and some utility functions for interacting with the abstract syntax tree for the mcl language.
Package ast contains the structs implementing and some utility functions for interacting with the abstract syntax tree for the mcl language.
download
Package download is used for downloading language modules from git.
Package download is used for downloading language modules from git.
funcs
Package funcs provides a framework for functions that change over time.
Package funcs provides a framework for functions that change over time.
funcs/facts
Package facts provides a framework for language values that change over time.
Package facts provides a framework for language values that change over time.
funcs/vars
Package vars provides a framework for language vars.
Package vars provides a framework for language vars.
gapi
Package gapi is the Graph API implementation for the mcl language frontend.
Package gapi is the Graph API implementation for the mcl language frontend.
inputs
Package inputs contains the input parsing logic for how mcl module entrypoints are handled for the language.
Package inputs contains the input parsing logic for how mcl module entrypoints are handled for the language.
interfaces
Package interfaces contains the common interfaces used in the mcl language.
Package interfaces contains the common interfaces used in the mcl language.
interpolate
Package interpolate contains the string interpolation parser and associated structs and code.
Package interpolate contains the string interpolation parser and associated structs and code.
interpret
Package interpret contains the implementation of the actual interpret function that takes an AST and returns a resource graph.
Package interpret contains the implementation of the actual interpret function that takes an AST and returns a resource graph.
parser
Package parser contains the lexer and parser for the mcl language.
Package parser contains the lexer and parser for the mcl language.
types
Package types provides a framework for our mcl language values and types.
Package types provides a framework for our mcl language values and types.
unification
Package unification contains the code related to type unification for the mcl language.
Package unification contains the code related to type unification for the mcl language.
util
Package util contains utility functions that are specific to the mcl language.
Package util contains utility functions that are specific to the mcl language.
Package langpuppet implements an integration entrypoint that combines lang and Puppet.
Package langpuppet implements an integration entrypoint that combines lang and Puppet.
Package lib is the home for the mgmt core library.
Package lib is the home for the mgmt core library.
This program works exactly like the `tee` program, if it was invoked with an implicit --ignore-interrupts argument, and if it also had an --ignore-quit argument.
This program works exactly like the `tee` program, if it was invoked with an implicit --ignore-interrupts argument, and if it also had an --ignore-quit argument.
Package pgp contains the code related to both code and host signing and encryption.
Package pgp contains the code related to both code and host signing and encryption.
Package pgraph represents the internal "pointer graph" that we use.
Package pgraph represents the internal "pointer graph" that we use.
Package prometheus provides functions that are useful to control and manage the built-in prometheus instance.
Package prometheus provides functions that are useful to control and manage the built-in prometheus instance.
Package puppet provides the integration entrypoint for the puppet language.
Package puppet provides the integration entrypoint for the puppet language.
Package recwatch provides recursive file watching events via fsnotify.
Package recwatch provides recursive file watching events via fsnotify.
Package util contains a collection of miscellaneous utility functions.
Package util contains a collection of miscellaneous utility functions.
errwrap
Package errwrap contains some error helpers.
Package errwrap contains some error helpers.
safepath
Package safepath implements some types and methods for dealing with POSIX file paths safely.
Package safepath implements some types and methods for dealing with POSIX file paths safely.
semaphore
Package semaphore contains an implementation of a counting semaphore.
Package semaphore contains an implementation of a counting semaphore.
socketset
Package socketset is in API for creating a select style netlink socket to receive events from the kernel.
Package socketset is in API for creating a select style netlink socket to receive events from the kernel.
Package yamlgraph provides the facilities for loading a graph from a yaml file.
Package yamlgraph provides the facilities for loading a graph from a yaml file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL