Code Monkey home page Code Monkey logo

ansible-workshop-deploy's Introduction

Ansible Workshop Deploy

Requirements

This application is developed with Vagrant 1.8.0 and Ansible 2.0 for a Debian 8 environment.

Setup

To run the application within a Vagrant environment, ensure that you have Vagrant and VirtualBox (or Parallels on OS X) installed.

Initial Setup

Git Repositories

You will need to clone this repository: git clone [email protected]:boltmade/ansible-workshop-deploy.git

You may also want to checkout the application being deployed: boltmade/ansible-workshop-app.

Initial Machine Setup

You need to acquire the vault password from someone on the team, which we'll refer to as VAULT_PASS. Then:

cd ansible-workshop-deploy
echo "VAULT_PASS" | tee -a playbooks/vault_pass
vagrant up --provider=virtualbox # OR: vagrant up --provider=parallels

You can stop the application and halt the machine by running vagrant halt or suspend the machine by running vagrant suspend.

Working with the Machine

If you need to apply any updates to your vagrant machine:

vagrant provision

To access the machine:

vagrant ssh

To verify everything is okay:

ansible-playbook --version # => 2.0.1.0

Working with Secrets

We are taking advantage of Ansible Vault to store secrets in our source code. Deploy steps will automatically decrypt our secrets files, but if you wish to encrypt a new file or view/edit any existing files:

ansible-vault [encrypt|view|edit] playbooks/path/to/secret_file --vault-password-file playbooks/vault_pass

Deployment

We use Ansible to manage our deployments. The vagrant machine comes with this installed.

Setup

Galaxy Roles

If ansible complains about a missing galaxy role, simply run:

ansible-galaxy install -r playbooks/requirements.txt

These are automatically installed during vagrant provision and within the vagrant environment on machine setup.

Production

Run inside the Vagrant VM:

ansible-playbook playbooks/site.yml -i playbooks/production --vault-password-file playbooks/vault_pass

If you want to refresh the database, append --extra-vars "should_seed=true"

Dry Run

If you wish to view what would happen without making changes you can perform a trial run and, optionally, request a diff to see the changes, simply append:

--check [--diff]

ansible-workshop-deploy's People

Contributors

elsom25 avatar

Watchers

James Cloos 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.