dansackett / pamplona

Personal desktop and server automation the way I like it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pamplona

In bull-fighting they speak of the terrain of the bull and the terrain of the bull-fighter. As long as a bull-fighter stays in his own terrain he is comparatively safe. Each time he enters into the terrain of the bull he is in great danger. Belmonte, in his best days, worked always in the terrain of the bull. This way he gave the sensation of coming tragedy.

― Ernest Hemingway, The Sun Also Rises

NOTE: This is still in active development.

Pamplona is my personal workspace built to always be accessible on any fresh Ubuntu install I need. It assumes Debian-based systems and is very much a personalized experience for myself.

SaltStack is the underlying build tool and a Vagrant box is added to test the formulas.

Philosophy

There are a lot of ways to handle desktop configurations from keeping dotfiles to creating bash scripts to install dependencies. Configuration management isn't just for the server though and I think it should be applied to your personal desktop to keep dependencies controlled and easy to reproduce.

That's where Saltstack comes in.

By defining all of my applications and packages in Salt config files I can add new packages and apply them to any minion in my Salt network. Salt has its rough edges but when it comes to installing dependencies on servers and communicating within a network of servers it really shines.

Getting Started

By default there are scripts to manage your own personal desktop. This setup installs a master and minion conifg on your computer allowing you to target the desktop directly when making updates.

Clone this repo or download the files locally. There are two scripts that can manage all of the salt work needed:

  • bin/boostrap_desktop: For installing a salt minion and master and configuring them
  • bin/update_desktop: For updating the pillars and states and running highstate

You can run ./bin/update_desktop and it will run the bootstrap script as well.

To customize your experience you can edit the pillar data in saltstack/pillar/data.sls. The current config is setup as follows:

hostname: pamplona
runas_user:
  username: dan
  full_name: Dan Sackett
core:
  locale: en_US
  timezone: 'America/New_York'
  users:
    ubuntu:
      full_name: Ubuntu
  install_apt_packages:
    - build-essential
    - libssl-dev
    - libffi-dev
    - libxml2-dev
    - curl
    - htop
    - sqlite3
    - libsqlite3-dev
    - tmux
    - meld
    - terminator
    - redshift
    - redshift-gtk
    - unity-tweak-tool
apps:
  install_apps:
    - docker
    - git
    - golang
    - google-chrome
    - mumble
    - node
    - notes
    - numix
    - postfix
    - postgres
    - python
    - redis
    - rvm
    - search
    - shutter
    - spotify
    - vagrant
    - vim
    - virtualbox
    - virtualenv
    - vimplug
    - yarn
  install_pips:
    - todooo-cli
    - bpython
  install_node_modules:
    - create-react-app
  configure_apps:
    git:
      user:
        name: Dan Sackett
        email: danesackett@gmail.com
      editor: vim
      merge_tool: meld
    ruby:
      default: 2.3.0
      install_versions:
        - 2.3.0

There are two phases to the desktop configuration: core and apps. The core setup handles hostname, users, and apt packages for you. The apps setup handles any third-party applications you want to install. Some relevant definitions:

hostname

The hostname gives the machine its hostname like you would expect.

runas_user

The runas_user defines the user which will run commands in the state files. This should be your current username on the machine you're setting up.

core.locale

The locale defines the locale for the machine. It defaults to en_US.

core.timezone

The timezone sets the timezone for the machine. It defaults to 'America/New_York'.

core.users

The users data defines any additional users you want to add to the system. They will all be created and given a home directory with SSH keys generated for each. You do not need to include the runas_user in this definition since we already ensure they are included.

Users should be in the form:

USERNAME:
  full_name: FULLNAME

core.install_apt_packages

The install_apt_packages setting allows you to set any packages you want to install through apt-get. Each will be added to the machine.

apps.install_apps

The install_apps setting defines the states to run. The current states available are:

docker
git
google-chrome.sl
mumble
node
numix
postfix
postgres
python
redis
rvm
shutter
spotify
vagrant
virtualbox
virtualenv
yarn

Defining any of these will install the application for you.

apps.install_pips

The install_pips setting defines any pip packages to be installed globally.

apps.install_node_modules

The install_node_modules setting defines any NPM packages to be installed globally.

apps.install_gems

The install_gems setting defines any ruby gems to be installed through RVM.

apps.configure_apps.git

The git setting under configure_apps allows you to define your default it config values including username, email, editor, and diff tool.

apps.configure_apps.ruby

The ruby setting under configure_apps allows you to define the default ruby to set in RVM and any other versions you would like installed.

Using Vagrant

There isn't a lot of use for these states and Vagrant as a server. If you're building a virtualbox to work in though it should be helpful. Running vagrant up will get everything set up for you. Subsequent vagrant ups will call the highstate and update the states on the system.

Requirements still to do

  • mysql

Todo

  • Figure out the best way to show progress other than debug (reactor, returner, etc)

About

Personal desktop and server automation the way I like it.

License:MIT License


Languages

Language:SaltStack 71.2%Language:Shell 27.9%Language:HTML 0.9%