Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.
/ puppet-openshift Public archive

Simple Puppet module to manage Ansible and the OpenShift Ansible inventory

License

Notifications You must be signed in to change notification settings

appuio/puppet-openshift

Repository files navigation

Puppet module for managing OpenShift - the Ansible part

Table of Contents

  1. Description
  2. Setup - The basics of getting started with openshift
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

This Puppet module manages Ansible for setting up an OpenShift cluster with the official openshift-ansible Playbooks.

Setup

What openshift affects

The module has two "roles":

  • openshift::role::ansible_master:
    • Installs Ansible
    • Checks out openshift-ansible from git
    • Configures SSH for Ansible
    • Writes the inventory file in YAML format
  • openshift::role::node:
    • Installs required packages
    • Enables NetworkManager
    • Add some missing CA certificates

Setup Requirements

Required modules:

Beginning with openshift

On the host you want to run Ansible, apply the ansible_master role and pass the inventory to it:

class { 'openshift::role::ansible_master':
  host_groups => {
    'OSEv3' => {
      children => ["nodes", "masters"],
    },
    masters => {
      vars => {
        osm_default_node_selector => "foo=bar",
      },
      hosts => {
        "master1.example.com" => {},
        "master2.example.com" => {},
      },
      children => ["etcd"],
    },
    nodes => {
      hosts => {
        "node[1:9].example.com" => {
          custom_var => true,
        },
      },
    },
  }
}

This parameters can also be configured in Hiera.

An all nodes, apply the node role:

class { 'openshift::role::node': }

Usage

Reference

Classes

Public Classes

  • openshift::role::ansible_master: Installs and configures Ansible.

[host_groups] Default: {}. Hash of Ansible inventory data.

[playbooks_source] Default: https://github.com/openshift/openshift-ansible.git. Git repository where the Ansible plabooks are stored.

[playbooks_version] Default: master Git reference to check out

  • openshift::role::node: Prepares node for OpenShift.

No parameters available.

Limitations

This Puppet module only runs on CentOS and RHEL.

Development

  1. Fork it (https://github.com/appuio/puppet-openshift/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request