Coder Social home page Coder Social logo

playbooks's Introduction

Ansible Playbooks Build Status

A collection of Ansible scripts and templates used to deploy systems used by OpenSRP. We use Ansible's recommended alternative directory layout.

Setup

To run the stuff herein, you need Ansible. To use Ansible you might need pycrypto. To build pycrypto, you need the latest python (2.1 <= ver <= 3.3) development libs & headers. Stick with python v2.7 for now. It's the current status quo. In a nutshell, if you're using debian/ubuntu :- apt-get install python-dev

For local "dev" deployments, you will need to install Virtualbox. You'll need the password used to encrypt sensitive info in this repo.

Clone this repository with its Git submodules:

git clone --recursive [email protected]:opensrp/playbooks.git && cd playbooks

Make sure all pip requirements are installed by running the following command. We recommend you do this in a dedicated Python virtual env:

pip install -r requirements.txt

Install the Ansible Galaxy requirements using these commands:

mkdir -p ~/.ansible/roles/opensrp
ansible-galaxy install -r requirements.yml -p ~/.ansible/roles/opensrp

Inventories

Copy over your inventory files into a new directory called inventories. Note that we have inventories in the .gitignore file. We recommend you track them in a seperate private git repository. Please do not make pull requests to this repository with inventory files that might expose aspects of your infrastructure that you don't want exposed.

We recommend you use the following directory structure:

Split your inventories based on DevOps clients, and their server environments.

Example DevOps clients include:

  • personal (for your personal inventories)
  • tb-reach
  • zeir

And environments:

  • production
  • preview
  • staging

The inventory directory structure, hence, looks like:

inventories/
│── [DevOps Client 1]
│   │── [Environment 1]
│   │   │── group_vars
│   │   │── hosts
│   │   └── host_vars
│   .
│   .
│   .
│   └── [Environment m]
│       └ ...
.
.
.
└── [DevOps Client n]
    └ ...

Each environment directory contains a hosts file that's used to group host_vars into group_vars and group_vars into other group_vars. Please avoid setting ansible variables in that file.

Packer

Packer allows for packaging of machine/container images from Ansible scripts like the ones defined in this repository. To run any of the packer files defined in this repository, do:

packer build -var-file=inventories/<DevOps client>/<environment>/packer/<name of setup>/<name of variant>.json packer/<name of setup>.json

playbooks's People

Contributors

jasonrogena avatar manutarus avatar morrismukiri avatar vincent-karuri avatar githengi avatar ndegwamartin avatar rkareko avatar dubdabasoduba avatar dependabot-preview[bot] avatar bluecodezm avatar craigappl avatar ellykits avatar pld 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.