diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -74,6 +74,7 @@ lister.packagist=swh.lister.packagist:register lister.phabricator=swh.lister.phabricator:register lister.pubdev=swh.lister.pubdev:register + lister.puppet=swh.lister.puppet:register lister.pypi=swh.lister.pypi:register lister.sourceforge=swh.lister.sourceforge:register lister.tuleap=swh.lister.tuleap:register diff --git a/swh/lister/puppet/__init__.py b/swh/lister/puppet/__init__.py new file mode 100644 --- /dev/null +++ b/swh/lister/puppet/__init__.py @@ -0,0 +1,101 @@ +# Copyright (C) 2022 The Software Heritage developers +# See the AUTHORS file at the top-level directory of this distribution +# License: GNU General Public License version 3, or any later version +# See top-level LICENSE file for more information + + +""" +Puppet lister +============= + +The Puppet lister list origins from `Puppet Forge`_. +Puppet Forge is a package manager for Puppet modules. + +As of September 2022 `Puppet Forge`_ list 6917 package names. + +Origins retrieving strategy +--------------------------- + +To get a list of all package names we call an `http api endpoint`_ which have a +`getModules`_ endpoint. +It returns a paginated list of results and a `next` url. + +The api follow `OpenApi 3.0 specifications`. + +Page listing +------------ + +Each page returns a list of ``results`` which are raw data from api response. +The results size is 100 as 100 is the maximum limit size allowed by the api. + +Origins from page +----------------- + +The lister yields one hundred origin url per page. + +Origin url is the html page corresponding to a package name on the forge, following +this pattern:: + + "https://forge.puppet.com/modules/{owner}/{pkgname}" + +For each origin `last_update`is set via the module "updated_at" value. +As the api also returns all existing versions for a package, we build an `artifacts` +dict in `extra_loader_arguments` with the archive tarball corresponding to each +existing versions. + +Example for ``file_concat`` module located at +https://forge.puppet.com/modules/electrical/file_concat:: + + { + "artifacts": { + "1.0.0": { + "url": "https://forgeapi.puppet.com/v3/files/electrical-file_concat-1.0.0.tar.gz", # noqa: B950 + "version": "1.0.0", + "filename": "electrical-file_concat-1.0.0.tar.gz", + "last_update": "2015-04-09T12:03:13-07:00", + }, + "1.0.1": { + "url": "https://forgeapi.puppet.com/v3/files/electrical-file_concat-1.0.1.tar.gz", # noqa: B950 + "version": "1.0.1", + "filename": "electrical-file_concat-1.0.1.tar.gz", + "last_update": "2015-04-17T01:03:46-07:00", + }, + } + } + +Running tests +------------- + +Activate the virtualenv and run from within swh-lister directory:: + + pytest -s -vv --log-cli-level=DEBUG swh/lister/puppet/tests + +Testing with Docker +------------------- + +Change directory to swh/docker then launch the docker environment:: + + docker compose up -d + +Then schedule a Puppet listing task:: + + docker compose exec swh-scheduler swh scheduler task add -p oneshot list-puppet + +You can follow lister execution by displaying logs of swh-lister service:: + + docker compose logs -f swh-lister + +.. _Puppet Forge: https://forge.puppet.com/ +.. _http api endpoint: https://forgeapi.puppet.com/ +.. _getModules: https://forgeapi.puppet.com/#tag/Module-Operations/operation/getModules + +""" + + +def register(): + from .lister import PuppetLister + + return { + "lister": PuppetLister, + "task_modules": ["%s.tasks" % __name__], + } diff --git a/swh/lister/puppet/lister.py b/swh/lister/puppet/lister.py new file mode 100644 --- /dev/null +++ b/swh/lister/puppet/lister.py @@ -0,0 +1,98 @@ +# Copyright (C) 2022 The Software Heritage developers +# See the AUTHORS file at the top-level directory of this distribution +# License: GNU General Public License version 3, or any later version +# See top-level LICENSE file for more information + +from datetime import datetime +import logging +from typing import Any, Dict, Iterator, List, Optional +from urllib.parse import urljoin + +from swh.scheduler.interface import SchedulerInterface +from swh.scheduler.model import ListedOrigin + +from ..pattern import CredentialsType, StatelessLister + +logger = logging.getLogger(__name__) + +# Aliasing the page results returned by `get_pages` method from the lister. +PuppetListerPage = List[Dict[str, Any]] + + +class PuppetLister(StatelessLister[PuppetListerPage]): + """The Puppet lister list origins from 'Puppet Forge'""" + + LISTER_NAME = "puppet" + VISIT_TYPE = "puppet" + INSTANCE = "puppet" + + BASE_URL = "https://forgeapi.puppet.com/" + + def __init__( + self, + scheduler: SchedulerInterface, + credentials: Optional[CredentialsType] = None, + ): + super().__init__( + scheduler=scheduler, + credentials=credentials, + instance=self.INSTANCE, + url=self.BASE_URL, + ) + + def get_pages(self) -> Iterator[PuppetListerPage]: + """Yield an iterator which returns 'page' + + It request the http api endpoint to get a paginated results of modules, + and retrieve a `next` url. It ends when `next` json value is `null`. + + Open Api specification for getModules endpoint: + https://forgeapi.puppet.com/#tag/Module-Operations/operation/getModules + + """ + # limit = 100 is the max value for pagination + limit: int = 100 + response = self.http_request( + f"{self.BASE_URL}v3/modules", params={"limit": limit} + ) + data: Dict[str, Any] = response.json() + yield data["results"] + + while data["pagination"]["next"]: + response = self.http_request( + urljoin(self.BASE_URL, data["pagination"]["next"]) + ) + data = response.json() + yield data["results"] + + def get_origins_from_page(self, page: PuppetListerPage) -> Iterator[ListedOrigin]: + """Iterate on all pages and yield ListedOrigin instances.""" + assert self.lister_obj.id is not None + + dt_parse_pattern = "%Y-%m-%d %H:%M:%S %z" + + for entry in page: + last_update = datetime.strptime(entry["updated_at"], dt_parse_pattern) + pkgname = entry["name"] + owner = entry["owner"]["slug"] + url = f"https://forge.puppet.com/modules/{owner}/{pkgname}" + artifacts = {} + for release in entry["releases"]: + # Build an artifact entry following original-artifacts-json specification + # https://docs.softwareheritage.org/devel/swh-storage/extrinsic-metadata-specification.html#original-artifacts-json # noqa: B950 + artifacts[release["version"]] = { + "filename": release["file_uri"].split("/")[-1], + "url": urljoin(self.BASE_URL, release["file_uri"]), + "version": release["version"], + "last_update": datetime.strptime( + release["created_at"], dt_parse_pattern + ).isoformat(), + } + + yield ListedOrigin( + lister_id=self.lister_obj.id, + visit_type=self.VISIT_TYPE, + url=url, + last_update=last_update, + extra_loader_arguments={"artifacts": artifacts}, + ) diff --git a/swh/lister/puppet/tasks.py b/swh/lister/puppet/tasks.py new file mode 100644 --- /dev/null +++ b/swh/lister/puppet/tasks.py @@ -0,0 +1,19 @@ +# Copyright (C) 2022 The Software Heritage developers +# See the AUTHORS file at the top-level directory of this distribution +# License: GNU General Public License version 3, or any later version +# See top-level LICENSE file for more information + +from celery import shared_task + +from swh.lister.puppet.lister import PuppetLister + + +@shared_task(name=__name__ + ".PuppetListerTask") +def list_puppet(**lister_args): + """Lister task for Puppet""" + return PuppetLister.from_configfile(**lister_args).run().dict() + + +@shared_task(name=__name__ + ".ping") +def _ping(): + return "OK" diff --git a/swh/lister/puppet/tests/__init__.py b/swh/lister/puppet/tests/__init__.py new file mode 100644 diff --git a/swh/lister/puppet/tests/data/https_forgeapi.puppet.com/v3_modules,limit=100 b/swh/lister/puppet/tests/data/https_forgeapi.puppet.com/v3_modules,limit=100 new file mode 100644 --- /dev/null +++ b/swh/lister/puppet/tests/data/https_forgeapi.puppet.com/v3_modules,limit=100 @@ -0,0 +1,391 @@ +{ + "pagination": { + "limit": 100, + "offset": 0, + "first": "/v3/modules?limit=100&offset=0", + "previous": null, + "current": "/v3/modules?limit=100&offset=0", + "next": "/v3/modules?limit=100&offset=100", + "total": 7301 + }, + "results": [ + { + "uri": "/v3/modules/puppetlabs-puppetdb", + "slug": "puppetlabs-puppetdb", + "name": "puppetdb", + "downloads": 313089590, + "created_at": "2012-09-19 16:49:18 -0700", + "updated_at": "2021-12-16 14:57:46 -0800", + "deprecated_at": null, + "deprecated_for": null, + "superseded_by": null, + "supported": false, + "endorsement": null, + "module_group": "base", + "owner": { + "uri": "/v3/users/puppetlabs", + "slug": "puppetlabs", + "username": "puppetlabs", + "gravatar_id": "fdd009b7c1ec96e088b389f773e87aec" + }, + "premium": false, + "current_release": { + "uri": "/v3/releases/puppetlabs-puppetdb-7.10.0", + "slug": "puppetlabs-puppetdb-7.10.0", + "module": { + "uri": "/v3/modules/puppetlabs-puppetdb", + "slug": "puppetlabs-puppetdb", + "name": "puppetdb", + "deprecated_at": null, + "owner": { + "uri": "/v3/users/puppetlabs", + "slug": "puppetlabs", + "username": "puppetlabs", + "gravatar_id": "fdd009b7c1ec96e088b389f773e87aec" + } + }, + "version": "7.10.0", + "metadata": { + "name": "puppetlabs-puppetdb", + "version": "7.10.0", + "author": "puppetlabs", + "summary": "Installs PostgreSQL and PuppetDB, sets up the connection to Puppet master.", + "license": "Apache-2.0", + "source": "git://github.com/puppetlabs/puppetlabs-puppetdb.git", + "project_page": "http://github.com/puppetlabs/puppetlabs-puppetdb", + "issues_url": "https://tickets.puppetlabs.com/browse/PDB", + "dependencies": [ + { + "name": "puppetlabs/inifile", + "version_requirement": ">= 1.1.3 < 6.0.0" + }, + { + "name": "puppetlabs/postgresql", + "version_requirement": ">= 6.5.0 < 8.0.0" + }, + { + "name": "puppetlabs/firewall", + "version_requirement": ">= 1.1.3 < 4.0.0" + }, + { + "name": "puppetlabs/stdlib", + "version_requirement": ">= 4.13.1 < 9.0.0" + } + ], + "operatingsystem_support": [ + { + "operatingsystem": "RedHat", + "operatingsystemrelease": [ + "6", + "7", + "8" + ] + }, + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "6", + "7", + "8" + ] + }, + { + "operatingsystem": "OracleLinux", + "operatingsystemrelease": [ + "6", + "7", + "8" + ] + }, + { + "operatingsystem": "Scientific", + "operatingsystemrelease": [ + "6", + "7" + ] + }, + { + "operatingsystem": "SLES", + "operatingsystemrelease": [ + "12 SP3" + ] + }, + { + "operatingsystem": "Debian", + "operatingsystemrelease": [ + "8", + "9", + "10", + "11" + ] + }, + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "16.04", + "18.04", + "20.04" + ] + } + ], + "requirements": [ + { + "name": "puppet", + "version_requirement": ">= 4.10.0 < 8.0.0" + } + ], + "description": "Module for installing/configuring PuppetDB", + "pdk-version": "1.18.0", + "template-url": "https://github.com/puppetlabs/pdk-templates#1.18.0", + "template-ref": "tags/1.18.0-0-g095317c" + }, + "tags": [ + "puppet", + "puppetdb", + "storeconfig" + ], + "supported": false, + "pdk": true, + "validation_score": 100, + "file_uri": "/v3/files/puppetlabs-puppetdb-7.10.0.tar.gz", + "file_size": 42806, + "file_md5": "e91a2074ca8d94a8b3ff7f6c8bbf12bc", + "file_sha256": "49b1a542fbd2a1378c16cb04809e0f88bf4f3e45979532294fb1f03f56c97fbb", + "downloads": 36371, + "readme": "puppetdb\n=========\n\n#### Table of Contents\n\n1. [Overview - What is the PuppetDB module?](#overview)\n2. [Module Description - What does the module do?](#module-description)\n3. [Setup - The basics of getting started with PuppetDB module](#setup)\n4. [Upgrading - Guide for upgrading from older revisions of this module](#upgrading)\n4. [Usage - The classes and parameters available for configuration](#usage)\n5. [Implementation - An under-the-hood peek at what the module is doing](#implementation)\n6. [Limitations - OS compatibility, etc.](#limitations)\n7. [Development - Guide for contributing to the module](#development)\n8. [Release Notes - Notes on the most recent updates to the module](#release-notes)\n\nOverview\n--------\n\nBy guiding puppetdb setup and configuration with a Puppet master, the PuppetDB\nmodule provides fast, streamlined access to data on puppetized infrastructure.\n\nModule Description\n-------------------\n\nThe PuppetDB module provides a quick way to get started using PuppetDB, an open\nsource inventory resource service that manages storage and retrieval of\nplatform-generated data. The module will install PostgreSQL and PuppetDB if you\ndon't have them, as well as set up the connection to Puppet master. The module\nwill also provide a dashboard you can use to view the current state of your\nsystem.\n\nFor more information about PuppetDB\n[please see the official PuppetDB documentation.](https://puppet.com/docs/puppetdb/latest/)\n\n\nSetup\n-----\n\n**What PuppetDB affects:**\n\n* package/service/configuration files for PuppetDB\n* package/service/configuration files for PostgreSQL (optional, but set as default)\n* Puppet master's runtime (via plugins)\n* Puppet master's configuration\n * **note**: Using the `puppetdb::master::config` class will cause your\n routes.yaml file to be overwritten entirely (see **Usage** below for options\n and more information )\n* system firewall (optional)\n* listened-to ports\n\n**Introductory Questions**\n\nTo begin using PuppetDB, you’ll have to make a few decisions:\n\n* Which database back-end should I use?\n * PostgreSQL (default) or our embedded database\n * Embedded database\n * **note:** As of PuppetDB 4.0, the embedded database is no longer supported as\n an option. When running PuppetDB 3.x, we suggest using the embedded database\n only for experimental environments rather than production, as it does not scale\n well and can cause difficulty in migrating to PostgreSQL.\n* Should I run the database on the same node that I run PuppetDB on?\n* Should I run PuppetDB on the same node that I run my master on?\n\nThe answers to those questions will be largely dependent on your answers to\nquestions about your Puppet environment:\n\n* How many nodes are you managing?\n* What kind of hardware are you running on?\n* Is your current load approaching the limits of your hardware?\n\nDepending on your answers to all of the questions above, you will likely fall\nunder one of these set-up options:\n\n1. [Single Node (Testing and Development)](#single-node-setup)\n2. [Multiple Node (Recommended)](#multiple-node-setup)\n\n### Single Node Setup\n\nThis approach assumes you will use our default database (PostgreSQL) and run\neverything (PostgreSQL, PuppetDB, Puppet master) all on the same node. This\nsetup will be great for a testing or experimental environment. In this case,\nyour manifest will look like:\n\n node {\n # Configure puppetdb and its underlying database\n class { 'puppetdb': }\n \n # Configure the Puppet master to use puppetdb\n class { 'puppetdb::master::config': }\n }\n\nYou can provide some parameters for these classes if you’d like more control,\nbut that is literally all that it will take to get you up and running with the\ndefault configuration.\n\n### Multiple Node Setup\n\nThis approach is for those who prefer not to install PuppetDB on the same node\nas the Puppet master. Your environment will be easier to scale if you are able\nto dedicate hardware to the individual system components. You may even choose to\nrun the puppetdb server on a different node from the PostgreSQL database that it\nuses to store its data. So let’s have a look at what a manifest for that\nscenario might look like:\n\n**This is an example of a very basic 3-node setup for PuppetDB.**\n\n $puppetdb_host = 'puppetdb.example.lan'\n $postgres_host = 'postgres.example.lan'\n node 'master.example.lan' {\n # Here we configure the Puppet master to use PuppetDB,\n # telling it the hostname of the PuppetDB node\n class { 'puppetdb::master::config':\n puppetdb_server => $puppetdb_host,\n }\n }\n node 'postgres.example.lan' {\n # Here we install and configure PostgreSQL and the PuppetDB\n # database instance, and tell PostgreSQL that it should\n # listen for connections to the `$postgres_host`\n class { 'puppetdb::database::postgresql':\n listen_addresses => $postgres_host,\n }\n }\n node 'puppetdb.example.lan' {\n # Here we install and configure PuppetDB, and tell it where to\n # find the PostgreSQL database.\n class { 'puppetdb::server':\n database_host => $postgres_host,\n }\n }\n\nThis should be all it takes to get a 3-node, distributed installation of\nPuppetDB up and running. Note that, if you prefer, you could easily move two of\nthese classes to a single node and end up with a 2-node setup instead.\n\n### Enable SSL connections\n\nTo use SSL connections for the single node setup, use the following manifest:\n\n node {\n # Here we configure puppetdb and PostgreSQL to use ssl connections\n class { 'puppetdb':\n postgresql_ssl_on => true,\n database_host => '',\n database_listen_address => '0.0.0.0'\n }\n \n # Configure the Puppet master to use puppetdb\n class { 'puppetdb::master::config': }\n\nTo use SSL connections for the multiple nodes setup, use the following manifest:\n\n $puppetdb_host = 'puppetdb.example.lan'\n $postgres_host = 'postgres.example.lan'\n\n node 'master.example.lan' {\n # Here we configure the Puppet master to use PuppetDB,\n # telling it the hostname of the PuppetDB node.\n class { 'puppetdb::master::config':\n puppetdb_server => $puppetdb_host,\n }\n }\n\n node 'postgres.example.lan' {\n # Here we install and configure PostgreSQL and the PuppetDB\n # database instance, and tell PostgreSQL that it should\n # listen for connections to the `$postgres_host`. \n # We also enable SSL connections.\n class { 'puppetdb::database::postgresql':\n listen_addresses => $postgres_host,\n postgresql_ssl_on => true,\n puppetdb_server => $puppetdb_host\n }\n }\n\n node 'puppetdb.example.lan' {\n # Here we install and configure PuppetDB, and tell it where to\n # find the PostgreSQL database. We also enable SSL connections.\n class { 'puppetdb::server':\n database_host => $postgres_host,\n postgresql_ssl_on => true\n }\n }\n\n### Beginning with PuppetDB\n\nWhether you choose a single node development setup or a multi-node setup, a\nbasic setup of PuppetDB will cause: PostgreSQL to install on the node if it’s\nnot already there; PuppetDB postgres database instance and user account to be\ncreated; the postgres connection to be validated and, if successful, PuppetDB to\nbe installed and configured; PuppetDB connection to be validated and, if\nsuccessful, the Puppet master config files to be modified to use PuppetDB; and\nthe Puppet master to be restarted so that it will pick up the config changes.\n\nIf your logging level is set to INFO or finer, you should start seeing\nPuppetDB-related log messages appear in both your Puppet master log and your\npuppetdb log as subsequent agent runs occur.\n\n### Cross-node Dependencies\n\nIt is worth noting that there are some cross-node dependencies, which means that\nthe first time you add the module's configurations to your manifests, you may\nsee a few failed puppet runs on the affected nodes.\n\nPuppetDB handles cross-node dependencies by taking a sort of \"eventual\nconsistency\" approach. There’s nothing that the module can do to control the\norder in which your nodes check in, but the module can check to verify that the\nservices it depends on are up and running before it makes configuration\nchanges--so that’s what it does.\n\nWhen your Puppet master node checks in, it will validate the connectivity to the\npuppetdb server before it applies its changes to the Puppet master config files.\nIf it can’t connect to puppetdb, then the puppet run will fail and the previous\nconfig files will be left intact. This prevents your master from getting into a\nbroken state where all incoming puppet runs fail because the master is\nconfigured to use a puppetdb server that doesn’t exist yet. The same strategy is\nused to handle the dependency between the puppetdb server and the postgres\nserver.\n\nHence the failed puppet runs. These failures should be limited to 1 failed run\non the puppetdb node, and up to 2 failed runs on the Puppet master node. After\nthat, all of the dependencies should be satisfied and your puppet runs should\nstart to succeed again.\n\nYou can also manually trigger puppet runs on the nodes in the correct order\n(Postgres, PuppetDB, Puppet master), which will avoid any failed runs.\n\nUpgrading\n---------\n\n### Upgrading from 4.x to 5.x\n\nSignificant parameter changes are listed below:\n\n* The PuppetDB module defaults to Puppet 4 pathing and assumes `puppetserver`\n is the master service by default\n* The PuppetDB module manages Postgres repos by default. To turn this behavior\n off, set `manage_package_repo` to `false`.\n* To specify a specific version of PuppetDB to manage, you'll need to use the\n `puppetdb::globals` class to set the version of PuppetDB you're using\n explicitly. The ability to configure the version in the `puppetdb::server` and\n `puppetdb` class have been removed.\n\nFor example if your config looked like this before:\n\n class {'puppetdb':\n puppetdb_version => '3.2.4-1.el7',\n }\n class { 'puppetdb::master::config': }\n\nand you'd still like to use the module with PuppetDB 3.2.4, all you'd have to\nchange would be:\n\n class { 'puppetdb::globals':\n version => '3.2.4-1.el7',\n }\n class { 'puppetdb' : }\n class { 'puppetdb::master::config' : }\n\nThe `globals` class above takes into account the following PuppetDB 3 and Puppet\n4 related changes:\n * The `puppetdb::master:puppetdb_conf` class has added a `$legacy_terminus`\n to support the PuppetDB 2.x terminus configuration.\n * The default `test_url` for the `PuppetDBConnValidator` has also been\n changed to `/pdb/meta/v1/version` but will default to `/v3/version` when\n using a PuppetDB 2.x version.\n * The configuration pathing for Puppet and PuppetDB has changed with Puppet\n 4 and PuppetDB 3, using PuppetDB 2.x or older assumes the old\n configuration pathing.\n\nSee the CHANGELOG file for more detailed information on changes for each release.\n\n### Upgrading from 3.x to 4.x\n\nFor this release, all dependency versions have been bumped to their latest.\nSignificant parameter changes are listed below:\n\n* The PuppetDB module now only supports Puppet 3.7.1 or later\n* `puppetlabs/postgresql` 4.0.0 or later is now required\n* `puppetlabs/inifile` 1.1.3 or later is now required\n* `puppetlabs/firewall` 1.1.3 or later is now required\n* `puppetlabs/stdlib` 4.2.2 or later is now required\n* The parameter `manage_firewall` for the class `puppetdb::database::postgresql`\n has now been removed, since the PostgreSQL module no longer supports this.\n* The parameter `open_postgres_port` for the class `puppetdb` has also been\n removed, due to PostgreSQL changes.\n\nSee the CHANGELOG file for more detailed information on changes for each release.\n\n### Upgrading from 2.x to 3.x\n\nFor this release a major dependency has changed. The module\n`pupppetlabs/postgresql` must now be version 3.x. Upgrading the module should\nupgrade the `puppetlabs/postgresql` module for you, but if another module has a\nfixed dependency that module will have to be fixed before you can continue.\n\nSome other changes include:\n\n* The parameter `manage_redhat_firewall` for the class `puppetdb` has now been\n removed completely in favor of `open_postgres_port` and\n `open_ssl_listen_port`.\n* The parameter `manage_redhat_firewall` for the class\n `puppetdb::database::postgresql`, has now been renamed to `manage_firewall`.\n* The parameter `manage_redhat_firewall` for the class `puppetdb::server` has\n now been removed completely in favor of `open_listen_port` and\n `open_ssl_listen_port`.\n* The internal class: `puppetdb::database::postgresql_db` has been removed. If\n you were using this, it is now defunct.\n* The class `puppetdb::server::firewall` has been marked as private, do not use\n it directly.\n* The class `puppetdb::server::jetty_ini` and `puppetdb::server::database_ini`\n have been marked as private, do not use it directly.\n\n### Upgrading from 1.x to 2.x\n\nA major dependency has been changed, so now when you upgrade to 2.0 the\ndependency `cprice404/inifile` has been replaced with `puppetlabs/inifile`. This\nmay interfere with other modules as they may depend on the old\n`cprice404/inifile` instead, so upgrading should be done with caution. Check\nthat your other modules use the newer `puppetlabs/inifile` module as\ninteroperation with the old `cprice404/inifile` module will no longer be\nsupported by this module.\n\nDepending on how you install your modules, changing the dependency may require\nmanual intervention. Double check your modules contain the newer\n`puppetlabs/inifile` after installing this latest module.\n\nOtherwise, all existing parameters from 1.x should still work correctly.\n\nUsage\n------\n\nPuppetDB supports a large number of configuration options for both configuring\nthe puppetdb service and connecting that service to the Puppet master.\n\n### puppetdb::globals\n\nThe `puppetdb::globals` class is intended to provide similar functionality to\nthe `postgresql::globals` class in the `puppetlabs-postgresql` module by\nexposing a top-level entry-point into the module so that we can properly set\ndefaults for the `puppetdb::params` class based on the version of `puppetdb` you\nare using. This setting defaults to `present`.\n\nYou must declare the class to use it:\n\n class { 'puppetdb::globals': }\n\n**Parameters within `puppetdb::globals`:**\n\n#### `version`\n\nThe version of the `puppetdb` package that should be installed. You may specify\nan explicit version number, 'present', or 'latest' (defaults to 'present').\n\n### puppetdb\n\nThe `puppetdb` class is intended as a high-level abstraction (sort of an\n'all-in-one' class) to help simplify the process of getting your puppetdb server\nup and running. It wraps the slightly-lower-level classes `puppetdb::server` and\n`puppetdb::database::*`, and it'll get you up and running with everything you\nneed (including database setup and management) on the server side. For maximum\nconfigurability, you may choose not to use this class. You may prefer to use the\n`puppetdb::server` class directly, or manage your puppetdb setup on your own.\n\nYou must declare the class to use it:\n\n class { 'puppetdb': }\n\n**Parameters within `puppetdb`:**\n\n#### `listen_address`\n\nThe address that the web server should bind to for HTTP requests. Defaults to\n`localhost`. Set to `0.0.0.0` to listen on all addresses.\n\n#### `listen_port`\n\nThe port on which the puppetdb web server should accept HTTP requests. Defaults\nto `8080`.\n\n#### `disable_cleartext`\n\nIf true, the puppetdb web server will only serve HTTPS and not HTTP requests (defaults to false).\n\n#### `open_listen_port`\n\nIf `true`, open the `http_listen_port` on the firewall. Defaults to `false`.\n\n#### `ssl_listen_address`\n\nThe address that the web server should bind to for HTTPS requests. Defaults to\n`0.0.0.0` to listen on all addresses.\n\n#### `ssl_listen_port`\n\nThe port on which the puppetdb web server should accept HTTPS requests. Defaults\nto `8081`.\n\n#### `disable_ssl`\n\nIf `true`, the puppetdb web server will only serve HTTP and not HTTPS requests.\nDefaults to `false`.\n\n#### `open_ssl_listen_port`\n\nIf true, open the `ssl_listen_port` on the firewall. Defaults to `undef`.\n\n#### `ssl_protocols`\n\nSpecify the supported SSL protocols for PuppetDB (e.g. TLSv1, TLSv1.1, TLSv1.2.)\n\n### `postgresql_ssl_on`\n\nIf `true`, it configures SSL connections between PuppetDB and the PostgreSQL database.\nDefaults to `false`.\n\n#### `cipher_suites`\n\nConfigure jetty's supported `cipher-suites` (e.g. `SSL_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384`).\nDefaults to `undef`.\n\n#### `migrate`\n\nIf `true`, puppetdb will automatically migrate to the latest database format at startup. If `false`, if the database format supplied by this version of PuppetDB doesn't match the version expected (whether newer or older), PuppetDB will exit with an error status. Defaults to `true`.\n\n### `manage_dbserver`\n\nIf true, the PostgreSQL server will be managed by this module. Defaults to `true`.\n\n### `manage_database`\n\nIf true, the PostgreSQL database will be managed by this module. Defaults to `true`.\n\n#### `database`\n\nWhich database backend to use; legal values are `postgres` (default)\nor `embedded`. The `embedded` option is not supported on PuppetDB\n4.0.0 or later. `embedded` can be used for very small installations or\nfor testing, but is not recommended for use in production\nenvironments. For more info, see the [puppetdb\ndocs](https://puppet.com/docs/puppetdb/latest/).\n\n#### `database_host`\n\nHostname to use for the database connection. For single case installations this\nshould be left as the default. Defaults to `localhost`, ignored for `embedded`\ndatabase.\n\n#### `database_port`\n\nThe port that the database server listens on. Defaults to `5432`, ignored for\n`embedded` database.\n\n#### `database_username`\n\nThe name of the database user to connect as. Defaults to `puppetdb`, ignored for\n`embedded` database.\n\n#### `database_password`\n\nThe password for the database user. Defaults to `puppetdb`, ignored for\n`embedded` database.\n\n#### `manage_db_password`\n\nWhether or not the database password in database.ini will be managed by this module.\nSet this to `false` if you want to set the password some other way.\nDefaults to `true`\n\n#### `database_name`\n\nThe name of the database instance to connect to. Defaults to `puppetdb`, ignored\nfor `embedded` database.\n\n#### `jdbc_ssl_properties`\n\nThe text to append to the JDBC connection URI. This should begin with a '?'\ncharacter. For example, to use SSL for the PostgreSQL connection, set this\nparameter's value to `?ssl=true`.\n\nThis setting is only available when using PostgreSQL; when using HyperSQL (the\n`embedded` database), it does nothing.\n\n#### `database_validate`\n\nIf true, the module will attempt to connect to the database using the specified\nsettings and fail if it is not able to do so. Defaults to `true`.\n\n#### `database_embedded_path`\n\n*Embedded Database Only* Changes the path location for the HSQLDB database. Does\n not provide migration for old data, so if you change this value and you have an\n existing database you will need to manually move the content also. (defaults to\n package default for 2.x release).\n\n#### `node_ttl`\n\nThe length of time a node can go without receiving any new data before it's\nautomatically deactivated. (defaults to '7d', which is a 7-day period. Set to\n'0d' to disable auto-deactivation). This option is supported in PuppetDB >=\n1.1.0.\n\n#### `node_purge_ttl`\n\nThe length of time a node can be deactivated before it's deleted from the\ndatabase. (defaults to '14d', which is a 14-day period. Set to '0d' to disable\npurging). This option is supported in PuppetDB >= 1.2.0.\n\n#### `report_ttl`\n\nThe length of time reports should be stored before being deleted. (defaults to\n`14d`, which is a 14-day period). This option is supported in PuppetDB >= 1.1.0.\n\n#### `gc_interval`\n\nThis controls how often (in minutes) to compact the database. The compaction\nprocess reclaims space and deletes unnecessary rows. If not supplied, the\ndefault is every 60 minutes. This option is supported in PuppetDB >= 0.9.\n\n#### `log_slow_statements`\n\nThis sets the number of seconds before an SQL query is considered \"slow.\" Slow\nSQL queries are logged as warnings, to assist in debugging and tuning. Note\nPuppetDB does not interrupt slow queries; it simply reports them after they\ncomplete.\n\nThe default value is `10` seconds. A value of 0 will disable logging of slow\nqueries. This option is supported in PuppetDB >= 1.1.\n\n#### `conn_max_age`\n\nThe maximum time (in minutes) for a pooled connection to remain unused before\nit is closed off.\n\nIf not supplied, we default to `60` minutes. This option is supported in PuppetDB >= 1.1.\n\n#### `conn_keep_alive`\n\nThis sets the time (in minutes) for a connection to remain idle before sending\na test query to the DB. This is useful to prevent a DB from timing out\nconnections on its end.\n\nIf not supplied, we default to 45 minutes. This option is supported in PuppetDB >= 1.1.\n\n#### `conn_lifetime`\n\nThe maximum time (in minutes) a pooled connection should remain open. Any\nconnections older than this setting will be closed off. Connections currently in\nuse will not be affected until they are returned to the pool.\n\nIf not supplied, we won't terminate connections based on their age alone. This\noption is supported in PuppetDB >= 1.4.\n\n#### `puppetdb_package`\n\nThe PuppetDB package name in the package manager. Defaults to `present`.\n\n#### `puppetdb_service`\n\nThe name of the PuppetDB service. Defaults to `puppetdb`.\n\n#### `puppetdb_service_status`\n\nSets whether the service should be `running ` or `stopped`. When set to `stopped` the\nservice doesn't start on boot either. Valid values are `true`, `running`,\n`false`, and `stopped`.\n\n#### `confdir`\n\nThe PuppetDB configuration directory. Defaults to `/etc/puppetdb/conf.d`.\n\n#### `vardir`\n\nThe parent directory for the MQ's data directory.\n\n#### `java_args`\n\nJava VM options used for overriding default Java VM options specified in\nPuppetDB package. Defaults to `{}`. See\n[PuppetDB Configuration](https://puppet.com/docs/puppetdb/latest/configure.html)\nto get more details about the current defaults.\n\nFor example, to set `-Xmx512m -Xms256m` options use:\n\n {\n '-Xmx' => '512m',\n '-Xms' => '256m',\n }\n\n#### `merge_default_java_args`\n\nSets whether the provided java args should be merged with the defaults, or\nshould override the defaults. This setting is necessary if any of the defaults\nare to be removed. Defaults to true. If `false`, the `java_args` in the PuppetDB\ninit config file will reflect only what is passed via the `java_args` param.\n\n#### `max_threads`\n\nJetty option to explicitly set `max-threads`. Defaults to `undef`, so the\nPuppetDB-Jetty default is used.\n\n#### `read_database`\n\nWhich database backend to use for the read database. Only supports\n`postgres` (default). This option is supported in PuppetDB >= 1.6.\n\n#### `read_database_host`\n*This parameter must be set to use another PuppetDB instance for queries.*\n\nThe hostname or IP address of the read database server. If set to `undef`, and \n`manage_database` is set to `true`, it will use the value of the `database_host` \nparameter. This option is supported in PuppetDB >= 1.6.\n\n#### `read_database_port`\n\nThe port that the read database server listens on. If `read_database_host`\nis set to `undef`, and `manage_database` is set to `true`, it will use the value of \nthe `database_port` parameter. This option is supported in PuppetDB >= 1.6.\n\n#### `read_database_username`\n\nThe name of the read database user to connect as. Defaults to `puppetdb-read`. This\noption is supported in PuppetDB >= 1.6.\n\n#### `read_database_password`\n\nThe password for the read database user. Defaults to `puppetdb-read`. This option is\nsupported in PuppetDB >= 1.6.\n\n#### `manage_read_db_password`\n\nWhether or not the database password in read-database.ini will be managed by this module.\nSet this to `false` if you want to set the password some other way.\nDefaults to `true`\n\n#### `read_database_name`\n\nThe name of the read database instance to connect to. If `read_database_host`\nis set to `undef`, and `manage_database` is set to `true`, it will use the value of\nthe `database_name` parameter. This option is supported in PuppetDB >= 1.6.\n\n#### `read_log_slow_statements`\n\nThis sets the number of seconds before an SQL query to the read database is\nconsidered \"slow.\" Slow SQL queries are logged as warnings, to assist in\ndebugging and tuning. Note PuppetDB does not interrupt slow queries; it simply\nreports them after they complete.\n\nThe default value is 10 seconds. A value of 0 will disable logging of slow\nqueries. This option is supported in PuppetDB >= 1.6.\n\n#### `read_conn_max_age`\n\nThe maximum time (in minutes) for a pooled read database connection to remain\nunused before it is closed off.\n\nIf not supplied, we default to 60 minutes. This option is supported in PuppetDB >= 1.6.\n\n#### `read_conn_keep_alive`\n\nThis sets the time (in minutes) for a read database connection to remain idle\nbefore sending a test query to the DB. This is useful to prevent a DB from\ntiming out connections on its end.\n\nIf not supplied, we default to 45 minutes. This option is supported in PuppetDB >= 1.6.\n\n#### `read_conn_lifetime`\n\nThe maximum time (in minutes) a pooled read database connection should remain\nopen. Any connections older than this setting will be closed off. Connections\ncurrently in use will not be affected until they are returned to the pool.\n\nIf not supplied, we won't terminate connections based on their age alone. This\noption is supported in PuppetDB >= 1.6.\n\n#### `ssl_dir`\n\nBase directory for PuppetDB SSL configuration. Defaults to `/etc/puppetdb/ssl`\nor `/etc/puppetlabs/puppetdb/ssl` for FOSS and PE respectively.\n\n#### `ssl_set_cert_paths`\n\nA switch to enable or disable the management of SSL certificates in your\n`jetty.ini` configuration file.\n\n#### `ssl_cert_path`\n\nPath to your SSL certificate for populating `jetty.ini`.\n\n#### `ssl_key_path`\n\nPath to your SSL key for populating `jetty.ini`.\n\n#### `ssl_ca_cert_path`\n\nPath to your SSL CA for populating `jetty.ini`.\n\n#### `ssl_deploy_certs`\n\nA boolean switch to enable or disable the management of SSL keys in your\n`ssl_dir`. Default is `false`.\n\n#### `ssl_key`\n\nContents of your SSL key, as a string.\n\n#### `ssl_cert`\n\nContents of your SSL certificate, as a string.\n\n#### `ssl_ca_cert`\n\nContents of your SSL CA certificate, as a string.\n\n#### `manage_firewall`\n\nIf `true`, puppet will manage your iptables rules for PuppetDB via the\n[puppetlabs-firewall](https://forge.puppetlabs.com/puppetlabs/firewall) class.\n\n#### `command_threads`\n\nThe number of command processing threads to use. Defaults to `undef`, using the\nPuppetDB built-in default.\n\n#### `concurrent_writes`\n\nThe number of threads allowed to write to disk at any one time. Defaults to\n`undef`, which uses the PuppetDB built-in default.\n\n#### `store_usage`\n\nThe amount of disk space (in MB) to allow for persistent message storage.\nDefaults to `undef`, using the PuppetDB built-in default.\n\n#### `temp_usage`\n\nThe amount of disk space (in MB) to allow for temporary message storage.\nDefaults to `undef`, using the PuppetDB built-in default.\n\n#### `disable_update_checking`\n\nSetting this to true disables checking for updated versions of PuppetDB and sending basic analytics data to Puppet.\nDefaults to `undef`, using the PuppetDB built-in default.\n\n#### `certificate_whitelist_file`\n\nThe name of the certificate whitelist file to set up and configure in PuppetDB. Defaults to `/etc/puppetdb/certificate-whitelist` or `/etc/puppetlabs/puppetdb/certificate-whitelist` for FOSS and PE respectively.\n\n#### `certificate_whitelist`\n\nArray of the X.509 certificate Common Names of clients allowed to connect to PuppetDB. Defaults to empty. Be aware that this permits full access to all Puppet clients to download anything contained in PuppetDB, including the full catalogs of all nodes, which possibly contain sensitive information. Set to `[ $::servername ]` to allow access only from your (single) Puppet master, which is enough for normal operation. Set to a list of Puppet masters if you have multiple.\n\n#### `automatic_dlo_cleanup`\n\nPuppetDB creates [Dead Letter Office](https://puppet.com/docs/puppetdb/5.2/maintain_and_tune.html#clean-up-the-dead-letter-office).\nThose are reports of failed requests. They spill up the disk. This parameter is\na boolean and defaults to false. You can enable automatic cleanup of DLO\nreports by setting this to true.\n\n#### `cleanup_timer_interval`\n\nThe DLO cleanup is a systemd timer if systemd is available, otherwise a\ncronjob. The variable configures the systemd.timer option [onCalender](https://www.freedesktop.org/software/systemd/man/systemd.timer.html#OnCalendar=).\nIt defaults to `*-*-* ${fqdn_rand(24)}:${fqdn_rand(60)}:00`. This will start\nthe cleanup service on a daily basis. The exact minute and hour is random\nper node based on the [fqdn_rand](https://puppet.com/docs/puppet/5.5/function.html#fqdnrand)\nmethod. On non-systemd systems, the cron runs daily and the `$puppetdb_user` needs\nto be able to run cron jobs. On systemd systems you need the [camptocamp/systemd](https://forge.puppet.com/camptocamp/systemd)\nmodule, which is an optional dependency and not automatically installed!\n\n#### `dlo_max_age`\n\nThis is a positive integer. It describes the amount of days you want to keep\nthe DLO reports. The default value is 90 days.\n\n### puppetdb::server\n\nThe `puppetdb::server` class manages the PuppetDB server independently of the\nunderlying database that it depends on. It will manage the PuppetDB package,\nservice, config files, etc., but will still allow you to manage the database\n(e.g. PostgreSQL) however you see fit.\n\n class { 'puppetdb::server':\n database_host => 'pg1.mydomain.com',\n }\n\n### puppetdb::master::config\n\nThe `puppetdb::master::config` class directs your Puppet master to use PuppetDB,\nwhich means that this class should be used on your Puppet master node. It’ll\nverify that it can successfully communicate with your PuppetDB server, and then\nconfigure your master to use PuppetDB.\n\nUsing this class allows the module to manipulate the puppet configuration files\npuppet.conf and routes.yaml. The puppet.conf changes are supplemental and should\nnot affect any of your existing settings, but the routes.yaml file will be\noverwritten entirely. If you have an existing routes.yaml file, you will want to\ntake care to use the `manage_routes` parameter of this class to prevent the module\nfrom managing that file, and you’ll need to manage it yourself.\n\n class { 'puppetdb::master::config':\n puppetdb_server => 'my.host.name',\n puppetdb_port => 8081,\n }\n\n**Parameters within `puppetdb::master::config`:**\n\n#### `puppetdb_server`\n\nThe dns name or ip of the PuppetDB server. Defaults to the hostname of the\ncurrent node, i.e. `$::fqdn`.\n\n#### `puppetdb_port`\n\nThe port that the PuppetDB server is running on. Defaults to `8081`.\n\n#### `puppetdb_disable_ssl`\n\nIf true, use plain HTTP to talk to PuppetDB. Defaults to the value of\n`disable_ssl` if PuppetDB is on the same server as the Puppet Master, or else\nfalse. If you set this, you probably need to set `puppetdb_port` to match the HTTP\nport of the PuppetDB.\n\n#### `puppetdb_soft_write_failure`\n\nBoolean to fail in a soft manner if PuppetDB is not accessible for command\nsubmission Defaults to `false`.\n\n#### `manage_routes`\n\nIf `true`, the module will overwrite the Puppet master's routes file to\nconfigure it to use PuppetDB. Defaults to `true`.\n\n#### `manage_storeconfigs`\n\nIf `true`, the module will manage the Puppet master's storeconfig settings.\nDefaults to `true`.\n\n#### `manage_report_processor`\n\nIf `true`, the module will manage the 'reports' field in the puppet.conf file to\nenable or disable the PuppetDB report processor. Defaults to `false`.\n\n#### `manage_config`\n\nIf `true`, the module will store values from `puppetdb_server` and `puppetdb_port`\nparameters in the PuppetDB configuration file. If `false`, an existing PuppetDB\nconfiguration file will be used to retrieve server and port values.\n\n#### `create_puppet_service_resource`\n\nIf `true`, AND if `restart_puppet` is true, then the module will create a service\nresource for `puppet_service_name` if it has not been defined. Defaults to `true`.\nIf you are already declaring the `puppet_service_name` service resource in another\npart of your code, setting this to `false` will avoid creation of that service\nresource by this module, avoiding potential duplicate resource errors.\n\n#### `strict_validation`\n\nIf `true`, the module will fail if PuppetDB is not reachable, otherwise it will\npreconfigure PuppetDB without checking.\n\n#### `enable_reports`\n\nIgnored unless `manage_report_processor` is `true`, in which case this setting\nwill determine whether or not the PuppetDB report processor is enabled (`true`)\nor disabled (`false`) in the puppet.conf file.\n\n#### `enable_storeconfigs`\n\nIgnored unless `manage_storeconfigs` is `true`, in which case this setting\nwill determine whether or not client configuration storage is enabled (`true`)\nor disabled (`false`) in the puppet.conf file.\n\n#### `puppet_confdir`\n\nPuppet's config directory. Defaults to `/etc/puppet`.\n\n#### `puppet_conf`\n\nPuppet's config file. Defaults to `/etc/puppet/puppet.conf`.\n\n#### `masterless`\n\nA boolean switch to enable or disable the masterless setup of PuppetDB. Defaults\nto `false`.\n\n#### `terminus_package`\n\nName of the package to use that represents the PuppetDB terminus code. Defaults\nto `puppetdb-termini`, when `puppetdb_version` is set to `<= 2.3.x` the default\nchanges to `puppetdb-terminus`.\n\n#### `puppet_service_name`\n\nName of the service that represents Puppet. You can change this to `apache2` or\n`httpd` depending on your operating system, if you plan on having Puppet run\nusing Apache/Passenger for example.\n\n#### `puppetdb_startup_timeout`\n\nThe maximum amount of time that the module should wait for PuppetDB to start up.\nThis is most important during the initial install of PuppetDB (defaults to 15\nseconds).\n\n#### `restart_puppet`\n\nIf `true`, the module will restart the Puppet master when PuppetDB configuration\nfiles are changed by the module. Defaults to `true`. If set to `false`, you\nmust restart the service manually in order to pick up changes to the config\nfiles (other than `puppet.conf`).\n\n### puppetdb::database::postgresql\n\nThe `puppetdb::database::postgresql` class manages a PostgreSQL server for use\nby PuppetDB. It can manage the PostgreSQL packages and service, as well as\ncreating and managing the PuppetDB database and database user accounts.\n\n class { 'puppetdb::database::postgresql':\n listen_addresses => 'my.postgres.host.name',\n }\n\n#### `listen_addresses`\n\nThe `listen_address` is a comma-separated list of hostnames or IP addresses on\nwhich the postgres server should listen for incoming connections. This defaults\nto `localhost`. This parameter maps directly to PostgreSQL's `listen_addresses`\nconfig option. Use a `*` to allow connections on any accessible address.\n\n#### `database_name`\n\nSets the name of the database. Defaults to `puppetdb`.\n\n#### `database_username`\n\nCreates a user for access the database. Defaults to `puppetdb`.\n\n#### `database_password`\n\nSets the password for the database user above. Defaults to `puppetdb`.\n\n#### `manage_server`\n\nConditionally manages the PostgreSQL server via `postgresql::server`. Defaults\nto `true`. If set to `false`, this class will create the database and user via\n`postgresql::server::db` but not attempt to install or manage the server itself.\n\n#### `test_url`\n\nThe URL to use for testing if the PuppetDB instance is running. Defaults to\n`/pdb/meta/v1/version`.\n\n#### `manage_package_repo`\n\nIf `true`, the official postgresql.org repo will be added and postgres won't\nbe installed from the regular repository. Defaults to `true`.\n\n#### `postgres_version`\n\nIf the postgresql.org repo is installed, you can install several versions of\npostgres. Defaults to `9.6` in module version 6.0+ and `9.4` in older versions.\n\nImplementation\n---------------\n\n### Resource overview\n\nIn addition to the classes and variables mentioned above, PuppetDB includes:\n\n**puppetdb::master::routes**\n\nConfigures the Puppet master to use PuppetDB as the facts terminus. *WARNING*:\nthe current implementation simply overwrites your routes.yaml file; if you have\nan existing routes.yaml file that you are using for other purposes, you should\n*not* use this.\n\n class { 'puppetdb::master::routes':\n puppet_confdir => '/etc/puppet'\n }\n\nThe optional parameter routes can be used to specify a custom route\nconfiguration. For example to configure routes for masterless puppet.\n\n class { 'puppetdb::master::routes':\n routes => {\n 'apply' => {\n 'facts' => {\n 'terminus' => 'facter',\n 'cache' => 'puppetdb_apply',\n }\n }\n }\n }\n\n**puppetdb::master::storeconfigs**\n\nConfigures the Puppet master to enable storeconfigs and to use PuppetDB as the\nstoreconfigs backend.\n\n class { 'puppetdb::master::storeconfigs':\n puppet_conf => '/etc/puppet/puppet.conf'\n }\n\n**puppetdb::server::validate_db**\n\nValidates that a successful database connection can be established between the\nnode on which this resource is run and the specified PuppetDB database instance\n(host/port/user/password/database name).\n\n puppetdb::server::validate_db { 'validate my puppetdb database connection':\n database_host => 'my.postgres.host',\n database_username => 'mydbuser',\n database_password => 'mydbpassword',\n database_name => 'mydbname',\n }\n\n### Custom Types\n\n**puppetdb_conn_validator**\n\nVerifies that a connection can be successfully established between a node and\nthe PuppetDB server. Its primary use is as a precondition to prevent\nconfiguration changes from being applied if the PuppetDB server cannot be\nreached, but it could potentially be used for other purposes such as monitoring.\n\nLimitations\n------------\n\nCurrently, PuppetDB is compatible with:\n\n Puppet Version: 4.10+\n\nPlatforms:\n* EL 5, 6, 7\n* Debian 6, 7\n* Ubuntu 10.04, 12.04, 14.04\n\nCommunity Maintained Platforms:\n* Archlinux\n* OpenBSD 5.6-current and newer\n* SLES 11 SP1\n\nDevelopment\n------------\n\nPuppet Labs modules on the Puppet Forge are open projects, and community\ncontributions are essential for keeping them great. We can’t access the huge\nnumber of platforms and myriad of hardware, software, and deployment\nconfigurations that Puppet is intended to serve.\n\nWe want to keep it as easy as possible to contribute changes so that our modules\nwork in your environment. There are a few guidelines that we need contributors\nto follow so that we can have a chance of keeping on top of things.\n\nYou can read the complete [contribution guide](https://github.com/puppetlabs/.github/blob/master/CONTRIBUTING.md).\n", + "changelog": "## puppetlabs-puppetdb changelog\n\nRelease notes for the puppetlabs-puppetdb module.\n\n#### 7.10.0 - 2021/12/16\n* Add support for Debian 11\n* Allow puppetlabs/stdlib 8.0.0\n* Default to PostgreSQL 11 when using PuppetDB 7.0.0 or later\n* Update minimum version of puppetlabs/postgresql module to 6.5.0\n\n#### 7.9.0 - 2021/06/23\n\n* When `manage_database` is true, it will create a read-only user in postgres\n and configure PuppetDB to use that user for its read-database connection\n pool\n* Update module dependencies for inifile, firewall, and stdlib\n\n#### 7.8.0 - 2021/03/25\n\n* Added an option `postgresql_ssl_on` to enable an SSL connection between\n PostgreSQL and PuppetDB using Puppet agent certificates to verify the\n connection and authorize PuppetDB to access the puppetdb database.\n* Update our metadata to allow puppetlabs-postgresql 7 (this fixes an issue on el8)\n\n#### 7.7.1 - 2020/12/15\n\n* When using Puppet 7 or newer, the connection validator will use the new HTTP\n client. This removes a deprecation warning in the agent output.\n\n#### 7.7.0 - 2020/11/05\n\n* When applied to a node running puppet `7.0.0` or newer, the\n `puppetdb::master::config` class will default to the `json` fact cache. See\n [PUP-10656](https://tickets.puppetlabs.com/browse/PUP-10656) for more\n information.\n\n#### 7.6.0 - 2020/09/02\n\n* Added `migrate` parameter to manage the database.ini config option\n* Added Ubuntu 20.04 LTS as a supported platform\n\n#### 7.5.0 - 2020/06/10\n\n* Added `java_bin` parameter to set the full path to the java bin\n* Added `node_purge_gc_batch_limit` parameter\n* Added `facts_blacklist` parameter to manage the database.ini config option\n* Added `manage_db_password` and `manage_read_db_password` parameters\n* Updated functions to use puppet4 functions\n* Added `enable_storeconfigs` parameter, specifies whether or not the manage the master's storeconfigs (default: `true`)\n\n#### 7.4.0 - 2019/06/14\n\nThis is a minor feature release.\n\nDetailed changes:\n* Add the `manage_database` parameter to skip database and extension creation\n\n#### 7.3.0 - 2019/06/14\n\nThis is a minor feature release.\n\nDetailed changes:\n* Update module dependencies for firewall and stdlib\n\n#### 7.2.0 - 2019/05/17\n\nThis is a minor feature release.\n\nDetailed changes:\n* Update module dependencies for inifile and PostgreSQL\n\n#### 7.1.0 - 2018/10/02\n\nThis is a minor feature release.\n\nDetailed changes:\n* Fix issue with DLO path default being hardcoded\n* Update module dependencies to allow compatibility with Puppet 6\n\n------------------------------------------\n\n#### 7.0.1 - 2018/07/30\n\nThis is a minor bugfix release.\n\nDetailed changes:\n* Update the upper bound of required puppet version in metadata.json (Thanks @ekohl!)\n\n------------------------------------------\n\n#### 7.0.0 - 2018/06/27\n\nThis is a major release that replaces validate_* methods with data types.\nThe minimum required version of puppetlabs/stdlib has been bummped to 4.13.1\nin order to get the new data types. Thanks very much to @bastelfreak for your\nsubmissions!\n\nDetailed changes:\n* Require puppetlabs/stdlib >= 4.13.1\n* Bump puppet-lint to version 2\n* Bump minimal recommended puppet4 version to 4.7.1\n* Replace uses of validate_* methods in favor of data types (Thanks @bastelfreak!)\n* Add data type for ttl (Thanks @bastelfreak!)\n* Update list of supported platforms\n* Retire the previously deprecated `database_ssl` and `read_database_ssl` params in favor of `jdbc_ssl_properties` and `read_database_jdbc_ssl_properties`\n\n------------------------------------------\n\n#### 6.0.2 - 2017/11/06\n\nThis is a minor bugfix release.\n\nDetailed changes:\n\n * Update the upper bound of the puppetlabs inifile dependency\n * Explicitly add database dependency in the PostgreSQL manifest (Thanks @pgassmann!)\n\n------------------------------------------\n\n#### 6.0.1 - 2017/06/05\n\nThis is a minor bugfix release.\n\nDetailed changes:\n\n* Update the required puppet version in metadata.json\n\n------------------------------------------\n\n#### 6.0.0 - 2017/06/05\n\nThis is a major release to support PuppetDB 5.0. Note that the default\nPostgreSQL version is now 9.6, the minimum required by PuppetDB 5.0. If you're\nrunning an older version, be sure to explicitly specifying it when upgrading the\nmodule so it doesn't get upgraded out from under you.\n\nDetailed changes:\n\n* Require Puppet >= 4.7\n* If unspecified, install PostgreSQL version 9.6\n* Default node-ttl and node-purge ttl to 7 days and 14 days, respectively.\n* Support puppetlabs-postgresql version 5.x (Thanks @dhollinger!)\n* Add create_service_resource param to avoid duplicate resource\n errors in some situations. (Thanks @kpaulisse!)\n* Configure the master service as 'enabled' when it is automatically added\n (Thanks @tampakrap!)\n* Add concurrent_writes parameter (Thanks @aperiodic!)\n* Add cipher_suites option to configure jetty's SSL support (Thanks @selyx!)\n* Add support for Ruby 2.3.1 (Thanks @ghoneycutt!)\n* Specify mode of routes.yaml (Thanks @tampakrap!)\n* Add [read_]database_max_pool_size parameter (Thanks @kpaulisse and @vine77!)\n* Fix user/group names on OpenBSD (Thanks @buzzdeee!)\n* Enforce permissions of managed ini files (Thanks @kbarber!)\n* Manage the pg_trgm database extension (Thanks @PascalBourdier!)\n* Default open_ssl_listen_port to undef instead of true (Thanks @mmckinst!)\n\n\n------------------------------------------\n\n#### 5.1.2 - 2016/03/14\n\nThis is a minor bugfix release.\n\nDetailed changes:\n\n* Support RHEL upgrades from the `puppetdb-terminus` (<= PuppetDB 2) to the\n`puppetdb-termini` (>= PuppetDB 3).\n\n------------------------------------------\n\n#### 5.1.1 - 2016/02/09\n\nThis is a minor bugfix release.\n\nDetailed changes:\n\n* Revert a change to 'puppetdb-terminus' installation process that occurred in\nthe last release.\n\n------------------------------------------\n\n#### 5.1.0 - 2016/02/09\n\nThis is a minor feature release.\n\nDetailed changes:\n\n* Use 'puppetdb-terminus' as the terminus package on RHEL, to avoid packaging\n conflicts that could occur on upgrades from 2.x to 3.x. The\n 'puppetdb-terminus' version 3.x package on RHEL will install\n 'puppetdb-termini' as a dependency.\n* Add jdbc_ssl_properties parameter.\n* Pass 'dport' parameter to puppetlabs/firewall instead of the deprecated 'port'.\n* Pass database_port parameter to the postgresql class.\n* Manage the puppetdb vardir.\n* Allow default java_args to be overridden.\n* Linting fixes.\n\n------------------------------------------\n\n#### 5.0.0 - 2015/07/08\n\nThis is a major release to provide default support for PuppetDB 3.0.0, so\nlots of changes have been introduced. Ensure you read the upgrade guide\nprovided in the README before upgrading to this release.\n\nDetailed changes:\n\n* Packaging paths by default favour the PDB 3.0.0 AIO paths now.\n* Added legacy handling for old terminus & service versions (see upgrade guide\n in README for details)\n* PDB 3.0.0 introduces new pathing for the API requests, so all the defaults\n for this module are switched to use that now.\n* Support for Puppet 4 added.\n* manage_pg_repo is now on by default when using the puppetlabs/postgresql module,\n as PDB 3.0.0 supports only 9.4. This enables the use of the upstream PGDG\n PostgreSQL repos for all distros to obtain a working version of 9.4. The\n option can be disabled if required.\n* Default ssl-host is now 0.0.0.0\n\n------------------------------------------\n\n#### 4.3.0 - 2015/06/10\n\nThis is a minor feature release.\n\nDetailed changes:\n\n* Feature: Provide `database_embedded_path` option for overriding HSQLDB file path.\n* Feature: Add ability to manage `command_threads`, `store_usage` and `temp_usage`.\n* Bug: allow database_validation to be false\n* Bug: Fix ordering issues with read_database_ini\n* Testing: Fix file_concat dependency and fix rspec warnings\n\n------------------------------------------\n\n#### 4.2.1 - 2015/04/07\n\nThis is a minor bugfix release.\n\nDetailed Changes:\n\n* Ignore `._foo` files when building the `.tar.gz` of the module.\n\n------------------------------------------\n\n#### 4.2.0 - 2015/04/02\n\nThis is a minor feature release.\n\nDetailed Changes:\n\n* Added Puppet 4 compatibility by introspecting the value for `$puppet_confdir`.\n* Added `masterless` param switch to enable or disable the masterless setup of PuppetDB.\n* Added `manage_package_repo` param which will setup the official PostgreSQL repositories on your host.\n* Added FreeBSD support.\n* The puppetdb service now restarts if the certificates change.\n* `manage_firewall` and `ssl_protocols` are now configurable through the top-level puppetdb class.\n* Show the puppetdb server URI scheme in connection errors.\n* `test_url` param is now properly passed from the resource to the provider.\n* Removed dead PE code and unused variables from the module.\n* New parameter `puppetdb_disable_ssl` to enable validation to use cleartext.\n* Database validation is now optional via the `database_validate` and `read_database_validate` params.\n* Documentation updates to the README and metadata.json.\n\n------------------------------------------\n\n#### 4.1.0 - 2014/11/13\n\nThis is a minor feature release.\n\nDetailed Changes:\n\n* New capabilities added for installing SSL certificates and keys.\n* New parameter `puppetdb_disable_ssl` to enable validation to use cleartext.\n* `ssl_protocols` now provided to allow users to fine tune what protocols they want to support for PuppetDB.\n* Lots of documentation and parameter cleanups, to ensure consistency.\n* test_url is now supported for `puppetdb::master::config` to allow the URL one uses to be overridden.\n* Corrected PE detection support.\n* Correct the path for HSQLDB to use /var/lib/puppetdb/db instead of /usr/share/puppetdb/db as is standard in PuppetDB core.\n\n------------------------------------------\n\n#### 4.0.0 - 2014/09/16\n\nFor this release, all dependency versions have been bumped to their latest.\n\nDetailed Changes:\n\n* The PuppetDB module now only supports Puppet 3.7.1 or later\n* 'puppetlabs/postgresql' 4.0.0 or later is now required\n* 'puppetlabs/inifile' 1.1.3 or later is now required\n* 'puppetlabs/firewall' 1.1.3 or later is now required\n* 'puppetlabs/stdlib' 4.2.2 or later is now required\n* The parameter `manage_firewall` for the class `puppetdb::database::postgresql` has now been removed, since the postgresql module no longer supports this.\n* The parameter `open_postgres_port` for the class `puppetdb` has also been removed, due to postgresql changes.\n\n------------------------------------------\n\n#### 3.0.1 - 2014/02/11\n\nThis release contains only minor bug fixes.\n\nDetailed Changes:\n\n* Add missing PUBLISHER_LOGIN variable for auto-publish. (Ashley Penney)\n* fix validation regular expressions for time configs (Scott Duckworth)\n* update ripienaar/concat -> puppetlabs/concat (Joshua Hoblitt)\n* Fix issue with validator when disable_ssl = true (Elliott Barrere)\n* Enable soft_write_failure setting when $puppetdb::disablessl = true (Elliott Barrere)\n* Support rspec-puppet v1.0.0 (Garrett Honeycutt)\n* Pin rspec-puppet to 1.x releases (Ken Barber)\n* Define parameter in puppetdb class to define postgres listen address (Adrian Lopez)\n* Enable fast finish in Travis (Garrett Honeycutt)\n* Convert tests to beaker (Ashley Penney)\n* Use the /v2 metrics endpoint instead of /metrics (Ken Barber)\n\n------------------------------------------\n\n#### 3.0.0 - 2013/10/27\n\nThis major release changes the main dependency for the postgresql module from\nversion 2.5.x to 3.x. Since the postgresql module is not backwards compatible,\nthis release is also not backwards compatible. As a consequence we have taken\nsome steps to deprecate some of the older functionality:\n\n* The parameter manage_redhat_firewall for the class puppetdb has now been removed completely in favor of open_postgres_port and open_ssl_listen_port.\n* The parameter manage_redhat_firewall for the class puppetdb::database::postgresql, has now been renamed to manage_firewall.\n* The parameter manage_redhat_firewall for the class puppetdb::server has now been removed completely in favor of open_listen_port and open_ssl_listen_port.\n* The internal class: puppetdb::database::postgresql_db has been removed. If you were using this, it is now defunct.\n* The class puppetdb::server::firewall has been marked as private, do not use it directly.\n* The class puppetdb::server::jetty_ini and puppetdb::server::database_ini have been marked as private, do not use it directly.\n\nAll of this is documented in the upgrade portion of the README.\n\nAdditionally some features have been included in this release as well:\n\n* soft_write_failure can now be enabled in your puppetdb.conf with this\n module to handle failing silently when your PuppetDB is not available\n during writes.\n* There is a new switch to enable SSL connectivity to PostgreSQL. While this\n functionality is only in its infancy this is a good start.\n\nDetailed Changes:\n\n* FM-103: Add metadata.json to all modules. (Ashley Penney)\n* Add soft_write_failure to puppetdb.conf (Garrett Honeycutt)\n* Add switch to configure database SSL connection (Stefan Dietrich)\n* (GH-91) Update to use rspec-system-puppet 2.x (Ken Barber)\n* (GH-93) Switch to using puppetlabs-postgresql 3.x (Ken Barber)\n* Fix copyright and project notice (Ken Barber)\n* Adjust memory for PuppetDB tests to avoid OOM killer (Ken Barber)\n* Ensure ntpdate executes early during testing (Ken Barber)\n\n------------------------------------------\n\n#### 2.0.0 - 2013/10/04\n\nThis major release changes the main dependency for the inifile module from\nthe deprecated `cprice404/inifile` to `puppetlabs/inifile` to remove\ndeprecation warnings and to move onto the latest and greatest implementation\nof that code.\n\nIts a major release, because it may affect other dependencies since modules\ncannot have overlapping second part dependencies (that is inifile cannot be from\ntwo different locations).\n\nIt also adds the parameter `puppetdb_service_status` to the class `puppetdb` to\nallow users to specify whether the module manages the puppetdb service for you.\n\nThe `database_password` parameter is now optional, and initial Arch Linux\nsupport has been added.\n\nDetailed Changes:\n\n* (GH-73) Switch to puppetlabs/inifile from cprice/inifile (Ken Barber)\n* Make database_password an optional parameter (Nick Lewis)\n* add archlinux support (Niels Abspoel)\n* Added puppetdb service control (Akos Hencz)\n\n------------------------------------------\n\n#### 1.6.0 - 2013/08/07\n\nThis minor feature release provides extra parameters for new configuration\nitems available in PuppetDB 1.4, and also provides some older parameters\nthat were missed previously:\n\n* gc_interval\n* log_slow_statements\n* conn_max_age\n* conn_keep_alive\n* conn_lifetime\n\nConsult the README.md file, or the PuppetDB documentation for more details.\n\n------------------------------------------\n\n#### 1.5.0 - 2013/07/18\n\nThis minor feature release provides the following new functionality:\n\n* The module is now capable of managing PuppetDB on SUSE systems\n for which PuppetDB packages are available\n* The ruby code for validating the PuppetDB connection now\n supports validating on a non-SSL HTTP port.\n\n------------------------------------------\n\n#### 1.4.0 - 2013/05/13\n\nThis feature release provides support for managing the puppetdb report\nprocessor on your master.\n\nTo enable the report processor, you can do something like this:\n\n class { 'puppetdb::master::config':\n manage_report_processor => true,\n enable_reports => true\n }\n\nThis will add the 'puppetdb' report processor to the list of `reports`\ninside your master's `puppet.conf` file.\n\n------------------------------------------\n\n#### 1.3.0 - 2013/05/13\n\nThis feature release provides us with a few new features for the PuppetDB\nmodule.\n\nYou can now disable SSL when using the `puppetdb` class by using the new\nparameter `disable_ssl`:\n\n class { 'puppetdb':\n disable_ssl => true,\n }\n\nThis will remove the SSL settings from your `jetty.ini` configuration file\ndisabling any SSL communication. This is useful when you want to offload SSL\nto another web server, such as Apache or Nginx.\n\nWe have now added an option `java_args` for passing in Java options to\nPuppetDB. The format is a hash that is passed in when declaring the use of the\n`puppetdb` class:\n\n class { 'puppetdb':\n java_args => {\n '-Xmx' => '512m',\n '-Xms' => '256m',\n }\n }\n\nAlso, the default `report-ttl` was set to `14d` in PuppetDB to align it with an\nupcoming PE release, so we've also reflected that default here now.\n\nAnd finally we've fixed the issue whereby the options `report_ttl`, `node_ttl`,\n`node_purge_ttl` and `gc_interval` were not making the correct changes. On top\nof that you can now set these values to zero in the module, and the correct\ntime modifier (`s`, `m`, `h` etc.) will automatically get applied for you.\n\nBehind the scenes we've also added system and unit testing, which was\npreviously non-existent. This should help us reduce regression going forward.\n\nThanks to all the contributing developers in the list below that made this\nrelease possible :-).\n\n#### Changes\n\n* Allows for 0 _ttl's without time signifier and enables tests (Garrett Honeycutt)\n* Add option to disable SSL in Jetty, including tests and documentation (Christian Berg)\n* Cleaned up ghoneycutt's code a tad (Ken Barber)\n* the new settings report_ttl, node_ttl and node_purge_ttl were added but they are not working, this fixes it (fsalum)\n* Also fix gc_interval (Ken Barber)\n* Support for remote puppetdb (Filip Hrbek)\n* Added support for Java VM options (Karel Brezina)\n* Add initial rspec-system tests and scaffolding (Ken Barber)\n\n------------------------------------------\n\n#### 1.2.1 - 2013/04/08\n\nThis is a minor bugfix that solves the PuppetDB startup exception:\n\n java.lang.AssertionError: Assert failed: (string? s)\n\nThis was due to the default `node-ttl` and `node-purge-ttl` settings not having a time suffix by default. These settings required 's', 'm', 'd' etc. to be suffixed, even if they are zero.\n\n#### Changes\n\n* (Ken Barber) Add 's' suffix to period settings to avoid exceptions in PuppetDB\n\n------------------------------------------\n\n#### 1.2.0 - 2013/04/05\n\nThis release is primarily about providing full configuration file support in the module for PuppetDB 1.2.0. (The alignment of version is a coincidence I assure you :-).\n\nThis feature release adds the following new configuration parameters to the main `puppetdb` class:\n\n* node_ttl\n* node_purge_ttl (available in >=1.2.0)\n* report_ttl\n\nConsult the README for futher details about these new configurable items.\n\n##### Changes\n\n* (Nick Lewis) Add params and ini settings for node/purge/report ttls and document them\n\n------------------------------------------\n\n1.1.5\n=====\n\n2013-02-13 - Karel Brezina\n * Fix database creation so database_username, database_password and\n database_name are correctly passed during database creation.\n\n2013-01-29 - Lauren Rother\n * Change README to conform to new style and various other README improvements\n\n2013-01-17 - Chris Price\n * Improve documentation in init.pp\n\n------------------------------------------\n\n1.1.4\n=====\n\nThis is a bugfix release, mostly around fixing backward-compatibility for the\ndeprecated `manage_redhat_firewall` parameter. It wasn't actually entirely\nbackwards-compatible in the 1.1.3 release.\n\n2013-01-17 - Chris Price \n * Fix backward compatibility of `manage_redhat_firewall` parameter (de20b44)\n\n2013-01-16 - Chris Price \n * Fix deprecation warnings around manage_redhat_firewall (448f8bc)\n\n------------------------------------------\n\n1.1.3\n=====\n\nThis is mostly a maintenance release, to update the module dependencies to newer\nversions in preparation for some new features. This release does include some nice\nadditions around the ability to set the listen address for the HTTP port on Jetty\nand manage the firewall for that port. Thanks very much to Drew Blessing for those\nsubmissions!\n\n2013-01-15 - Chris Price \n * Update Modulefile for 1.1.3 release (updates dependencies\n on postgres and inifile modules to the latest versions) (76bfd9e)\n\n2012-12-19 - Garrett Honeycutt \n * (#18228) updates README for style (fd2e990)\n\n2012-11-29 - Drew Blessing \n * 17594 - Fixes suggested by cprice-puppet (0cf9632)\n\n2012-11-14 - Drew Blessing \n * Adjust examples in tests to include new port params (0afc276)\n\n2012-11-13 - Drew Blessing \n * 17594 - PuppetDB - Add ability to set standard host listen address and open firewall\n\n------------------------------------------\n\n1.1.2\n=====\n\n2012-10-26 - Chris Price (1.1.2)\n * 1.1.2 release\n\n2012-10-26 - Chris Price \n * Add some more missing `inherit`s for `puppetdb::params` (a72cc7c)\n\n2012-10-26 - Chris Price (1.1.2)\n * 1.1.1 release\n\n2012-10-26 - Chris Price (1.1.1)\n * Add missing `inherit` for `puppetdb::params` (ea9b379)\n\n2012-10-24 - Chris Price \n * 1.1.0 release\n\n2012-10-24 - Chris Price (1.1.0)\n * Update postgres dependency to puppetlabs/postgresql (bea79b4)\n\n2012-10-17 - Reid Vandewiele (1.1.0)\n * Fix embedded db setup in Puppet Enterprise (bf0ab45)\n\n2012-10-17 - Chris Price (1.1.0)\n * Update manifests/master/config.pp (b119a30)\n\n2012-10-16 - Chris Price (1.1.0)\n * Make puppetdb startup timeout configurable (783b595)\n\n2012-10-01 - Hunter Haugen (1.1.0)\n * Add condition to detect PE installations and provide different parameters (63f1c52)\n\n2012-10-01 - Hunter Haugen (1.1.0)\n * Add example manifest code for pe puppet master (a598edc)\n\n2012-10-01 - Chris Price (1.1.0)\n * Update comments and docs w/rt PE params (b5df5d9)\n\n2012-10-01 - Hunter Haugen (1.1.0)\n * Adding pe_puppetdb tests class (850e039)\n\n2012-09-28 - Hunter Haugen (1.1.0)\n * Add parameters to enable usage of enterprise versions of PuppetDB (df6f7cc)\n\n2012-09-23 - Chris Price \n * 1.0.3 release\n\n2012-09-23 - Chris Price \n * Add a parameter for restarting puppet master (179b337)\n\n2012-09-21 - Chris Price \n * 1.0.2 release\n\n2012-09-21 - Chris Price \n * Pass 'manage_redhat_firewall' param through to postgres (f21740b)\n\n2012-09-20 - Chris Price \n * 1.0.1 release\n\n2012-09-20 - Garrett Honeycutt \n * complies with style guide (1aab5d9)\n\n2012-09-19 - Chris Price \n * Fix invalid subname in database.ini (be683b7)\n\n2011-09-18 Chris Price - 1.0.0\n* Initial 1.0.0 release\n", + "license": "\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n", + "reference": null, + "malware_scan": null, + "tasks": [ + + ], + "plans": [ + + ], + "created_at": "2021-12-16 14:57:46 -0800", + "updated_at": "2021-12-16 14:58:44 -0800", + "deleted_at": null, + "deleted_for": null + }, + "releases": [ + { + "uri": "/v3/releases/puppetlabs-puppetdb-7.10.0", + "slug": "puppetlabs-puppetdb-7.10.0", + "version": "7.10.0", + "supported": false, + "created_at": "2021-12-16 14:57:46 -0800", + "deleted_at": null, + "file_uri": "/v3/files/puppetlabs-puppetdb-7.10.0.tar.gz", + "file_size": 42806 + }, + { + "uri": "/v3/releases/puppetlabs-puppetdb-7.9.0", + "slug": "puppetlabs-puppetdb-7.9.0", + "version": "7.9.0", + "supported": false, + "created_at": "2021-06-24 07:48:54 -0700", + "deleted_at": null, + "file_uri": "/v3/files/puppetlabs-puppetdb-7.9.0.tar.gz", + "file_size": 42773 + }, + { + "uri": "/v3/releases/puppetlabs-puppetdb-1.0.0", + "slug": "puppetlabs-puppetdb-1.0.0", + "version": "1.0.0", + "supported": false, + "created_at": "2012-09-19 16:51:22 -0700", + "deleted_at": null, + "file_uri": "/v3/files/puppetlabs-puppetdb-1.0.0.tar.gz", + "file_size": 16336 + } + ], + "feedback_score": 74, + "homepage_url": "http://github.com/puppetlabs/puppetlabs-puppetdb", + "issues_url": "https://tickets.puppetlabs.com/browse/PDB" + }, + { + "uri": "/v3/modules/saz-memcached", + "slug": "saz-memcached", + "name": "memcached", + "downloads": 2647652, + "created_at": "2011-11-20 13:40:08 -0800", + "updated_at": "2022-07-11 03:34:55 -0700", + "deprecated_at": null, + "deprecated_for": null, + "superseded_by": null, + "supported": false, + "endorsement": null, + "module_group": "base", + "owner": { + "uri": "/v3/users/saz", + "slug": "saz", + "username": "saz", + "gravatar_id": "d24714d241768d79a194d73fc1bdf1ef" + }, + "premium": false, + "current_release": { + "uri": "/v3/releases/saz-memcached-8.1.0", + "slug": "saz-memcached-8.1.0", + "module": { + "uri": "/v3/modules/saz-memcached", + "slug": "saz-memcached", + "name": "memcached", + "deprecated_at": null, + "owner": { + "uri": "/v3/users/saz", + "slug": "saz", + "username": "saz", + "gravatar_id": "d24714d241768d79a194d73fc1bdf1ef" + } + }, + "version": "8.1.0", + "metadata": { + "name": "saz-memcached", + "version": "8.1.0", + "author": "saz", + "summary": "Manage memcached via Puppet", + "license": "Apache-2.0", + "source": "git://github.com/saz/puppet-memcached.git", + "project_page": "https://github.com/saz/puppet-memcached", + "issues_url": "https://github.com/saz/puppet-memcached/issues", + "description": "Manage memcached via Puppet", + "requirements": [ + { + "name": "puppet", + "version_requirement": ">= 6.1.0 < 8.0.0" + } + ], + "dependencies": [ + { + "name": "puppetlabs/stdlib", + "version_requirement": ">= 4.13.1 < 9.0.0" + }, + { + "name": "puppetlabs/firewall", + "version_requirement": ">= 0.1.0 < 4.0.0" + }, + { + "name": "puppet/systemd", + "version_requirement": ">= 2.10.0 < 4.0.0" + }, + { + "name": "puppet/selinux", + "version_requirement": ">= 3.2.0 < 4.0.0" + } + ], + "operatingsystem_support": [ + { + "operatingsystem": "RedHat", + "operatingsystemrelease": [ + "7", + "8", + "9" + ] + }, + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "7", + "8", + "9" + ] + }, + { + "operatingsystem": "OracleLinux", + "operatingsystemrelease": [ + "7" + ] + }, + { + "operatingsystem": "Scientific", + "operatingsystemrelease": [ + "7" + ] + }, + { + "operatingsystem": "Debian", + "operatingsystemrelease": [ + "9", + "10", + "11" + ] + }, + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "18.04", + "20.04", + "22.04" + ] + }, + { + "operatingsystem": "Windows" + }, + { + "operatingsystem": "FreeBSD" + } + ] + }, + "tags": [ + "debian", + "ubuntu", + "redhat", + "amazon", + "fedora", + "memcached", + "linux", + "centos" + ], + "supported": false, + "pdk": false, + "validation_score": 100, + "file_uri": "/v3/files/saz-memcached-8.1.0.tar.gz", + "file_size": 10996, + "file_md5": "aadf80fba5848909429eb002ee1927ea", + "file_sha256": "883d6186e91c2c3fed13ae2009c3aa596657f6707b76f1f7efc6203c6e4ae986", + "downloads": 841, + "readme": "# memached module for Puppet\n\n[![Build Status](https://github.com/saz/puppet-memcached/workflows/CI/badge.svg)](https://github.com/saz/puppet-memcached/actions?query=workflow%3ACI)\n\nManage memcached via Puppet\n\n## Show some love\nIf you find this module useful, send some bitcoins to 1Na3YFUmdxKxJLiuRXQYJU2kiNqA3KY2j9\n\n### Supported Puppet versions\n* Puppet >= 5\n* Last version supporting Puppet 3: v3.0.2\n\n## How to use\n\n```\nStarting with version 3.0.0, memcached will be listening on 127.0.0.1 only.\nThis should make setups more secure (e.g. if there are no firewall rules in place).\n\nTo change this behavior, you need to set listen_ip to '0.0.0.0'.\n```\n\n### Use roughly 90% of memory\n\n```ruby\n class { 'memcached': }\n```\n\n### Set a fixed memory limit in MB\n\n```ruby\n class { 'memcached':\n max_memory => 2048\n }\n```\n\n### Use 12% of available memory\n\n```ruby\n class { 'memcached':\n max_memory => '12%'\n }\n```\n\n### Install multiple memcached instances\n\nthe multiinstance support uses a systemd instance unit file. This will be placed\nat `/etc/systemd/system/memcached@.service`. It allows us to manage multiple\ninstances via the same unit file. To start a simple instance, you only need to\nknow the desired TCP port:\n\n```puppet\nmemcached::instance{'11222':}\n```\n\nthat's it! It will bind to localhost and listen to TCP port 11222. You might\nwant to tune the systemd limits, for example the number of file descriptors\n(LimitNOFILE) or the number of processes (LimitNPROC):\n\n```puppet\nmemcached::instance{'11222':\n limits => {\n 'LimitNOFILE' => 8192,\n 'LimitNPROC' => 16384,\n }\n}\n```\n\nAll systemd limits are documented in the [systemd documentation](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Process%20Properties).\n\nAnother usecase. Let's assume your name is Eric and you want to change the\nactual memcached parameters, for example to bind it to every interface:\n\n```puppet\nmemcached::instance{'11222':\n override_content => \"[Service]\\nEnvironment='LISTEN=-l 0.0.0.0'\",\n}\n```\n\nMaybe Eric also wants to override the cache size (the unit is MB):\n\n```puppet\nmemcached::instance{'11222':\n override_content => \"[Service]\\nEnvironment=CACHESIZE=4096\\n\",\n}\n```\n\nlast but not least, Eric might also want to override the maximum amount\nof connections (the default is 1024):\n\n```puppet\nmemcached::instance{'11222':\n override_content => \"[Service]\\nEnvironment=MAXCONN=4096\\n\",\n}\n```\n\nNow Eric wants to use all those three settings at the same time:\n\n```puppet\nmemcached::instance{'11222':\n override_content => \"[Service]\\nEnvironment=MAXCONN=4096\\nEnvironment=CACHESIZE=4096\\nEnvironment='LISTEN=-l 0.0.0.0'\\n\",\n}\n```\n\nInstead of passing a long string with multiple `\\n`, Eric can also put the\ncontent in a file and provide that:\n\n```puppet\nmemcached::instance{'11222':\n override_source => \"${module_name}/memcached_11222_override.conf\\n\",\n}\n```\n\n### Other class parameters\n\n* $package_ensure = 'present'\n* $logfile = '/var/log/memcached.log'\n* $logstdout = false (Set this to true to disable logging to a file/syslog entirely, useful when memcached runs in containers)\n* $pidfile = '/var/run/memcached.pid' (Debian family only, set to false to disable pidfile)\n* $max_memory = false\n* $max_item_size = false\n* $min_item_size = false\n* $factor = false\n* $lock_memory = false (WARNING: good if used intelligently, google for -k key)\n* $listen = '127.0.0.1' (if TLS/SSL is enabled, 'notls' prefix can be used to disable for specific listeners \"notls::\")\n* $listen_ip = '127.0.0.1' (deprecated, listen will take precedence over this)\n* $tcp_port = 11211\n* $udp_port = 0\n* $manage_firewall = false\n* $user = '' (OS specific setting, see params.pp)\n* $max_connections = 8192\n* $verbosity = undef\n* $unix_socket = undef\n* $install_dev = false (TRUE if 'libmemcached-dev' package should be installed)\n* $processorcount = $::processorcount\n* $service_restart = true (restart service after configuration changes, false to prevent restarts)\n* $use_sasl = false (start memcached with SASL support)\n* $use_tls = false (start memcached with TLS support)\n* $tls_cert_chain = undef\n* $tls_key = undef\n* $tls_ca_cert = undef\n* $tls_verify_mode = 1 (0: None, 1: Request, 2: Require, 3: Once)\n* $large_mem_pages = false (try to use large memory pages)\n", + "changelog": "# Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [8.1.0]\n### Added\n- Support for RedHat 9 and CentOS 9\n\n## [8.0.0]\n### Changed\n- BREAKING CHANGE: switch from camptocamp/systemd to puppet/systemd\n- Improved tests\n- Load modern facts first (#138)\n- Make sure memcached logfile exists (#140)\n- Allow stdlib < 9.0.0\n### Fixed\n- Fix duplicate systemd daemon-reload execs (#137)\n### Added\n- Added support for Debian 11 and Ubuntu 22.04\n\n## [7.0.0]\n### Changed\n- BREAKING CHANGE: Testing for Puppet 5 has been dropped\n- Switched from Travis to Github Actions\n- Dependencies updated to support the newest releases\n\n## [6.0.0]\n### Added\n- Add listen parameter as successor for listen_ip (#127)\n### Deprecated\n- listen_ip parameter is deprecated in favor of new listen parameter (#127)\n### Changed\n- Use camptocamp/systemd v2.12.0 for tests, as newer versions might drop support for puppet 5\n### Removed\n- Dropped notls_listener_addr and notls_listener_port parameter in favor of listen_ip (#128)\n\n## [5.0.0]\n### Added\n- Add sasl support on RHEL derivatives (#122)\n- Add notls_listener_addr and notls_listener_port parameters (#124)\n### Changed\n- BREAKING CHANGE: Disable UDP by default (#125)\n If you need UDP enabled, set `memcached::udp_port` to a non-zero value, e.g. 11211\n\n## [4.0.0]\n### Added\n- Support management of multiple memcached instances (systemd required!) #120\n- Add FreeBSD to list of supported operatingsystems\n### Removed\n- Drop support for Puppet 4 (EOL) #116\n\n## [3.7.0]\n### Added\n- Add support to set TLS parameters in /etc/sysconfig/memcached (#113)\n### Fixed\n- Make ssl_ca_cert optional (#112)\n\n## [3.6.0]\n### Added\n- Add TLS support (#109)\n\n## [3.5.0]\n### Fixed\n- allow FreeBSD to set max memory (#104)\n### Changed\n- Dependencies updated (#107)\n- Better FreeBSD tests\n\n## [3.4.0]\n### Fixed\n- factor should be a string or number, not boolean\n### Added\n- Add Puppet 6 to travis checks\n### Changed\n- Update Puppet version requirement to include version 6 (< 7.0.0)\n- Unpin firewall module in fixtures\n- Require puppetlabs_spec_helper >= 2.11.0\n### Removed\n- Drop Ruby 2.1 from travis checks\n", + "license": " Copyright 2011-2016 Steffen Zieger\n Copyright 2014-2016 Garrett Honeycutt \n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n", + "reference": null, + "malware_scan": null, + "tasks": [ + + ], + "plans": [ + + ], + "created_at": "2022-07-11 03:34:55 -0700", + "updated_at": "2022-07-11 03:35:51 -0700", + "deleted_at": null, + "deleted_for": null + }, + "releases": [ + { + "uri": "/v3/releases/saz-memcached-8.1.0", + "slug": "saz-memcached-8.1.0", + "version": "8.1.0", + "supported": false, + "created_at": "2022-07-11 03:34:55 -0700", + "deleted_at": null, + "file_uri": "/v3/files/saz-memcached-8.1.0.tar.gz", + "file_size": 10996 + }, + { + "uri": "/v3/releases/saz-memcached-1.0.0", + "slug": "saz-memcached-1.0.0", + "version": "1.0.0", + "supported": false, + "created_at": "2011-11-20 13:40:30 -0800", + "deleted_at": null, + "file_uri": "/v3/files/saz-memcached-1.0.0.tar.gz", + "file_size": 2472 + } + ], + "feedback_score": 100, + "homepage_url": "https://github.com/saz/puppet-memcached", + "issues_url": "https://github.com/saz/puppet-memcached/issues" + } + ] +} diff --git a/swh/lister/puppet/tests/data/https_forgeapi.puppet.com/v3_modules,limit=100,offset=100 b/swh/lister/puppet/tests/data/https_forgeapi.puppet.com/v3_modules,limit=100,offset=100 new file mode 100644 --- /dev/null +++ b/swh/lister/puppet/tests/data/https_forgeapi.puppet.com/v3_modules,limit=100,offset=100 @@ -0,0 +1,190 @@ +{ + "pagination": { + "limit": 100, + "offset": 100, + "first": "/v3/modules?limit=100&offset=0", + "previous": "/v3/modules?limit=100&offset=0", + "current": "/v3/modules?limit=100&offset=100", + "next": null, + "total": 7301 + }, + "results": [ + { + "uri": "/v3/modules/electrical-file_concat", + "slug": "electrical-file_concat", + "name": "file_concat", + "downloads": 2293802, + "created_at": "2015-04-09 12:03:13 -0700", + "updated_at": "2016-12-28 20:00:02 -0800", + "deprecated_at": null, + "deprecated_for": null, + "superseded_by": null, + "supported": false, + "endorsement": null, + "module_group": "base", + "owner": { + "uri": "/v3/users/electrical", + "slug": "electrical", + "username": "electrical", + "gravatar_id": "46dbd1ee4484b8e993466bd2209858cf" + }, + "premium": false, + "current_release": { + "uri": "/v3/releases/electrical-file_concat-1.0.1", + "slug": "electrical-file_concat-1.0.1", + "module": { + "uri": "/v3/modules/electrical-file_concat", + "slug": "electrical-file_concat", + "name": "file_concat", + "deprecated_at": null, + "owner": { + "uri": "/v3/users/electrical", + "slug": "electrical", + "username": "electrical", + "gravatar_id": "46dbd1ee4484b8e993466bd2209858cf" + } + }, + "version": "1.0.1", + "metadata": { + "name": "electrical-file_concat", + "version": "1.0.1", + "author": "electrical", + "summary": "Library for concatenating different files into 1", + "license": "Apache License, Version 2.0", + "source": "https://github.com/electrical/puppet-lib-file_concat", + "project_page": "https://github.com/electrical/puppet-lib-file_concat", + "issues_url": "https://github.com/electrical/puppet-lib-file_concat/issues", + "operatingsystem_support": [ + { + "operatingsystem": "RedHat", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "OracleLinux", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "Scientific", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "SLES", + "operatingsystemrelease": [ + "10 SP4", + "11 SP1", + "12" + ] + }, + { + "operatingsystem": "Debian", + "operatingsystemrelease": [ + "6", + "7" + ] + }, + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "10.04", + "12.04", + "14.04" + ] + }, + { + "operatingsystem": "Solaris", + "operatingsystemrelease": [ + "10", + "11" + ] + } + ], + "requirements": [ + { + "name": "pe", + "version_requirement": "3.x" + }, + { + "name": "puppet", + "version_requirement": "3.x" + } + ], + "description": "Library for concatenating different files into 1", + "dependencies": [ + + ] + }, + "tags": [ + + ], + "supported": false, + "pdk": false, + "validation_score": 62, + "file_uri": "/v3/files/electrical-file_concat-1.0.1.tar.gz", + "file_size": 13335, + "file_md5": "74901a89544134478c2dfde5efbb7f14", + "file_sha256": "15e973613ea038d8a4f60bafe2d678f88f53f3624c02df3157c0043f4a400de6", + "downloads": 2291838, + "readme": "# puppet-lib-file_concat\n\n#### Table of Contents\n\n1. [Overview](#overview)\n2. [Usage - Configuration options and additional functionality](#usage)\n3. [Limitations - OS compatibility, etc.](#limitations)\n4. [Development - Guide for contributing to the module](#development)\n\n## Overview\n\nLibrary for concatenating multiple files into 1.\n\n## Usage\n\n### Creating a file fragment\n\nCreates a file fragment to be collected by file_concat based on the tag.\n\nExample with exported resource:\n\n @@file_fragment { \"uniqe_name_${::fqdn}\":\n tag => 'unique_tag', # Mandatory.\n order => 10, # Optional. Defaults to 10.\n content => 'some content' # OR\n content => template('template.erb') # OR\n source => 'puppet:///path/to/file'\n }\n\n### Concatenating file fragments into one file\n\nGets all the file fragments and puts these into the target file.\nThis will mostly be used with exported resources.\n\nexample:\n \n File_fragment <<| tag == 'unique_tag' |>>\n\n file_concat { '/tmp/file':\n tag => 'unique_tag', # Mandatory\n path => '/tmp/file', # Optional. If given it overrides the resource name.\n owner => 'root', # Optional. Defaults to undef.\n group => 'root', # Optional. Defaults to undef.\n mode => '0644' # Optional. Defaults to undef.\n order => 'numeric' # Optional. Set to 'numeric' or 'alpha'. Defaults to numeric.\n replace => true # Optional. Boolean Value. Defaults to true.\n backup => false # Optional. true, false, 'puppet', or a string. Defaults to 'puppet' for Filebucketing.\n }\n\n## Limitations\n\n## Development\n\n", + "changelog": "##1.0.1 ( Apr 17, 2015 )\n\n###Summary\nBugfix release\n\n####Features\n\n####Bugfixes\n* Fix windows support by not defaulting owner,group and mode values\n\n####Changes\n\n####Testing changes\n\n####Known bugs\n\n\n##1.0.0 ( Apr 09, 2015 )\n\n###Summary\nMajor release.\nThe module has been moved from the ispavailability account on Forge to elecrical.\n\n####Features\n* Major refactoring to enhance functionality\n* Re-use existing file resource to avoid code duplication\n* Make the module more compatiable with puppetlabs-concat\n* Support array of sources\n\n####Bugfixes\n\n####Changes\n\n####Testing changes\n* Add centos 7 acceptance testing\n* Add tests for user/group/mode options\n\n####Known bugs\n\n##0.3.0 ( Mar 26, 2015 )\n\n###Summary\nThis release adds windows support to the library.\n\n####Features\n* Added windows support to the library.\n\n####Bugfixes\n\n####Changes\n\n####Testing changes\n\n####Known bugs\n\n##0.2.1 ( Mar 25, 2015 )\n\n###Summary\nBugfix release\n\n####Features\n\n####Bugfixes\n* Fix a bug caused by some refactoring\n\n####Changes\n\n####Testing changes\n\n####Known bugs\n* Windows is not supported yet\n\n##0.2.0 ( Mar 25, 2015 )\n\n###Summary\nWith this release Ive done several code cleanups and added some basic tests.\nAlso support for puppet-server has been fixed\n\n####Features\n\n####Bugfixes\n* Remove unnecessary require which fixed support for puppet-server\n\n####Changes\n* Added some basic files\n* Implemented rubocop for style checking\n\n####Testing changes\n* Implemented basic acceptance tests\n\n####Known bugs\n* Windows is not supported yet\n\n##0.1.0 ( Jan 21, 2014 )\n Rewrite of the fragment ordering part.\n Fragments are now first ordered based on the order number and then on the resource name.\n Convert `order` parameter to string to support integer values when using Hiera/YAML ( PR#3 by Michael G. Noll )\n\n##0.0.2 ( Mar 03, 2013 )\n Adding source variable option to file_fragment type\n\n##0.0.1 ( Jan 13, 2013 )\n Initial release of the module\n", + "license": "Copyright (c) 2013-2015 Richard Pijnenbug \nCopyright (c) 2012 Simon Effenberg \nCopyright (c) 2012 Uwe Stuehler \n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n", + "reference": null, + "malware_scan": null, + "tasks": [ + + ], + "plans": [ + + ], + "created_at": "2015-04-17 01:03:46 -0700", + "updated_at": "2019-07-03 15:45:50 -0700", + "deleted_at": null, + "deleted_for": null + }, + "releases": [ + { + "uri": "/v3/releases/electrical-file_concat-1.0.1", + "slug": "electrical-file_concat-1.0.1", + "version": "1.0.1", + "supported": false, + "created_at": "2015-04-17 01:03:46 -0700", + "deleted_at": null, + "file_uri": "/v3/files/electrical-file_concat-1.0.1.tar.gz", + "file_size": 13335 + }, + { + "uri": "/v3/releases/electrical-file_concat-1.0.0", + "slug": "electrical-file_concat-1.0.0", + "version": "1.0.0", + "supported": false, + "created_at": "2015-04-09 12:03:13 -0700", + "deleted_at": null, + "file_uri": "/v3/files/electrical-file_concat-1.0.0.tar.gz", + "file_size": 13289 + } + ], + "feedback_score": null, + "homepage_url": "https://github.com/electrical/puppet-lib-file_concat", + "issues_url": "https://github.com/electrical/puppet-lib-file_concat/issues" + } + ] +} diff --git a/swh/lister/puppet/tests/test_lister.py b/swh/lister/puppet/tests/test_lister.py new file mode 100644 --- /dev/null +++ b/swh/lister/puppet/tests/test_lister.py @@ -0,0 +1,79 @@ +# Copyright (C) 2022 The Software Heritage developers +# See the AUTHORS file at the top-level directory of this distribution +# License: GNU General Public License version 3, or any later version +# See top-level LICENSE file for more information +from swh.lister.puppet.lister import PuppetLister + +expected_origins = { + "https://forge.puppet.com/modules/electrical/file_concat": { + "artifacts": { + "1.0.0": { + "url": "https://forgeapi.puppet.com/v3/files/electrical-file_concat-1.0.0.tar.gz", # noqa: B950 + "version": "1.0.0", + "filename": "electrical-file_concat-1.0.0.tar.gz", + "last_update": "2015-04-09T12:03:13-07:00", + }, + "1.0.1": { + "url": "https://forgeapi.puppet.com/v3/files/electrical-file_concat-1.0.1.tar.gz", # noqa: B950 + "version": "1.0.1", + "filename": "electrical-file_concat-1.0.1.tar.gz", + "last_update": "2015-04-17T01:03:46-07:00", + }, + } + }, + "https://forge.puppet.com/modules/puppetlabs/puppetdb": { + "artifacts": { + "1.0.0": { + "url": "https://forgeapi.puppet.com/v3/files/puppetlabs-puppetdb-1.0.0.tar.gz", # noqa: B950 + "version": "1.0.0", + "filename": "puppetlabs-puppetdb-1.0.0.tar.gz", + "last_update": "2012-09-19T16:51:22-07:00", + }, + "7.9.0": { + "url": "https://forgeapi.puppet.com/v3/files/puppetlabs-puppetdb-7.9.0.tar.gz", # noqa: B950 + "version": "7.9.0", + "filename": "puppetlabs-puppetdb-7.9.0.tar.gz", + "last_update": "2021-06-24T07:48:54-07:00", + }, + "7.10.0": { + "url": "https://forgeapi.puppet.com/v3/files/puppetlabs-puppetdb-7.10.0.tar.gz", # noqa: B950 + "version": "7.10.0", + "filename": "puppetlabs-puppetdb-7.10.0.tar.gz", + "last_update": "2021-12-16T14:57:46-08:00", + }, + } + }, + "https://forge.puppet.com/modules/saz/memcached": { + "artifacts": { + "1.0.0": { + "url": "https://forgeapi.puppet.com/v3/files/saz-memcached-1.0.0.tar.gz", # noqa: B950 + "version": "1.0.0", + "filename": "saz-memcached-1.0.0.tar.gz", + "last_update": "2011-11-20T13:40:30-08:00", + }, + "8.1.0": { + "url": "https://forgeapi.puppet.com/v3/files/saz-memcached-8.1.0.tar.gz", # noqa: B950 + "version": "8.1.0", + "filename": "saz-memcached-8.1.0.tar.gz", + "last_update": "2022-07-11T03:34:55-07:00", + }, + } + }, +} + + +def test_puppet_lister(datadir, requests_mock_datadir, swh_scheduler): + lister = PuppetLister(scheduler=swh_scheduler) + res = lister.run() + + assert res.pages == 2 + assert res.origins == 1 + 1 + 1 + + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results + + assert len(scheduler_origins) == len(expected_origins) + + for origin in scheduler_origins: + assert origin.visit_type == "puppet" + assert origin.url in expected_origins + assert origin.extra_loader_arguments == expected_origins[origin.url] diff --git a/swh/lister/puppet/tests/test_tasks.py b/swh/lister/puppet/tests/test_tasks.py new file mode 100644 --- /dev/null +++ b/swh/lister/puppet/tests/test_tasks.py @@ -0,0 +1,31 @@ +# Copyright (C) 2022 The Software Heritage developers +# See the AUTHORS file at the top-level directory of this distribution +# License: GNU General Public License version 3, or any later version +# See top-level LICENSE file for more information + +from swh.lister.pattern import ListerStats + + +def test_puppet_ping(swh_scheduler_celery_app, swh_scheduler_celery_worker): + res = swh_scheduler_celery_app.send_task("swh.lister.puppet.tasks.ping") + assert res + res.wait() + assert res.successful() + assert res.result == "OK" + + +def test_puppet_lister(swh_scheduler_celery_app, swh_scheduler_celery_worker, mocker): + # setup the mocked PuppetLister + lister = mocker.patch("swh.lister.puppet.tasks.PuppetLister") + lister.from_configfile.return_value = lister + stats = ListerStats(pages=42, origins=42) + lister.run.return_value = stats + + res = swh_scheduler_celery_app.send_task("swh.lister.puppet.tasks.PuppetListerTask") + assert res + res.wait() + assert res.successful() + assert res.result == stats.dict() + + lister.from_configfile.assert_called_once_with() + lister.run.assert_called_once_with()