Module for Common Puppet OpenStack Dependencies
Go to file
Sofer Athlan-Guyot 2075930b90 Add a way for provider to transform value in config.
For instance this would enable this:

    neutron_l3_agent_config {
        'DEFAULT/router_id': value => $router_name, transform_to => 'uuid';
    }

The neutron_l3_agent_config would only have to implement this:

    def to_uuid(name)
      # code to get the uuid
    end

    def from_uuid(uuid)
      # code to return the name
    end

Change-Id: I3b7c17590b27cd3a22c5458342d049969ade2281
Co-Authored-By: Drew Fisher <drew.fisher@oracle.com>
2016-08-04 12:53:50 -07:00
examples Default file for all. Use it for virtual package. 2016-07-06 15:24:37 +02:00
facts.d Fix fact for puppet facter 2.0.1+ 2015-10-06 11:08:14 -05:00
lib Add a way for provider to transform value in config. 2016-08-04 12:53:50 -07:00
manifests service validation: log output on failures 2016-07-14 18:16:49 -04:00
releasenotes Add a way for provider to transform value in config. 2016-08-04 12:53:50 -07:00
spec Add a way for provider to transform value in config. 2016-08-04 12:53:50 -07:00
templates Added policy-rc.d class. 2016-04-22 10:41:36 -04:00
.gitignore Add basic structure for ReNo 2016-03-14 08:34:17 -04:00
.gitreview Update .gitreview file for project rename 2015-06-12 23:12:30 +00:00
CHANGELOG.md Release 8.0.0 2016-03-23 16:07:47 -04:00
Gemfile Gemfile: rely on puppet-openstack_spec_helper for dependencies 2016-03-29 21:37:06 -04:00
LICENSE Synchronize LICENSE file with OpenStack projects 2015-04-20 09:29:33 -04:00
README.md Merge "Change wiki to docs" 2016-06-03 16:46:18 +00:00
Rakefile Use puppet-openstack_spec_helper for Rakefile & spec_helper_acceptance 2016-01-18 09:11:30 -05:00
metadata.json Fix postgresql 2016-07-12 16:41:41 -03:00
other-requirements.txt Add other-requirements.txt for bindep 2016-05-19 19:15:38 +02:00
setup.cfg Add basic structure for ReNo 2016-03-14 08:34:17 -04:00
setup.py Add basic structure for ReNo 2016-03-14 08:34:17 -04:00
test-requirements.txt Add basic structure for ReNo 2016-03-14 08:34:17 -04:00
tox.ini Add basic structure for ReNo 2016-03-14 08:34:17 -04:00

README.md

openstacklib

Table of Contents

  1. Overview - What is the openstacklib module?
  2. Module Description - What does the module do?
  3. Setup - The basics of getting started with openstacklib
  4. Implementation - An under-the-hood peek at what the module is doing
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module
  7. Contributors - Those with commits

Overview

The openstacklib module is a part of OpenStack, an effort by the Openstack infrastructure team to provide continuous integration testing and code review for Openstack and Openstack community projects not part of the core software. The module itself is used to expose common functionality between Openstack modules as a library that can be utilized to avoid code duplication.

Module Description

The openstacklib module is a library module for other Openstack modules to utilize. A thorough description will be added later.

This module is tested in combination with other modules needed to build and leverage an entire Openstack software stack.

Setup

Installing openstacklib

puppet module install openstack/openstacklib

Usage

Classes and Defined Types

Defined type: openstacklib::db::mysql

The db::mysql resource is a library resource that can be used by nova, cinder, ceilometer, etc., to create a mysql database with configurable privileges for a user connecting from defined hosts.

Typically this resource will be declared with a notify parameter to configure the sync command to execute when the database resource is changed.

For example, in heat::db::mysql you might declare:

::openstacklib::db::mysql { 'heat':
    password_hash => mysql_password($password),
    dbname        => $dbname,
    user          => $user,
    host          => $host,
    charset       => $charset,
    collate       => $collate,
    allowed_hosts => $allowed_hosts,
    notify        => Exec['heat-dbsync'],
  }

Some modules should ensure that the database is created before the service is set up. For example, in keystone::db::mysql you would have:

