Giter Site home page Giter Site logo

ansible-wing-playbook's Introduction

Infrastructure as a code with Ansible + Docker

This repository is the skeleton to do infrastructure as a code with Ansible + Docker. You will have

  • Ansible playbooks in all yml files on root repository
  • Sample inventory files for each service in inventories directory
  • Sample variable files with heavily comment for each service in vars directory
  • Sample configuration files for each service in files directory
  • Documents how to use each role and tutorial in docs directory
  • Roles that will separate into each Ansible Galaxy repository. You can see all the roles in galaxy-requirements.yml

Pre-requisites

  • Docker 1.10 or up
  • Docker Machine 0.7.0 or up
  • Ansible 2.1 or up
  • Make sure that you can ssh to target machine

Tutorial

How to Use

  • Fork this repository and make your own configuration from example files
  • You can see all my galaxy role in galaxy-requirements.yml file. To install or update all roles, run the command
# Use -f to force reinstall roles
ansible-galaxy install -f -r galaxy-requirements.yml
  • You shouldn't have to edit any file in this repository. This make you easier to maintain and update playbook from upstream
  • If you find yourself that you have to edit any file in this repository so it means that you have to send that pull request to me :P
  • To update playbook from upstream. Run below commands
# http://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository
# Add the remote, call it "upstream":
git remote add upstream https://github.com/winggundamth/ansible-wing-playbook.git

# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream

# Merge upstream/master to your forked repository
git merge upstream/master

Variable priority

According to Variable Precedence: Where Should I Put A Variable?. Order of variable priority would be (The last listed variables win)

  • roles/*/default/main.yml
  • group_vars/all
  • group_vars/group_name
  • host_vars/all
  • host_vars/group_name
  • vars/*.yml (as specific vars_file in inventory file)
  • extra vars with -e with ansible-playbook command

So from above priority. In use case you want to specific something like the memeory of elastic search and will be difference on each cluster. You should create default allocate memory variable in group_vars/all file and specific memory for each cluster in group_vars/group_name. Don't forget to change group_name file name to your group name. And don't forget to remove or comment that variable in vars/*.yml since it will overwrite and win the priority.

Playbooks list

License

The MIT License (MIT)

ansible-wing-playbook's People

Contributors

winggundamth avatar

Watchers

 avatar

Forkers

nbzero rathawut

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.