eater/order

This package is abandoned and no longer maintained. No replacement package was suggested.

Automated System Management in PHP

Maintainers

Details

c.darenet.org/eater/Order.git

Installs: 11

Dependents: 0

Suggesters: 0

Security: 0

Type:project

dev-master 2015-12-05 10:41 UTC

This package is not auto-updated.

Last update: 2019-02-20 18:47:17 UTC


README

Travis (Unit tests): Build Status Gitlab CI (Integration tests): Build Status

Automated System Management in PHP (because why not?)

Order is a system management tool, designed to make it easier for you to manage and provision your servers. ehh... who am I kidding. Order is an attempt to rewrite puppet in php, with totally no knowledge about how puppet works on the inside.

Philosophy

The philosophy behind the names, is simple, order is gonna bring order to your system, and you're gonna write the laws, next you can reqeust papers from the system, or as you know them in puppet, facts. currently the puppet facter is used for papers.

Law files

Law files are the files where you define the rules for your system, like the .pp or puppet files in puppet.

Syntax of law files

The biggest bottleneck I found, was finding a syntax that wouldn't hurt your fingers to write in php, but after some hacking I found a syntax, that suited in my opinion the purpose well.

An example of a law file would be:

<?php

file("/etc/hostname")
  ->contents(config('info.hostname'))
  ->require(service("dhcpd"));

service("dhcpd")
  ->enable();

$php = which(
    paper('os'),
    [
      "FreeBSD" => "php56",
      "/Ubuntu|Debian/" => "php5",
      "php"
    ]
  );

package($php)->install();

// inclusion is done by prefixing a file with `law://`
include 'law://noop.law';

This example would change the file /etc/hostname to the contents of config parameter info.hostname, but only after the service dhcpd is enabled, next it would install the php package, for FreeBSD it would install the php56 package and for Ubuntu and Debian it would install php5, while for the rest it would just install the package php, after that it would include the law file noop.law.

Papers

Papers identify what keeps your system's heart beating, you can use papers to request, the os, kernel, processors or if you're really feeling it, you can request the version of ruby on the machine with ruby.version, since we're using the puppet facter, data is currently limited to that, but I'm planning to write that part too in php.

for more info about the papers, run facter on your machine.

Config

The config file, will be written in yaml, or json. just what you like most. config variables can be requested easily with the config function. f.x. if you want to request the first hostname you defined in this example config.

info:
  hostname:
    - foo
    - bar

you just need to call `config('info.hostname.0');

Using it

Currently Im still writing most of it, so it isn't in any usable state right now, but feel free to look around.

Disclaimer

I am hereby not responsible for any damage done, while using this tool. amen.