::openstacklib::db::mysql { 'keystone':
    password_hash => mysql_password($password),
    dbname        => $dbname,
    user          => $user,
    host          => $host,
    charset       => $charset,
    collate       => $collate,
    allowed_hosts => $allowed_hosts,
    notify        => Exec['keystone-manage db_sync'],
    before        => Service['keystone'],
  }

** Parameters for openstacklib::db::mysql: **

#####password_hash Password hash to use for the database user for this service; string; required

#####dbname The name of the database string; optional; default to the $title of the resource, i.e. 'nova'

#####user The database user to create; string; optional; default to the $title of the resource, i.e. 'nova'

#####host The IP address or hostname of the user in mysql_grant; string; optional; default to '127.0.0.1'

#####charset The charset to use for the database; string; optional; default to 'utf8'

#####collate The collate to use for the database; string; optional; default to 'utf8_general_ci'

#####allowed_hosts Additional hosts that are allowed to access this database; array or string; optional; default to undef

#####privileges Privileges given to the database user; string or array of strings; optional; default to 'ALL'

Defined type: openstacklib::db::postgresql

The db::postgresql resource is a library resource that can be used by nova, cinder, ceilometer, etc., to create a postgresql database and a user with configurable privileges.

Typically this resource will be declared with a notify parameter to configure the sync command to execute when the database resource is changed.

For example, in heat::db::postgresql you might declare:

::openstacklib::db::postgresql { $dbname:
  password_hash => postgresql_password($user, $password),
  dbname        => $dbname,
  user          => $user,
  notify        => Exec['heat-dbsync'],
}

Some modules should ensure that the database is created before the service is set up. For example, in keystone::db::postgresql you would have:

::openstacklib::db::postgresql { $dbname:
  password_hash => postgresql_password($user, $password),
  dbname        => $dbname,
  user          => $user,
  notify        => Exec['keystone-manage db_sync'],
  before        => Service['keystone'],
}

** Parameters for openstacklib::db::postgresql: **

#####password_hash Password hash to use for the database user for this service; string; required

#####dbname The name of the database string; optional; default to the $title of the resource, i.e. 'nova'

#####user The database user to create; string; optional; default to the $title of the resource, i.e. 'nova'

#####encoding The encoding use for the database; string; optional; default to undef

#####privileges Privileges given to the database user; string or array of strings; optional; default to 'ALL'

Defined type: openstacklib::service_validation

The service_validation resource is a library resource that can be used by nova, cinder, ceilometer, etc., to validate that a resource is actually up and running.

For example, in nova::api you might declare:

::openstacklib::service_validation { 'nova-api':
    command => 'nova list',
  }

This defined resource creates an exec-anchor pair where the anchor depends upon the successful exec run.

** Parameters for openstacklib::service_validation: **

#####command Command to run for validating the service; string; required

#####service_name The name of the service to validate; string; optional; default to the $title of the resource, i.e. 'nova-api'

#####path The path of the command to validate the service; string; optional; default to '/usr/bin:/bin:/usr/sbin:/sbin'

#####provider The provider to use for the exec command; string; optional; default to 'shell'

#####tries Number of times to retry validation; string; optional; default to '10'

#####try_sleep Number of seconds between validation attempts; string; optional; default to '2'

Implementation

openstacklib

openstacklib is a combination of Puppet manifest and ruby code to delivery configuration and extra functionality through types and providers.

Limitations

The python-migrate system package for RHEL 6 and below is out of date and may fail to correctly migrate postgresql databases. While this module does not handle database migrations, it is common to set up refresh relationships between openstacklib::db::postgresql resource and the database sync exec resource. Relying on this behavior may cause errors.

Beaker-Rspec

This module has beaker-rspec tests

To run:

bundle install
bundle exec rspec spec/acceptance

Development

Developer documentation for the entire puppet-openstack project.

Contributors

Versioning

This module has been given version 5 to track the puppet-openstack modules. The versioning for the puppet-openstack modules are as follows:

Puppet Module :: OpenStack Version :: OpenStack Codename
2.0.0         -> 2013.1.0          -> Grizzly
3.0.0         -> 2013.2.0          -> Havana
4.0.0         -> 2014.1.0          -> Icehouse
5.0.0         -> 2014.2.0          -> Juno
6.0.0         -> 2015.1.0          -> Kilo
7.0.0         -> 2015.2.0          -> Liberty