Coder Social home page Coder Social logo

order's Introduction

Order

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.

order's People

Contributors

the-eater avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.