Giter Club home page Giter Club logo

salt-workstation's Introduction

Salt configuration for workstations

Build Status

Salt configuration for configure and setup my current workstation. Optimized for my current setup which is a Thinkpad X220 running debian jessie.

Influenced by linux-salted and yourlabs salt formulas testing, dotfiles are influenced/copied from Jessie Frazelle.

Setup and apply

Automatic

Checkout this repo and run the included install script which will run all manual steps.

make install
make apply

Manual

1. Install salt-minion
curl -L https://bootstrap.saltstack.com -o install_salt.sh
sudo sh install_salt.sh
2. Set salt to run masterless

To instruct the minion to not look for a master, the file_client configuration option needs to be set in the minion configuration file.

In /ect/salt/minion set file_client: local

 echo "master: localhost \
file_client: local" > /etc/salt/minion

NOTE: When running Salt in masterless mode, do not run the salt-minion daemon. Otherwise, it will attempt to connect to a master and fail. The salt-call command stands on its own and does not need the salt-minion daemon.

3. Apply state

Now you ready to apply states or configure the entire system with a highstate.

salt-call --local state.highstate -l debug

you can also apply each state individual

salt-call --local state.sls base -l debug

Testing

This command will apply highstate on localhost with the example pillar.

salt-call state.highstate --local --retcode-passthrough --file-root=$(pwd)/state --pillar-root=$(pwd)/pillar -l debug

inside a container

docker run --rm -it \
  --name=thinkpad \
  -h thinkpad \
  -e SALT_NAME=thinkpad \
  -e SALT_USE=minion \
  -v `pwd`/:/srv/salt:rw \
  -v /etc/localtime:/etc/localtime \
  quay.io/jacksoncage/salt
  salt-call state.highstate \
  --local --retcode-passthrough \
  --file-root=$(pwd)/state \
  --pillar-root=$(pwd)/pillar

salt-workstation's People

Contributors

jacksoncage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

salt-workstation's Issues

salt-minion file doesn't have newline if run from make install

Let me preface this by saying:

  • I've literally never used salt before, and
  • I've literally never used debian before.

So if this sounds stupid or obvious, please disregard :)

So I thought I'd give your instructions a crack, ran make install which worked, then make apply threw a syntax error while reading the /etc/salt/minion file.

I looked at it, looked at your manual instructions, and it seems that there's no newline between the two separate statements there.

The install.sh seems to be attempting to put a newline by nature of your string going over two lines in the file... alas the result is not as expected.

Simple work-around:

  1. make install
  2. sudo vim /etc/salt/minion and insert the new line
  3. make apply

Seems to be running now.

Anyhoo, thought I'd let you know!

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.