This guide is intended for users and developers. If you're brand new to mgmt
,
it's probably a good idea to start by reading an
introductory article about the engine
and an introductory article about the language.
There are other articles and videos available if you'd like to
learn more or prefer different formats. Once you're familiar with the general
idea, or if you prefer a hands-on approach, please start hacking...
You can either build mgmt
from source, or you can download a pre-built
release. There are also some distro repositories available, but they may not be
up to date. A pre-built release is the fastest option if there's one that's
available for your platform. If you are developing or testing a new patch to
mgmt
, or there is not a release available for your platform, then you'll have
to build your own.
The latest releases can be found here. An alternate mirror is available here.
Make sure to verify the signatures of all packages before you use them. The signing key can be downloaded from https://purpleidea.com/contact/#pgp-key to verify the release.
If you've decided to install a pre-build release, you can skip to the Running mgmt section below!
You'll need some dependencies, including golang
, and some associated tools.
- You need golang version 1.16 or greater installed.
- To install on rpm style systems:
sudo dnf install golang
- To install on apt style systems:
sudo apt install golang
- To install on macOS systems install Homebrew
and run:
brew install go
- To install on rpm style systems:
- You can run
go version
to check the golang version. - If your distro is too old, you may need to download a newer golang version.
- You can skip this step, as your installation will default to using
~/go/
, but if you do not have aGOPATH
yet and want one in a custom location, create one and export it:
mkdir $HOME/gopath
export GOPATH=$HOME/gopath
- You might also want to add the GOPATH to your
~/.bashrc
or~/.profile
. - For more information you can read the GOPATH documentation.
- Download the
mgmt
code and switch to that directory:
git clone --recursive https://github.com/purpleidea/mgmt/ ~/mgmt/
cd ~/mgmt/
- Add
$GOPATH/bin
to$PATH
export PATH=$PATH:$GOPATH/bin
- Run
make deps
to install system and golang dependencies. Take a look atmisc/make-deps.sh
if you want to see the details of what it does.
- Now run
make
to get a freshly builtmgmt
binary. If this succeeds, you can proceed to the Running mgmt section below!
Installation of mgmt
from distribution packages currently needs improvement.
They are not always up-to-date with git master and as such are not recommended.
At the moment we have:
Please contribute more and help improve these! We'd especially like to see a Debian package!
- Run
mgmt run --tmp-prefix lang examples/lang/hello0.mcl
to try out a very simple example! If you built it from source, you'll need to use./mgmt
from the project directory. - Look in that example file that you ran to see if you can figure out what it
did! You can press
^C
to exitmgmt
. - Have fun hacking on our future technology and get involved to shape the project!
Please look in the examples/lang/ folder for some more examples!