GithubHelp home page GithubHelp logo

slack's Introduction

Rudimentary configuration management

These scripts handle configuration management for Debian-based systems. Before running, use the bootstrap.sh script to make sure that Python and its required modules are installed. The script also installs the zsh to demonstrate package removal.

Layout

All the Python classes that drive this tool are in the cfgmgr directory. The Cfgmgr class should do what you want and it's only necessary to instatiate an object of that type, feeding it a YAML file, then execute it by running a _run_config against the class object.

The run_cfg.py file has this class all ready to go, so run this script to invoke the configuration manager. It's taking the manifest.yaml file as its configuration file.

Configuration

The configuration file is in the YAML format for easier readability. Each object has a name declaration, then a series of configuration options for that object. Dependencies on other objects are honored by declaring the object on which the object depends. For instance:

package_1: packages install: - package1

package_1_config: files: file: /etc/package.cfg owner: root depends:

  • package_1 service:
  • package_service: restart

package_1_service: service:

  • package_service: start

Those stanzas will install package one, then restart (or start for the first time) it with a configuration file. Should the configuration file template change, the service will also restart. The service stanza should keep the service running.

Depends declarations

All the following stanzas support the depends declaration to establish dependencies between stanzas, creating better predictability.

Packages stanzas

Package declarations include:

  1. install declarations. Itemize a list of packages under it.
  2. remove declarations. Itemize a list of packages to remove under it.

Files stanzas

Files declarations include:

  1. file declarations. This name is for the target file.
  2. template declarations. These files run through the Jinja2 Python templating engine.
  3. owner declarations. These are for the POSIX usernames such as "root".
  4. group declartions. These are for the POSIX groups as such as "wheel."
  5. perms declarations. Use the Unix octal notation, such as 644 for write/read/read for owner/group/other.
  6. delete declarations. For when you really want that file deleted.

Service stanzas

  1. service declarations. The service declarations pass directly to the service system command, so use stop, start, or restart.

Other notes

System calls to install packages or restart services have a ten minute timeout. If operations fail to meet that timeout, the script kills the executing operation. Be aware that killing package installations can adversely affect the Debian packaging system by leaving lock files behind.

slack's People

Contributors

mwmanley avatar

Watchers

James Cloos 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.