Git Product home page Git Product logo

foreman_openshift_ansible_inventory's Introduction

Foreman OpenShift Ansible Inventory

This script can be used as an Ansible dynamic inventory1 for OpenShift installations. The connection parameters are set up via a configuration file foreman.ini. foreman.ini is found using the following order of discovery.

* `/etc/ansible/foreman.ini`
* Current directory of your inventory script.
* `FOREMAN_INI_PATH` environment variable.

Variables and Parameters

The data returned from Foreman for each host with a "openshift-role" host parameter is stored in a OpenShift ansible inventory group structure. The groupnames are created from the "openshift-role" comma seperated values, for example: openshift-role=masters,etcd,nodes

{
  "_meta": {
    "hostvars": {
      "openshift-master1.example.com": {
        "kt_activation_keys": "openshift-example", 
        "openshift-role": "masters,etcd,nodes", 
        "region": "infra", 
        "zone": "default"
      }, 
      "openshift-master2.example.com": {
        "kt_activation_keys": "openshift-example", 
        "openshift-role": "masters,etcd,nodes", 
        "region": "infra", 
        "zone": "default"
      }, 
      "openshift-master3.example.com": {
        "kt_activation_keys": "openshift-example", 
        "openshift-role": "masters,etcd,nodes", 
        "region": "infra", 
        "zone": "default"
      }, 
      "openshift-node1.example.com": {
        "kt_activation_keys": "openshift-example", 
        "openshift-role": "nodes", 
        "region": "infra", 
        "zone": "default"
      }, 
      "openshift-node2.example.com": {
        "kt_activation_keys": "openshift-example", 
        "openshift-role": "nodes", 
        "region": "infra", 
        "zone": "default"
      }
    }
  }, 
  "etcd": [
    "openshift-master1.example.com", 
    "openshift-master2.example.com", 
    "openshift-master3.example.com"
  ], 
  "masters": [
    "openshift-master1.example.com", 
    "openshift-master2.example.com", 
    "openshift-master3.example.com"
  ], 
  "nodes": [
    "openshift-master1.example.com", 
    "openshift-master2.example.com", 
    "openshift-master3.example.com", 
    "openshift-node1.example.com", 
    "openshift-node2.example.com"
  ]
}

foreman_openshift_ansible_inventory's People

Contributors

joeyloman avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tropel

foreman_openshift_ansible_inventory's Issues

Demo request

Hello,

I randomly came across this project and it seems you have interesting use case for Foreman. It would be great if more people knew about how you deploy openshift using Foreman as an inventory. Would you be interested in presenting this on our Foreman community demo?

Thanks, please feel free to close this issue, I didn't know how better I could reach out.

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.