Modulesync configuration for OpenStack puppet modules
Go to file
Takashi Kajinami 2f99d1b590 Make lint job voting again
This partially reverts commit ed8026f6eb
and makes the lint job voting again, because the job has been fixed
by the dependent change.

Depends-on: https://review.opendev.org/876248
Change-Id: Ic6340f3e546408365900d3714504dfe0ed617f96
2023-03-10 10:39:05 +09:00
moduleroot Unpin modulesync 2022-08-16 14:05:12 +09:00
tools Create sync-projects.sh script 2015-08-12 14:37:52 -04:00
.gitignore Dissuade .gitignore references to personal tools 2018-10-08 11:54:04 +08:00
.gitreview OpenDev Migration Patch 2019-04-19 19:50:33 +00:00
.zuul.yaml Make lint job voting again 2023-03-10 10:39:05 +09:00
bindep.txt Add puppet dependencies to bindep.txt 2017-05-02 22:49:16 -04:00
config_defaults.yml Update modulesync config 2018-07-18 16:22:01 +02:00
functions Remove zuul-cloner usage 2019-06-26 20:44:01 +00:00
Gemfile Pin git to 1.14.0 2023-03-09 06:10:37 +00:00
LICENSE Update LICENSE 2018-04-06 20:14:42 +08:00
managed_modules.yml Remove retired puppet-monasca 2022-08-19 13:59:08 +09:00
modulesync.yml Add missing remote_branch and pre_commit_script 2015-07-29 10:46:02 +02:00
modulesync.yml.sample sample config (update namespace) 2015-08-04 17:27:18 +02:00
Rakefile Change to Litmus 2020-09-19 00:15:26 +02:00
README.md Change to Litmus 2020-09-19 00:15:26 +02:00
run_lint_tests.sh Add CI scripts 2016-07-29 11:22:11 -04:00
run_litmus_tests.sh Change to Litmus 2020-09-19 00:15:26 +02:00
run_syntax_tests.sh Remove FUTURE_PARSER 2019-10-10 11:32:20 +02:00
run_unit_tests.sh Support puppet 4.8 and latest for libraries unit test 2018-03-27 16:03:17 +08:00

Puppet-modulesync-configs

This repository contains default configuration for modulesync for OpenStack puppet modules. Changes to this repository should be synced with modulesync across all of the OpenStack puppet modules. It can also be used as an example for creating default configuration for other community modules.

A full description of ModuleSync can be found in ModuleSync's README. This README describes how the templates are rendered in the OpenStack puppet configuration.

Configuring ModuleSync

modulesync.yml

A key-value store of arguments to pass to ModuleSync. Each key is the name of a flag argument to the msync command. For example, namespace: myusername represents passing --namespace myusername to msync. This file does not appear in this repository because it only serves to override default configuration. To override the default configuration, take a look on modulesync.yml.sample provided file.

managed_modules.yml

A YAML array containing the names of the modules to manage.

Defining Module Files

config_defaults.yml

Each first-level key in this file is the name of a file in a module to manage. These files only appear here if there are templates in the moduleroot/ directory that need to be rendered with some default values that might be overridden. The files listed do not necessarily represent all the files that will be managed. The files in moduleroot/ represent all the files that will be managed, except for unmanaged and deleted files (see [#Special Options]).

.sync.yml

This file should appear in the module itself if there are any values to override from the config_defaults.yml file or if there are any additional values to assign. A description of what optional values can be defined in .sync.yml follows in the description of each file in moduleroot/. .sync.yml will have the same format as config_defaults.yml.

Note

Each template is rendered in slightly different ways. Your templates to not need to be identical to these, as long as your config_defaults.yml or .sync.yml files contain as first-level keys the exact names of the files you are managing and appropriately handle the data structures you use in your templates (arrays versus hashes versus single values).

moduleroot/Gemfile

The Gemfile contains a list of gems, optionally with versions, to install in the development and test groups. config_defaults.yml contains a list of "required" gems to install, in the form of an array where each element contains the names and versions of the gems. This section of config_defaults.yml might look like

Gemfile:
  required:
  - gem: rake
    version: '~>1.2'
  - gem: rspec-puppet
  - gem: minitest
    version: '~> 4.7'
    require: 'minitest/unit'
#...

The template also looks in .sync.yml for a group of optional gems to install, and merges this list with the list found in config_defaults.yml. This section of .sync.yml will look the same as the section of config_defaults.yml, but the name will be "optional" rather than "required".

moduleroot/Rakefile

The Rakefile gets most of its tasks from the puppetlabs_spec_helper. The variables in the template represent lint checks to disable. config_defaults.yml contains an array of checks to pass in to PuppetLint.configuration.send. The key for this array is called default_disabled_lint_checks. .sync.yml may contain an additional array of checks to disable, with the key extra_disabled_lint_checks.

moduleroot/.gitignore

Contains some standard files to ignore. You can pass in additional files as an array with the key "paths" in your .gitignore section in .sync.yml.

moduleroot/spec/spec_helper.rb

Flat file that simply requires the module_spec_helper from the puppetlabs_spec_helper.

Special Options

Unmanaged Files

A file can be marked "unmanaged" in .sync.yml, in which case modulesync will not try to modify it. This is useful if, for example, the module has special Rake tasks in the Rakefile which is difficult to manage through a template.

To mark a file "unmanaged", list it in .sync.yml with the value unmanaged: true. For example,

---
spec/spec_helper.rb:
  unmanaged: true

Deleted Files

Managing files may mean removing files. You can ensure a file is absent by marking it "delete". This is useful for purging nodesets.

To mark a file deleted, list it in .sync.yml with the value delete: true. For example,

---
spec/acceptance/nodesets/sles-11sp1-x64.yml
  delete: true