{"id":15013905,"url":"https://github.com/voxpupuli/puppet-hocon","last_synced_at":"2025-10-06T07:30:38.594Z","repository":{"id":55403473,"uuid":"522999682","full_name":"voxpupuli/puppet-hocon","owner":"voxpupuli","description":"Puppet module for managing settings in HOCON-style configuration files","archived":true,"fork":true,"pushed_at":"2022-08-26T21:19:20.000Z","size":239,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T14:22:36.475Z","etag":null,"topics":["centos-puppet-module","debian-puppet-module","hacktoberfest","linux-puppet-module","oraclelinux-puppet-module","puppet","redhat-puppet-module","ubuntu-puppet-module"],"latest_commit_sha":null,"homepage":"https://forge.puppet.com/puppet/hocon","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"puppetlabs/puppetlabs-hocon","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voxpupuli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-09T15:09:36.000Z","updated_at":"2024-08-09T12:58:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/voxpupuli/puppet-hocon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-hocon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-hocon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-hocon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-hocon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voxpupuli","download_url":"https://codeload.github.com/voxpupuli/puppet-hocon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235413220,"owners_count":18986261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["centos-puppet-module","debian-puppet-module","hacktoberfest","linux-puppet-module","oraclelinux-puppet-module","puppet","redhat-puppet-module","ubuntu-puppet-module"],"created_at":"2024-09-24T19:44:55.029Z","updated_at":"2025-10-06T07:30:33.292Z","avatar_url":"https://github.com/voxpupuli.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-hocon.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-hocon)\n\n# HOCON file\n\n#### Table of Contents\n\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Overview](#overview)\n* [Module Description](#module-description)\n* [Setup](#setup)\n* [Beginning with hocon](#beginning-with-hocon)\n* [Usage](#usage)\n* [Reference](#reference)\n  * [Type: hocon_setting](#type-hocon_setting)\n    * [Parameters](#parameters)\n      * [`ensure`](#ensure)\n      * [`path`](#path)\n      * [`setting`](#setting)\n      * [`value`](#value)\n      * [`type`](#type)\n* [Development](#development)\n* [Contributors](#contributors)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Overview\n\nThis module adds resource types to manage settings in [HOCON-style](https://github.com/lightbend/config/blob/master/HOCON.md) configuration files.\n\n## Module Description\n\nThe hocon module adds a resource type so that you can use Puppet to manage settings in HOCON configuration files. If you would like to manage Puppet's auth.conf that is in the HOCON format see the [puppetlabs/puppet_authorization](https://github.com/puppetlabs/puppetlabs-puppet_authorization) module.\n\n## Setup\n\n## Beginning with hocon\n\nTo manage a HOCON file, add the resource type `hocon_setting` to a class.\n\n## Usage\n\nManage individual settings in HOCON files by adding the `hocon_setting` resource type to a class. For example:\n\n```puppet\nhocon_setting { \"sample setting\":\n  ensure  =\u003e present,\n  path    =\u003e '/tmp/foo.conf',\n  setting =\u003e 'foosetting',\n  value   =\u003e 'FOO!',\n}\n```\n\nTo control a setting nested within a map contained at another setting, provide the path to that setting\nunder the \"setting\" parameter, with each level separated by a \".\". So to manage `barsetting` in the following map\n\n```puppet\nfoo : {\n    bar : {\n        barsetting : \"FOO!\"\n    }\n}\n```\n\nYou would put the following in your manifest:\n\n```puppet\nhocon_setting {'sample nested setting':\n  ensure  =\u003e present,\n  path    =\u003e '/tmp/foo.conf',\n  setting =\u003e 'foo.bar.barsetting',\n  value   =\u003e 'BAR!',\n}\n```\n\nYou can also set maps like so:\n\n```puppet\nhocon_setting { 'sample map setting':\n  ensure  =\u003e present,\n  path    =\u003e '/tmp/foo.conf',\n  setting =\u003e 'hash_setting',\n  value   =\u003e { 'a' =\u003e 'b' },\n}\n```\n\nTo delete a top level key, you will need to specify both the key name and the\ntype of key.\n\n```puppet\nhocon_setting { 'delete top key':\n  ensure  =\u003e absent,\n  path    =\u003e '/tmp/foo.conf',\n  setting =\u003e 'array_key',\n  type    =\u003e 'array',\n```\n\n## Reference\n\n### Type: hocon_setting\n\n#### Parameters\n\n##### `ensure`\n\nEnsures that the resource is present. \n\nValues: 'present', 'absent'\n\nDefault: 'present'\n\n##### `path`\n\nThe HOCON file in which Puppet will ensure the specified setting.\n\nThis parameter, along with `setting`, is one of two namevars for the `hocon_setting` type, meaning that Puppet will give an error if two `hocon_setting` resources have the same `setting` and `path` parameters.\n\nValues: a path tring\n\nDefault: `undef`\n\n##### `setting`\n\nThe name of the HOCON file setting to be defined. This can be a top-level setting or a setting nested within another setting. To define a nested setting, give the full path to that setting with each level separated by a `.` So, to define a setting `foosetting` nested within a setting called `foo` contained on the top level, the `setting` parameter would be set to `foo.foosetting`. This parameter, along with `path`, is one of two namevars for the `hocon_setting` type, meaning that Puppet will give an error if two `hocon_setting` resources have the same `setting` and `path` parameters.\n\nIf no `setting` value is explicitly set, the title of the resource will be used as the value of `setting`.\n\nDefault: `namevar`\n\n##### `value`\n\nThe value of the HOCON file setting to be defined.\n\nDefault: `undef`\n\n##### `type`\n\nThe type of the value passed into the `value` parameter. This value should be a string, with valid values being `'number'`, `'boolean'`, `'string'`, `'hash'`, `'array'`, `'array_element'`, and `'text'`.\n\nThis parameter will not be need to be set most of the time, as the module is generally smart enough to figure this out on its own. There are only three cases in which this parameter is required.\n\nThe first is the case in which the `value` type is a single-element array. In that case, the `type` parameter will need to be set to `'array'`. So, for example, to add a single-element array, you would add the following to your manifest\n\n```\nhocon_setting { 'single array setting':\n  ensure =\u003e present,\n  path =\u003e '/tmp/foo.conf',\n  setting =\u003e 'foo',\n  value =\u003e [1],\n  type =\u003e 'array',\n}\n```\n\nIf you are trying to manage single entries in an array (for example, adding to an array from a define) you will need to set the `'type'` parameter to `'array_element'`. For example, to add to an existing array in the 'foo' setting, you can add the following to your manifest\n\n```\nhocon_setting { 'add to array':\n  ensure  =\u003e present,\n  path    =\u003e '/tmp/foo.conf',\n  setting =\u003e 'foo',\n  value   =\u003e 2,\n  type    =\u003e 'array_element',\n}\n```\n\nNote: When adding an item via 'array_element', the array must already exist in the HOCON file.\n\nSince this type represents a setting in a configuration file, you can pass a string containing the exact text of the value as you want it to appear in the file (this is useful, for example, if you want to set a parameter to a map or an array but want comments or specific indentation on elements in the map/array). In this case, `value` must be a string with no leading or trailing whitespace, newlines, or comments that contains a valid HOCON value, and the `type` parameter must be set to `'text'`. This is an advanced use case, and will not be necessary for most users. So, for example, say you want to add a map with particular indentation/comments into your configuration file at path `foo.bar`. You could create a variable like so \n\n```\n$map =\n\"{\n    # This is setting a\n    a : b\n    # This is setting c\n        c : d\n  }\"\n```\n\nAnd your configuration file looks like so\n\n```\nbaz : qux\nfoo : {\n  a : b\n}\n```\n\nYou could then write the following in your manifest\n\n```\nhocon_setting { 'exact text setting':\n  ensure =\u003e present,\n  path =\u003e '/tmp/foo.conf',\n  setting =\u003e 'foo.bar',\n  value =\u003e $map,\n  type =\u003e 'text',\n}\n```\n\nAnd the resulting configuration file would look like so\n\n```\nbaz : qux\nfoo : {\n  a : b\n  bar : {\n      # This is setting a\n      a : b\n      # This is setting c\n          c : d\n  }\n}\n```\n\nAside from these three cases, the `type` parameter does not need to be set.\n\n## Development\n\nPuppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.\n\nWe want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.\n\nYou can read the complete module contribution guide on the [Puppet Labs wiki](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing).\n\n## Contributors\n\nThe list of contributors can be found at: [https://github.com/puppetlabs/puppetlabs-hocon/graphs/contributors/contributors](https://github.com/puppetlabs/puppetlabs-hocon/graphs/contributors/contributors).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpupuli%2Fpuppet-hocon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoxpupuli%2Fpuppet-hocon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpupuli%2Fpuppet-hocon/lists"}