{"id":13647624,"url":"https://github.com/openstack/puppet-openstacklib","last_synced_at":"2025-04-06T20:13:18.571Z","repository":{"id":17974543,"uuid":"20974636","full_name":"openstack/puppet-openstacklib","owner":"openstack","description":"Module for Common Puppet OpenStack Dependencies. Mirror of code maintained at opendev.org.","archived":false,"fork":false,"pushed_at":"2025-03-13T09:25:51.000Z","size":837,"stargazers_count":41,"open_issues_count":0,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-18T00:58:55.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://opendev.org/openstack/puppet-openstacklib","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openstack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-18T19:09:53.000Z","updated_at":"2025-03-13T09:25:56.000Z","dependencies_parsed_at":"2023-10-04T02:24:25.741Z","dependency_job_id":"1224e4d9-fec3-4925-8fb4-84644b914468","html_url":"https://github.com/openstack/puppet-openstacklib","commit_stats":null,"previous_names":[],"tags_count":114,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fpuppet-openstacklib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fpuppet-openstacklib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fpuppet-openstacklib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fpuppet-openstacklib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openstack","download_url":"https://codeload.github.com/openstack/puppet-openstacklib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543595,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:03:40.660Z","updated_at":"2025-04-06T20:13:18.547Z","avatar_url":"https://github.com/openstack.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"Team and repository tags\n========================\n\n[![Team and repository tags](https://governance.openstack.org/tc/badges/puppet-openstacklib.svg)](https://governance.openstack.org/tc/reference/tags/index.html)\n\n\u003c!-- Change things from this point on --\u003e\n\nopenstacklib\n============\n\n#### Table of Contents\n\n1. [Overview - What is the openstacklib module?](#overview)\n2. [Module Description - What does the module do?](#module-description)\n3. [Setup - The basics of getting started with openstacklib](#setup)\n4. [Usage - The usage of the openstacklib module](#usage)\n5. [Implementation - An under-the-hood peek at what the module is doing](#implementation)\n6. [Limitations - OS compatibility, etc.](#limitations)\n6. [Development - Guide for contributing to the module](#development)\n7. [Contributors - Those with commits](#contributors)\n8. [Release Notes - Release notes for the project](#release-notes)\n9. [Repository - The project source code repository](#repository)\n\nOverview\n--------\n\nThe openstacklib module is a part of [OpenStack](https://opendev.org/openstack),\nan effort by the Openstack infrastructure team to provide continuous integration\ntesting and code review for Openstack and Openstack community projects not part\nof the core software.  The module itself is used to expose common functionality\nbetween Openstack modules as a library that can be utilized to avoid code\nduplication.\n\nModule Description\n------------------\n\nThe openstacklib module is a library module for other Openstack modules to\nutilize. A thorough description will be added later.\n\nThis module is tested in combination with other modules needed to build and\nleverage an entire Openstack software stack.\n\nSetup\n-----\n\n### Installing openstacklib\n\n    puppet module install openstack/openstacklib\n\nUsage\n-----\n\n### Classes and Defined Types\n\n#### Defined type: openstacklib::db::mysql\n\nThe db::mysql resource is a library resource that can be used by nova, cinder,\nceilometer, etc., to create a mysql database with configurable privileges for\na user connecting from defined hosts.\n\nTypically this resource will be declared with a notify parameter to configure\nthe sync command to execute when the database resource is changed.\n\nFor example, in heat::db::mysql you might declare:\n\n```\n::openstacklib::db::mysql { 'heat':\n    password_hash =\u003e mysql::password($password),\n    dbname        =\u003e $dbname,\n    user          =\u003e $user,\n    host          =\u003e $host,\n    charset       =\u003e $charset,\n    collate       =\u003e $collate,\n    allowed_hosts =\u003e $allowed_hosts,\n    notify        =\u003e Exec['heat-dbsync'],\n  }\n```\n\nSome modules should ensure that the database is created before the service is\nset up. For example, in keystone::db::mysql you would have:\n\n```\n::openstacklib::db::mysql { 'keystone':\n    password_hash =\u003e mysql::password($password),\n    dbname        =\u003e $dbname,\n    user          =\u003e $user,\n    host          =\u003e $host,\n    charset       =\u003e $charset,\n    collate       =\u003e $collate,\n    allowed_hosts =\u003e $allowed_hosts,\n    notify        =\u003e Exec['keystone-manage db_sync'],\n    before        =\u003e Service['keystone'],\n  }\n```\n\n** Parameters for openstacklib::db::mysql: **\n\n#####`password_hash`\nPassword hash to use for the database user for this service;\nstring; required\n\n#####`dbname`\nThe name of the database\nstring; optional; default to the $title of the resource, i.e. 'nova'\n\n#####`user`\nThe database user to create;\nstring; optional; default to the $title of the resource, i.e. 'nova'\n\n#####`host`\nThe IP address or hostname of the user in mysql_grant;\nstring; optional; default to '127.0.0.1'\n\n#####`charset`\nThe charset to use for the database;\nstring; optional; default to 'utf8'\n\n#####`collate`\nThe collate to use for the database;\nstring; optional; default to 'utf8_general_ci'\n\n#####`allowed_hosts`\nAdditional hosts that are allowed to access this database;\narray or string; optional; default to undef\n\n#####`privileges`\nPrivileges given to the database user;\nstring or array of strings; optional; default to 'ALL'\n\n#### Defined type: openstacklib::db::postgresql\n\nThe db::postgresql resource is a library resource that can be used by nova,\ncinder, ceilometer, etc., to create a postgresql database and a user with\nconfigurable privileges.\n\nTypically this resource will be declared with a notify parameter to configure\nthe sync command to execute when the database resource is changed.\n\nFor example, in heat::db::postgresql you might declare:\n\n```\n::openstacklib::db::postgresql { $dbname:\n  password_hash =\u003e postgresql_password($user, $password),\n  dbname        =\u003e $dbname,\n  user          =\u003e $user,\n  notify        =\u003e Exec['heat-dbsync'],\n}\n```\n\nSome modules should ensure that the database is created before the service is\nset up. For example, in keystone::db::postgresql you would have:\n\n```\n::openstacklib::db::postgresql { $dbname:\n  password_hash =\u003e postgresql_password($user, $password),\n  dbname        =\u003e $dbname,\n  user          =\u003e $user,\n  notify        =\u003e Exec['keystone-manage db_sync'],\n  before        =\u003e Service['keystone'],\n}\n```\n\n** Parameters for openstacklib::db::postgresql: **\n\n#####`password_hash`\nPassword hash to use for the database user for this service;\nstring; required\n\n#####`dbname`\nThe name of the database\nstring; optional; default to the $title of the resource, i.e. 'nova'\n\n#####`user`\nThe database user to create;\nstring; optional; default to the $title of the resource, i.e. 'nova'\n\n#####`encoding`\nThe encoding use for the database;\nstring; optional; default to undef\n\n#####`privileges`\nPrivileges given to the database user;\nstring or array of strings; optional; default to 'ALL'\n\n#### Defined type: openstacklib::service_validation\n\nThe service_validation resource is a library resource that can be used by nova, cinder,\nceilometer, etc., to validate that a resource is actually up and running.\n\nFor example, in nova::api you might declare:\n\n```\n::openstacklib::service_validation { 'nova-api':\n    command =\u003e 'nova list',\n  }\n```\nThis defined resource creates an exec-anchor pair where the anchor depends upon\nthe successful exec run.\n\n** Parameters for openstacklib::service_validation: **\n\n#####`command`\nCommand to run for validating the service;\nstring; required\n\n#####`service_name`\nThe name of the service to validate;\nstring; optional; default to the $title of the resource, i.e. 'nova-api'\n\n#####`path`\nThe path of the command to validate the service;\nstring; optional; default to '/usr/bin:/bin:/usr/sbin:/sbin'\n\n#####`provider`\nThe provider to use for the exec command;\nstring; optional; default to 'shell'\n\n#####`tries`\nNumber of times to retry validation;\nstring; optional; default to '10'\n\n#####`try_sleep`\nNumber of seconds between validation attempts;\nstring; optional; default to '2'\n\n#### Defined provider for openstack_config: ini_setting\n\nIt provides an interface to any INI configuration file as they are\nused in Openstack modules.\n\nYou use it like this:\n\n```\nPuppet::Type.type(:\u003cmodule\u003e_config).provide(\n  :openstackconfig,\n  :parent =\u003e Puppet::Type.type(:openstack_config).provider(:ini_setting)\n) do\n```\n\nIt has the standard features of the upstream puppetlabs' `inifile`\nmodule as it's a direct children of it.  Furthermore it can transform\na value with some function of you're choice, enabling you to get value\nthat get filled at run-time like an `uuid`.\n\nFor an example of how that's working you can have a look at this\n[review](https://review.opendev.org/#/c/347468/)\n\n#### Defined provider for openstack_config: ruby\n\nThis one has the same basic features as the ini_setting one but the\nability to transformation the value.  It offers another feature,\nthough.  It can parse array.  What it enables one to do is to parse\nthis correctly:\n\n```\n[DEFAULT]\nconf1 = value1\nconf1 = value2\n```\n\nOn the opposite side if you put that:\n\n```\nmodule_config { 'DEFAULT/conf1' : value =\u003e ['value1', 'value2'] }\n```\n\nin your manifest, it will properly be written as the example above.\n\nTo use this provider you use this:\n\n```\nPuppet::Type.type(:\u003cmodule\u003e_config).provide(\n  :openstackconfig,\n  :parent =\u003e Puppet::Type.type(:openstack_config).provider(:ruby)\n) do\n```\n\nand define you type with ```:array_matching =\u003e :all```.  An example of\nsuch provider is ```nova_config```.  Have a look for inspiration.\n\nImplementation\n--------------\n\n### openstacklib\n\nopenstacklib is a combination of Puppet manifest and ruby code to delivery\nconfiguration and extra functionality through types and providers.\n\nLimitations\n-----------\n\nThe python-migrate system package for RHEL 6 and below is out of date and may\nfail to correctly migrate postgresql databases. While this module does not\nhandle database migrations, it is common to set up refresh relationships\nbetween openstacklib::db::postgresql resource and the database sync exec\nresource. Relying on this behavior may cause errors.\n\nDevelopment\n-----------\n\nDeveloper documentation for the entire puppet-openstack project.\n\n* https://docs.openstack.org/puppet-openstack-guide/latest/\n\nContributors\n------------\n\n* https://github.com/openstack/puppet-openstacklib/graphs/contributors\n\nRelease Notes\n-------------\n\n* https://docs.openstack.org/releasenotes/puppet-openstacklib\n\nRepository\n----------\n\n* https://opendev.org/openstack/puppet-openstacklib\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstack%2Fpuppet-openstacklib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenstack%2Fpuppet-openstacklib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstack%2Fpuppet-openstacklib/lists"}