GithubHelp home page GithubHelp logo

ansible-inventory's Introduction

Ansible Inventory

Purpose

This repository stores all the inventories for the DREAM ansible plays.

Structure

The structure of the repository is similar to the following:

.
├── badger
│   ├── prod
│   │   ├── artifacts
│   │   ├── cephadmin
│   │   ├── director
│   │   └── postgress
│   └── stag
│       ├── artifacts
│       ├── cephadmin
│       ├── director
│       └── postgress
├── clan
│   └── prod
│       └── artifacts
└── README.md

You'll notice that the inventory files are separated by network, tier, and role, and inside of each inventory file, the parent-child relationship of groups is spelled out clear using INI syntax:

[badger:children]
artifacts

[artifacts]
artifacts-01.prod.badger.net

This allows for the plays to use all the host and group vars associated with both the parent and child groups, but also creates some seperation so that a single Ansible command is not mistakenly run across multiple networks, environment tiers, or roles. Also of note, is the net_name variable that is defined as a group_var for the network group (i.e. badger, clan, etc). This variable is used by the playbooks to execute network-specific tasks on hosts, if required. As a result, you should ensure that the role-based group is a child of the network group that contains net_name in it's group_vars.

Usage

Inventory files can be called like so:

ansible-playbook -i inventory/badger/prod/artifacts example_playbook.yml

ansible-inventory's People

Contributors

ericlake avatar

Watchers

 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.