GithubHelp home page GithubHelp logo

rsjorslev / salt-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from inveracity/salt-examples

0.0 1.0 0.0 12 KB

for sharing basic salt setup

Python 48.23% Shell 21.15% SaltStack 25.73% Scheme 1.71% HTML 3.19%

salt-examples's Introduction

salt course

This repo is a basic set up of the most used features

The following is instructor notes and may not make sense to everyone

Basic

  • Installing salt
    • repo.saltstack.com
  • Master configuration (see configs folder)
  • Accepting keys
    • auto_accept: True is also an option
  • Issuing commands
    • targeting minions with grains or perl compliant regular expressions
    • modules, functions, arguments, and how to read documentation
  • States and top files
    • targeting in top files
    • environments
    • state.highstate vs state.apply
  • Grains
  • Pillars
  • jinja2
    • accessing pillar and grain data to populate states
  • debug mode and debug commands
    • salt-master -l debug
    • salt-call -l debug
    • state.show_sls <statename>
    • minion and master log files
    • sometimes a minion appears twice in the salt-key output?

Intermediate

  • Custom modules and runners
    • overriding built-in features
    • extending salt with new features
    • saltutil.sync_all (is also run by highstate)
  • Eventbus
    • going from automating to automatic
    • sending events via commands and states: salt-run event.send my/custom/event '{"foo": "bar"}'
  • Beacons (diskusage in pillars)
    • see the events in the eventbus
  • Reactors (diskwarning in runners)
    • react to beacons
    • presence events (accepting new keys, removing old ones)
    • makes various integrations to slack and other systems a possibility
  • Rest web API
    • needs its own user account, see the saltapi state
    • needs its own permissions, see the saltapi config file
    • finally restart the salt-api service
    • code example: api_example_rest.py

Advanced

  • Returners (rethinkdb example)
    • what is a returner, architecture behind it
  • Pyobjects (nginx example)
    • all of python available, notice capitalisation of modules
  • Gitfs (golang example)
    • dodgy feature, hopefully it works
    • formulas uses "maps" to give sane defaults, typically based on OS
    • github.com/saltstack-formulas/golang-formula
  • AD Authentication
    • ldap protocol, will not be demoed but a config template is available
  • Salt client API
    • code example: api_example_client.py
  • Source code
    • github.com/saltstack/salt
    • find the test.ping function

Not covered but can be found in salts documentation

  • Exhaustive look at minion and master configuration files
  • External pillars (consul, json api, many more)
  • Orchestration
  • Proxy minions
  • Renderers (partly covered with Pyobjects)
  • Salt cloud
  • Salt mine (like grains, but more up-to-date)
  • Salt ssh (agentless minions)
  • Spm (salt package manager)
  • Syndics
  • Thorium
  • Transport (tcp, raet, zeromq)
  • Windows specificities (powershell, DSC)

Prerequisites

  • vagrant 1.9.7 (or greater)
  • virtualbox 5 (or greater)

Bootstrap

These scripts install salt and copies configuration files into their respective folders

  /bootstrap.sh
  /master.sh
  /minion.sh

Usage

vagrant up
vagrant ssh master
sudo salt '*' test.ping # confirm minions respond

# Optional
sudo salt '*' state.highstate    # install rethinkdb and set up salt-api
sudo service salt-master restart # enable salt returner
sudo service salt-api restart    # enable salt-api configs

salt-examples's People

Contributors

inveracity avatar

Watchers

 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.