Coder Social home page Coder Social logo

efficent-rails-devops's Introduction

Efficient Rails DevOps

Example app following the Efficient Rails DevOps book by Michael Trojanek.

Get up and running

  • Clone the repo and change into the directory
  • Run vagrant up to start the VM
  • Start the playbook with ansible-playbook -i inventories/staging site.yml --ask-vault-pass
    • to run an individual tags, use ansible-playbook -i inventories/staging --tags TAG_NAMES_HERE site.yml --ask-vault-pass
  • Update the yum packages using:
    • ssh [email protected] "yum -y update" for a single machine
    • ansible rails -u root -i inventories/staging -a "yum -y update" --ask-vault-pass for all machines belonging to the rails group of our inventories/staging file as the root user

IMPORTANT

This repo uses ansible-vault to encrypt its configuration and other sensitive information, but seeing as the password used to encrypt it is made public (listed below, and in the book), it is not advised you use it as is, and instead re-encrypt the relevant files yourself.

Ansible Vault

  • Password erdo

  • To create a new vault, run ansible-vault encrypt path/to/file

  • To edit a vault file, run ansible-vault edit path/to/file

Encrypted files

  • group_vars/all

Generate crypted password (for root_password task)

python -c 'import crypt; print crypt.crypt("PASSWORD_HERE", crypt.mksalt(crypt.METHOD_SHA512))'

IP address

This repo is based on the IP subgroup of 192.168.1.*. If your subgroup is different and you need to modify the IP address, you'll need to update both the Vagrantfile and inventories/staging files.

Installing Ansible

pip install --upgrade pip
pip install ansible

No Python?

If the commands above don't work, you probably don't have Python 2 installed. The book recommends you use pyenv to install python, as it'll give you the ability to switch between different version, much like the benefits obtained by using rbenv.

For a a quick and dirty install process on OS X:

brew update
brew install pyenv

At this point it's important to note the set-up instructions provided by the installer.

pyend install 2.7.10
pyenv global 2.7.10

efficent-rails-devops's People

Contributors

limeblast avatar

Watchers

 avatar  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.