Coder Social home page Coder Social logo

bhodges / alkali Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zulily/alkali

0.0 2.0 0.0 35 KB

A SaltStack starter kit of sorts including state and pillar trees that provide just the basics for provisioning Linux instances that may be built upon.

License: Apache License 2.0

SaltStack 84.81% HTML 4.62% Shell 10.57%

alkali's Introduction

alkali

alkali is a collections of SaltStack states and pillar data that provide just the basics for provisioning Linux instances that may be built upon. alkali is a starter kit of sorts, to help new users to SaltStack get up-and-running quickly with the most commonly used, core packages.

Discussion

Salt state and pillar trees reside within this repository under the srv directory. These trees are meant to be run within a "provision" environment, and only when a special grain is set to True: in_provisioning.

The provision environment is intended to span across minions that are part of any salt environment. It contains a very common collection of states and is generally static, the intent is that these states will only be executed a single time like so:

salt -G 'in_provisioning:True' state.highstate saltenv=provision -l debug

States in other environments run post-provision phase, may change settings previously applied. The provision phase is not intended to meet the precise requirements of all possible instance types, but rather to apply useful defaults that may be extended and overridden from more specific environments and targeting.

While very uncommon, it is occasionally necessary to re-run an updated provision environment state file. If the dnsmasq_cache states are updated for example and it is desirable to run the updates on any hosts matching .dev. in the hostname:

salt '*.dev.*' state.sls dnsmasq_cache saltenv=provision -l debug

Getting Started

  • These states are currently only compatible with debian-based systems, with a few specific states ony compatible with Ubuntu. They have only been tested and are known to work on Ubuntu 14.04 and some later Ubuntu releases.
  • Provision states will work with a master minion setup in which the saltenv may be specified as an argument to the salt or salt-call commands.
  • Clone this repository and copy relevant directories to /srv/salt/provision and /srv/pillar/provision, most likely on a salt master
  • Bring up any instances that will be part of the cluster, with recent base Ubuntu installs preferably.
  • Make sure to have a base environment, with an empty top.sls file at a minimum, /srv/salt/base and /srv/pillar/base
  • Configure file_roots and pillar_roots (e.g. in /etc/salt/master), for example:
file_roots:
  base:
    - /srv/salt/base
  provision:
    - /srv/salt/provision

pillar_roots:
  base:
    - /srv/pillar/base
  provision:
    - /srv/pillar/provision
  • Any minions to be provisioned must have the in_provisioning grain set:
salt-call grains.setval in_provisioning True
  • Provision minions. From the master:
salt -G 'in_provisioning:True' state.highstate saltenv=provision -l debug

Compound targeting may be useful in some scenarios.

  • Once provisioned, removing the in_provisioning grain is recommended. If left in place, any general highstate will run the provision states, which is most likely undesirable.
salt-call grains.delval in_provisioning destructive=True

Included States

All of the included states have a README.rst file with additional details, but to summarize:

/etc/aliases management, based on pillar data.

States for configuring apt.

Management of apt sources.list.d files. Ubuntu-specific by default.

A list of packages to install at provision time, which require no configuration management.

Creates symlinks and directories based on pillar settings.

Installs and configures dnsmasq as a local caching daemon.

Management of /etc/hosts to ensure consistency, utilizes pillar data.

Installs iptables and performs tuning, but does not apply a ruleset.

Provides a simple mechanism for installing a specific kernel version and setting it to be the grub default. Typically run ad-hoc only.

Provides pillar-driven limits.conf and limits.conf.d management.

Management of motd legalese to be displayed at login.

Basic postfix installation and configuration for a smarthost setup.

The last state file to be run, creates /root/.alkali_provisioned.txt which indicates when the provision highstate was run.

Brings up rsyslog with logging to a centralized syslog server.

Pillar-driven kernel tuning, with reasonable defaults and host-function-specific setting capabilities.

Sets the timezone.

Other States

A few noteworthy formulas and states that are absent and will most likely be useful to a wide audience:

  • ntp - Using the SaltStack community formula is recommended
  • openssh - Using the SaltStack community formula is recommended
  • Log shipping and monitoring agents - nrpe, zabbix, the splunk forwarder, newrelic, etc.
  • Account management-related states
  • resolvconf management

ToDo / Known Issues

  • Add support for non-Debian-based distributions and better non-Ubuntu-specific support in general.

License

Apache License, version 2.0. Please see LICENSE.

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.