-
Do you use config files for your app, or do you have a distributed solution? (etcd, serf, etc)
If config files:
- How do you set them up to work in multiple environments?
-
How are they different for developer machines?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, let's define some secrets we want to pass to Chef | |
cat << SECRETS > /etc/chef.secrets | |
DB_PASSWORD: !var db/postgres/customers/password # exports value as env var | |
SSL_CERT: !tmp certs/ssl/mydomain # creates temporary file and exports path as env var | |
SECRETS | |
# In our recipe we can use ENV['DB_PASSWORD'] and ENV['SSL_CERT'] where secrets are needed | |
# We have the Conjur CLI on the machine, so we can use conjur env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creates a host identity using host-factory and places it in /etc/conjur.identity | |
# Requires the Conjur CLI and host-factory plugin to be installed | |
# Usage: | |
# ./hostfactory_bootstrap.sh 92198eb129peh812ue9puihd891 mynewhost1 | |
hostfactory_token=$1 | |
host_name=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For the saltstack tutorial, just install the [latest vagrant](https://docs.vagrantup.com/v2/getting-started/index.html) and use the below Vagrantfile to build a new vagrant box: | |
`Vagrantfile` | |
``` | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provision "shell", inline: <<-SHELL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Checks that your Github repos are up to date | |
DIRS=() | |
sync=$1 | |
for file in */ cookbooks/*; do | |
DIRS+=("`pwd`/${file}"); |
=begin
Example box JSON schema
{
:name => :name_of_vagrant_box, #REQUIRED
:ip => '10.0.0.11', #REQUIRED
:synced_folders => [
{ '.' => '/home/vagrant/myapp' }
],
:commands => [
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
echo "--- Pulling in latest changes for all repositories... ---" | |
# Find all git repositories and update it to the master latest revision | |
for i in $(find . -name ".git" | cut -c 3-); do |
python package installer - look for packages on pypi
pip install package_name
- installs package from pypipip install -r requirements file
- installs packages from a requirements filepip uninstall package_name
- uninstalls packagepip freeze
- output packages to stdout in requirements format, can be piped to a file
print('some string') # good
print 'some string' # bad
print()
has been moved to a function in Python 3 docs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH="/usr/local/bin:$PATH" | |
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc | |
export WORKON_HOME=~/envs | |
export PROJECT_HOME=~/git | |
source ~/.pythonbrew/pythons/Python-2.7.2/bin/virtualenvwrapper.sh | |
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages' |