MCPcopy
hub / github.com/purpleidea/mgmt

github.com/purpleidea/mgmt @1.1.0 sqlite

repository ↗ · DeepWiki ↗ · release 1.1.0 ↗
5,472 symbols 20,272 edges 575 files 4,341 documented · 79%
README

mgmt: next generation config management!

mgmt!

Go Report Card Build Status GoDoc Matrix Support

[!TIP] Introductory guide now available!

[!TIP] Resource reference now available!

[!TIP] Function reference now available!

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 quite easily:

import "sys"
import "world"

# we'll set a few scheduling options, and request each node be scheduled:
schedule "mygroup42" {
    strategy => "rr",
    max => 2,
    ttl => 10,
}

# read the (changing) scheduled result stream:
$set = world.schedule("mygroup42")

if sys.hostname() in $set {
    # use your imagination to put something more interesting 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 elect 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
Website https://mgmtconfig.com/
Matrix #mgmtconfig on Matrix.org
Mastodon #mgmtconfig
Mailing list looking for a new home, suggestions welcome
Support m9rx.com for enterprise products and services

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 a video or blog post.

Mgmt is over ten years old! It is very powerful today, and has a solid foundation and architecture which has been polished over the years. It's used in production with a growing number of both corporate and individual users. Interested parties should start with the official website.

Sponsors:

Mgmt is generously sponsored by:

m9rx corporation

Mgmt received a generous grant from:

nlnet foundation

Please reach out if you'd like to sponsor!

Documentation:

Please read, enjoy and help improve our documentation!

Documentation Additional Notes
quick start guide for everyone
introductory guide for everyone
resource reference for everyone
function reference 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
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 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!

Bugs:

Please set the DEBUG constant in main.go to true, and post the logs when you report the issue. Please include the full mcl code you used as well as the exact command you used to run it. Feel free to read my article on debugging golang programs.

Contributing:

We'd love to have your patches! Please send them our way!

On the web:

Blog posts and recorded talks about mgmt are listed here!

Happy hacking!

Extension points exported contracts — how you extend this code

API (Interface)
API is the simple interface we expect for any tools items. [6 implementers]
tools/tools.go
StmtResContents (Interface)
StmtResContents is the interface that is met by the resource contents. Look closely for while it is similar to the Stmt [16 …
lang/ast/structs.go
Node (Interface)
Node represents either a Stmt or an Expr. It contains the minimum set of methods that they must both implement. In pract [35 …
lang/interfaces/ast.go
Initable (Interface)
Initable lets us have a way to pass in some data and handles if the struct wants them. Implementing this is optional. [191 …
entry/entry.go
API (Interface)
API is the simple interface we expect for any setup items. [6 implementers]
setup/setup.go
Res (Interface)
Res is the minimum interface you need to implement to define a new resource. [57 implementers]
engine/resources.go
AutoEdge (Interface)
The AutoEdge interface is used to implement the autoedges feature. [8 implementers]
engine/autoedge.go
API (Interface)
API is the simple interface we expect for any setup items. [6 implementers]
docs/docs.go

Core symbols most depended-on inside this repo

Logf
called by 1205
pgraph/pgraph.go
Wrapf
called by 1187
util/errwrap/errwrap.go
AddEdge
called by 371
pgraph/pgraph.go
Done
called by 367
lang/interfaces/func.go
NewType
called by 345
lang/types/type.go
String
called by 337
lang/interfaces/ast.go
Name
called by 336
engine/resources.go
NewGraph
called by 301
pgraph/pgraph.go

Shape

Method 3,166
Function 1,553
Struct 580
Interface 86
TypeAlias 76
FuncType 9
Class 2

Languages

Go99%
TypeScript1%
Python1%

Modules by API surface

lang/ast/structs.go453 symbols
lang/types/value.go141 symbols
util/safepath/safepath.go129 symbols
pgraph/pgraph.go68 symbols
engine/graph/autogroup/autogroup_test.go59 symbols
lang/interfaces/func.go58 symbols
util/util_test.go56 symbols
lang/interfaces/ast.go55 symbols
engine/resources/dhcp.go55 symbols
util/util.go53 symbols
engine/resources/http_server_ui/wasm_exec.js51 symbols
lang/funcs/txn/txn.go47 symbols

Dependencies from manifests, versioned

dario.cat/mergov1.0.2 · 1×
github.com/Jeffail/gabs/v2v2.7.0 · 1×
github.com/Microsoft/go-winiov0.6.2 · 1×
github.com/ProtonMail/go-cryptov1.1.5 · 1×
github.com/VictorLowther/simplexmlv0.0.0-2018071616444 · 1×
github.com/VictorLowther/soapv0.0.0-2015031415152 · 1×
github.com/alexflint/go-argv1.5.1 · 1×
github.com/alexflint/go-scalarv1.2.0 · 1×
github.com/armon/go-metricsv0.4.1 · 1×
github.com/ashcrow/osreleasev0.0.0-2018062617592 · 1×
github.com/aws/aws-sdk-gov1.55.6 · 1×
github.com/beorn7/perksv1.0.1 · 1×

For agents

$ claude mcp add mgmt \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact