Skip to content

Instantly share code, notes, and snippets.

@iankronquist
Last active September 18, 2015 00:32
Show Gist options
  • Save iankronquist/cf2141a662bf1651bc9f to your computer and use it in GitHub Desktop.
Save iankronquist/cf2141a662bf1651bc9f to your computer and use it in GitHub Desktop.
Structured data for strings
{
"defined_types": [
{
"docstring": "Docstring",
"file": "manifests/defined_type.pp",
"line": 6,
"name": "bar",
"parameters": {
"barname": null,
"barval": null
},
"signatures": [
[
{
"name": "barname",
"type": "String"
},
{
"name": "barval",
"type": "Float"
}
]
]
}
],
"puppet_classes": [
{
"docstring": "Class: test\n\nThis class exists to serve as fixture data for testing the puppet strings face",
"file": "manifests/init.pp",
"line": 10,
"name": "test",
"parameters": {
"package_nameh": "$test::params::package_name",
"service_nameh": "$test::params::service_name"
},
"signatures": [
[
{
"name": "package_nameh",
"type": "Any"
},
{
"name": "service_nameh",
"type": "Any"
}
]
]
},
{
"docstring": "",
"file": "manifests/capitalization.pp",
"line": 1,
"name": "foo",
"parameters": {
"age": "10",
"ident": "\"Bob\""
},
"signatures": [
[
{
"name": "ident",
"type": "Mytype"
},
{
"name": "age",
"type": "Myint"
}
]
]
}
],
"puppet_functions": [
{
"docstring": "When given two numbers, returns the one that is larger.\nYou could have a several line description here if you wanted,\nbut I don't have much to say about this function.",
"documented_params": [
{
"name": "num_a",
"type": "Any"
},
{
"name": "num_b",
"type": "Any"
}
],
"file": "lib/test.rb",
"line": 12,
"name": "max",
"puppet_version": 4,
"signatures": [
[
{
"name": "num_a",
"type": "Any"
},
{
"name": "num_b",
"type": "Any"
}
]
]
},
{
"docstring": "When given two numbers, returns the one that is larger.\nYou could have a several line description here if you wanted,\nbut I don't have much to say about this function.",
"documented_params": [],
"file": "lib/test2.rb",
"line": 12,
"name": "min",
"puppet_version": 4,
"signatures": []
},
{
"docstring": "",
"documented_params": [
{
"name": "name",
"type": "'Variant[String,Array[String]]'"
},
{
"name": "value_type",
"type": "'Optional[Type]'"
},
{
"name": "merge",
"type": "'Optional[Variant[String[1],Hash[String,Scalar]]]'"
},
{
"name": "name",
"type": "'Variant[String,Array[String]]'"
},
{
"name": "value_type",
"type": "'Optional[Type]'"
},
{
"name": "merge",
"type": "'Optional[Variant[String[1],Hash[String,Scalar]]]'"
},
{
"name": "default_value",
"type": "'String'"
}
],
"file": "lib/lookup.rb",
"line": 151,
"name": "lookup",
"puppet_version": 4,
"signatures": [
[
{
"name": "name",
"type": "'Variant[String,Array[String]]'"
},
{
"name": "value_type",
"type": "'Optional[Type]'"
},
{
"name": "merge",
"type": "'Optional[Variant[String[1],Hash[String,Scalar]]]'"
}
],
[
{
"name": "name",
"type": "'Variant[String,Array[String]]'"
},
{
"name": "value_type",
"type": "'Optional[Type]'"
},
{
"name": "merge",
"type": "'Optional[Variant[String[1],Hash[String,Scalar]]]'"
},
{
"name": "default_value",
"type": "'String'"
}
]
]
},
{
"docstring": "function 4x\n\nThis is a function which is used to test puppet strings",
"documented_params": [],
"file": "lib/puppet/functions/4x_function.rb",
"line": 4,
"name": "function4x",
"puppet_version": 4,
"signatures": []
},
{
"docstring": "This is the\nfunction documentation for `function3x`",
"documented_params": [],
"file": "lib/puppet/parser/functions/function3x.rb",
"line": 1,
"name": "function3x",
"puppet_version": 3
}
],
"puppet_providers": [
{
"commands": [
"aptget",
"aptcache",
"preseed"
],
"confines": {},
"defaults": {
"osfamily": ":debian"
},
"docstring": "Package management via `apt-get`.\n\nThis provider supports the `install_options` attribute, which allows command-line flags to be passed to apt-get.\nThese options should be specified as a string (e.g. '--flag'), a hash (e.g. {'--flag' => 'value'}),\nor an array where each element is either a string or a hash.",
"features": [
":versionable",
":install_options"
],
"file": "lib/apt.rb",
"line": 1,
"name": "apt",
"type_name": "package"
}
],
"puppet_types": [
{
"docstring": "Manages files, including their content, ownership, and permissions.\n\nThe `file` type can manage normal files, directories, and symlinks; the\ntype should be specified in the `ensure` attribute.\n\nFile contents can be managed directly with the `content` attribute, or\ndownloaded from a remote source using the `source` attribute; the latter\ncan also be used to recursively serve directories (when the `recurse`\nattribute is set to `true` or `local`). On Windows, note that file\ncontents are managed in binary mode; Puppet never automatically translates\nline endings.\n\n**Autorequires:** If Puppet is managing the user or group that owns a\nfile, the file resource will autorequire them. If Puppet is managing any\nparent directories of a file, the file resource will autorequire them.",
"features": [
{
"docstring": "The provider can manage symbolic links.",
"methods": null,
"name": "manages_symlinks"
},
{
"docstring": "The provider can manage symbolic links.",
"methods": null,
"name": "manages_symlinks"
}
],
"file": "lib/file.rb",
"line": 14,
"name": "file",
"parameters": [
{
"allowed_values": [],
"default": null,
"docstring": "The path to the file to manage. Must be fully qualified.\n\nOn Windows, the path should include the drive letter and should use `/` as\nthe separator character (rather than `\\\\`).",
"name": "path",
"namevar": true
},
{
"allowed_values": [],
"default": "\"puppet\"",
"docstring": "Whether (and how) file content should be backed up before being replaced.\nThis attribute works best as a resource default in the site manifest\n(`File { backup => main }`), so it can affect all file resources.\n\n* If set to `false`, file content won't be backed up.\n* If set to a string beginning with `.` (e.g., `.puppet-bak`), Puppet will\n use copy the file in the same directory with that value as the extension\n of the backup. (A value of `true` is a synonym for `.puppet-bak`.)\n* If set to any other string, Puppet will try to back up to a filebucket\n with that title. See the `filebucket` resource type for more details.\n (This is the preferred method for backup, since it can be centralized\n and queried.)\n\nDefault value: `puppet`, which backs up to a filebucket of the same name.\n(Puppet automatically creates a **local** filebucket named `puppet` if one\ndoesn't already exist.)\n\nBacking up to a local filebucket isn't particularly useful. If you want\nto make organized use of backups, you will generally want to use the\npuppet master server's filebucket service. This requires declaring a\nfilebucket resource and a resource default for the `backup` attribute\nin site.pp:\n\n # /etc/puppetlabs/puppet/manifests/site.pp\n filebucket { 'main':\n path => false, # This is required for remote filebuckets.\n server => 'puppet.example.com', # Optional; defaults to the configured puppet master.\n }\n\n File { backup => main, }\n\nIf you are using multiple puppet master servers, you will want to\ncentralize the contents of the filebucket. Either configure your load\nbalancer to direct all filebucket traffic to a single master, or use\nsomething like an out-of-band rsync task to synchronize the content on all\nmasters.",
"name": "backup",
"namevar": false
},
{
"allowed_values": [
":true",
":false",
":remote"
],
"default": null,
"docstring": "Whether to recursively manage the _contents_ of a directory. This attribute\nis only used when `ensure => directory` is set. The allowed values are:\n\n* `false` --- The default behavior. The contents of the directory will not be\n automatically managed.\n* `remote` --- If the `source` attribute is set, Puppet will automatically\n manage the contents of the source directory (or directories), ensuring\n that equivalent files and directories exist on the target system and\n that their contents match.\n\n Using `remote` will disable the `purge` attribute, but results in faster\n catalog application than `recurse => true`.\n\n The `source` attribute is mandatory when `recurse => remote`.\n* `true` --- If the `source` attribute is set, this behaves similarly to\n `recurse => remote`, automatically managing files from the source directory.\n\n This also enables the `purge` attribute, which can delete unmanaged\n files from a directory. See the description of `purge` for more details.\n\n The `source` attribute is not mandatory when using `recurse => true`, so you\n can enable purging in directories where all files are managed individually.\n\nBy default, setting recurse to `remote` or `true` will manage _all_\nsubdirectories. You can use the `recurselimit` attribute to limit the\nrecursion depth.",
"name": "recurse",
"namevar": false
},
{
"allowed_values": [
"/^[0-9]+$/"
],
"default": null,
"docstring": "How far Puppet should descend into subdirectories, when using\n`ensure => directory` and either `recurse => true` or `recurse => remote`.\nThe recursion limit affects which files will be copied from the `source`\ndirectory, as well as which files can be purged when `purge => true`.\n\nSetting `recurselimit => 0` is the same as setting `recurse => false` ---\nPuppet will manage the directory, but all of its contents will be treated\nas unmanaged.\n\nSetting `recurselimit => 1` will manage files and directories that are\ndirectly inside the directory, but will not manage the contents of any\nsubdirectories.\n\nSetting `recurselimit => 2` will manage the direct contents of the\ndirectory, as well as the contents of the _first_ level of subdirectories.\n\nAnd so on --- 3 will manage the contents of the second level of\nsubdirectories, etc.",
"name": "recurselimit",
"namevar": false
},
{
"allowed_values": [],
"default": ":true",
"docstring": "Whether to replace a file or symlink that already exists on the local system but\nwhose content doesn't match what the `source` or `content` attribute\nspecifies. Setting this to false allows file resources to initialize files\nwithout overwriting future changes. Note that this only affects content;\nPuppet will still manage ownership and permissions. Defaults to `true`.",
"name": "replace",
"namevar": false
},
{
"allowed_values": [],
"default": "false",
"docstring": "Perform the file operation even if it will destroy one or more directories.\nYou must use `force` in order to:\n\n* `purge` subdirectories\n* Replace directories with files or links\n* Remove a directory when `ensure => absent`",
"name": "force",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A parameter which omits action on files matching\nspecified patterns during recursion. Uses Ruby's builtin globbing\nengine, so shell metacharacters are fully supported, e.g. `[a-z]*`.\nMatches that would descend into the directory structure are ignored,\ne.g., `*/*`.",
"name": "ignore",
"namevar": false
},
{
"allowed_values": [
":follow",
":manage"
],
"default": ":manage",
"docstring": "How to handle links during file actions. During file copying,\n`follow` will copy the target file instead of the link, `manage`\nwill copy the link itself, and `ignore` will just pass it by.\nWhen not copying, `manage` and `ignore` behave equivalently\n(because you cannot really ignore links entirely during local\nrecursion), and `follow` will manage the file to which the link points.",
"name": "links",
"namevar": false
},
{
"allowed_values": [],
"default": ":false",
"docstring": "Whether unmanaged files should be purged. This option only makes\nsense when `ensure => directory` and `recurse => true`.\n\n* When recursively duplicating an entire directory with the `source`\n attribute, `purge => true` will automatically purge any files\n that are not in the source directory.\n* When managing files in a directory as individual resources,\n setting `purge => true` will purge any files that aren't being\n specifically managed.\n\nIf you have a filebucket configured, the purged files will be uploaded,\nbut if you do not, this will destroy data.\n\nUnless `force => true` is set, purging will **not** delete directories,\nalthough it will delete the files they contain.\n\nIf `recurselimit` is set and you aren't using `force => true`, purging\nwill obey the recursion limit; files in any subdirectories deeper than the\nlimit will be treated as unmanaged and left alone.",
"name": "purge",
"namevar": false
},
{
"allowed_values": [
":first",
":all"
],
"default": ":first",
"docstring": "Whether to copy all valid sources, or just the first one. This parameter\nonly affects recursive directory copies; by default, the first valid\nsource is the only one used, but if this parameter is set to `all`, then\nall valid sources will have all of their contents copied to the local\nsystem. If a given file exists in more than one source, the version from\nthe earliest source in the list will be used.",
"name": "sourceselect",
"namevar": false
},
{
"allowed_values": [],
"default": ":true",
"docstring": "Whether to display differences when the file changes, defaulting to\ntrue. This parameter is useful for files that may contain passwords or\nother secret data, which might otherwise be included in Puppet reports or\nother insecure outputs. If the global `show_diff` setting\nis false, then no diffs will be shown even if this parameter is true.",
"name": "show_diff",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A command for validating the file's syntax before replacing it. If\nPuppet would need to rewrite a file due to new `source` or `content`, it\nwill check the new content's validity first. If validation fails, the file\nresource will fail.\n\nThis command must have a fully qualified path, and should contain a\npercent (`%`) token where it would expect an input file. It must exit `0`\nif the syntax is correct, and non-zero otherwise. The command will be\nrun on the target system while applying the catalog, not on the puppet master.\n\nExample:\n\n file { '/etc/apache2/apache2.conf':\n content => 'example',\n validate_cmd => '/usr/sbin/apache2 -t -f %',\n }\n\nThis would replace apache2.conf only if the test returned true.\n\nNote that if a validation command requires a `%` as part of its text,\nyou can specify a different placeholder token with the\n`validate_replacement` attribute.",
"name": "validate_cmd",
"namevar": false
},
{
"allowed_values": [],
"default": "'%'",
"docstring": "The replacement string in a `validate_cmd` that will be replaced\nwith an input file name. Defaults to: `%`",
"name": "validate_replacement",
"namevar": false
}
],
"properties": []
},
{
"docstring": "Manage packages. There is a basic dichotomy in package\nsupport right now: Some package types (e.g., yum and apt) can\nretrieve their own package files, while others (e.g., rpm and sun)\ncannot. For those package formats that cannot retrieve their own files,\nyou can use the `source` parameter to point to the correct file.\n\nPuppet will automatically guess the packaging format that you are\nusing based on the platform you are on, but you can override it\nusing the `provider` parameter; each provider defines what it\nrequires in order to function, and you must meet those requirements\nto use a given provider.\n\nYou can declare multiple package resources with the same `name`, as long\nas they specify different providers and have unique titles.\n\nNote that you must use the _title_ to make a reference to a package\nresource; `Package[<NAME>]` is not a synonym for `Package[<TITLE>]` like\nit is for many other resource types.\n\n**Autorequires:** If Puppet is managing the files specified as a\npackage's `adminfile`, `responsefile`, or `source`, the package\nresource will autorequire those files.",
"features": [
{
"docstring": "The provider can reinstall packages.",
"methods": [
"reinstall"
],
"name": "reinstallable"
},
{
"docstring": "The provider can install packages.",
"methods": [
"install"
],
"name": "installable"
},
{
"docstring": "The provider can uninstall packages.",
"methods": [
"uninstall"
],
"name": "uninstallable"
},
{
"docstring": "The provider can upgrade to the latest version of a\npackage. This feature is used by specifying `latest` as the\ndesired value for the package.",
"methods": [
"update",
"latest"
],
"name": "upgradeable"
},
{
"docstring": "The provider can purge packages. This generally means\nthat all traces of the package are removed, including\nexisting configuration files. This feature is thus destructive\nand should be used with the utmost care.",
"methods": [
"purge"
],
"name": "purgeable"
},
{
"docstring": "The provider is capable of interrogating the\npackage database for installed version(s), and can select\nwhich out of a set of available versions of a package to\ninstall if asked.",
"methods": null,
"name": "versionable"
},
{
"docstring": "The provider is capable of placing packages on hold\nsuch that they are not automatically upgraded as a result of\nother package dependencies unless explicit action is taken by\na user or another package. Held is considered a superset of\ninstalled.",
"methods": [
"hold"
],
"name": "holdable"
},
{
"docstring": "The provider accepts options to be\npassed to the installer command.",
"methods": null,
"name": "install_options"
},
{
"docstring": "The provider accepts options to be\npassed to the uninstaller command.",
"methods": null,
"name": "uninstall_options"
},
{
"docstring": "The provider accepts package_settings to be\nensured for the given package. The meaning and format of these settings is\nprovider-specific.",
"methods": [
"package_settings_insync?",
"package_settings",
"package_settings="
],
"name": "package_settings"
},
{
"docstring": "The provider accepts virtual package names for install and uninstall.",
"methods": null,
"name": "virtual_packages"
},
{
"docstring": "The provider can reinstall packages.",
"methods": [
"reinstall"
],
"name": "reinstallable"
},
{
"docstring": "The provider can install packages.",
"methods": [
"install"
],
"name": "installable"
},
{
"docstring": "The provider can uninstall packages.",
"methods": [
"uninstall"
],
"name": "uninstallable"
},
{
"docstring": "The provider can upgrade to the latest version of a\npackage. This feature is used by specifying `latest` as the\ndesired value for the package.",
"methods": [
"update",
"latest"
],
"name": "upgradeable"
},
{
"docstring": "The provider can purge packages. This generally means\nthat all traces of the package are removed, including\nexisting configuration files. This feature is thus destructive\nand should be used with the utmost care.",
"methods": [
"purge"
],
"name": "purgeable"
},
{
"docstring": "The provider is capable of interrogating the\npackage database for installed version(s), and can select\nwhich out of a set of available versions of a package to\ninstall if asked.",
"methods": null,
"name": "versionable"
},
{
"docstring": "The provider is capable of placing packages on hold\nsuch that they are not automatically upgraded as a result of\nother package dependencies unless explicit action is taken by\na user or another package. Held is considered a superset of\ninstalled.",
"methods": [
"hold"
],
"name": "holdable"
},
{
"docstring": "The provider accepts options to be\npassed to the installer command.",
"methods": null,
"name": "install_options"
},
{
"docstring": "The provider accepts options to be\npassed to the uninstaller command.",
"methods": null,
"name": "uninstall_options"
},
{
"docstring": "The provider accepts package_settings to be\nensured for the given package. The meaning and format of these settings is\nprovider-specific.",
"methods": [
"package_settings_insync?",
"package_settings",
"package_settings="
],
"name": "package_settings"
},
{
"docstring": "The provider accepts virtual package names for install and uninstall.",
"methods": null,
"name": "virtual_packages"
}
],
"file": "lib/package.rb",
"line": 10,
"name": "package",
"parameters": [
{
"allowed_values": [],
"default": null,
"docstring": "The package name. This is the name that the packaging\nsystem uses internally, which is sometimes (especially on Solaris)\na name that is basically useless to humans. If a package goes by\nseveral names, you can use a single title and then set the name\nconditionally:\n\n # In the 'openssl' class\n $ssl = $operatingsystem ? {\n solaris => SMCossl,\n default => openssl\n }\n\n package { 'openssl':\n name => $ssl,\n ensure => installed\n }\n\n . etc. .\n\n $ssh = $operatingsystem ? {\n solaris => SMCossh,\n default => openssh\n }\n\n package { 'openssh':\n name => $ssh\n ensure => installed,\n require => Package['openssl']\n }",
"name": "name",
"namevar": true
},
{
"allowed_values": [],
"default": null,
"docstring": "Where to find the package file. This is only used by providers that don't\nautomatically download packages from a central repository. (For example:\nthe `yum` and `apt` providers ignore this attribute, but the `rpm` and\n`dpkg` providers require it.)\n\nDifferent providers accept different values for `source`. Most providers\naccept paths to local files stored on the target system. Some providers\nmay also accept URLs or network drive paths. Puppet will not\nautomatically retrieve source files for you, and usually just passes the\nvalue of `source` to the package installation command.\n\nYou can use a `file` resource if you need to manually copy package files\nto the target system.",
"name": "source",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A read-only parameter set by the package.",
"name": "instance",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A read-only parameter set by the package.",
"name": "status",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A file containing package defaults for installing packages.\n\nThis attribute is only used on Solaris. Its value should be a path to a\nlocal file stored on the target system. Solaris's package tools expect\neither an absolute file path or a relative path to a file in\n`/var/sadm/install/admin`.\n\nThe value of `adminfile` will be passed directly to the `pkgadd` or\n`pkgrm` command with the `-a <ADMINFILE>` option.",
"name": "adminfile",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A file containing any necessary answers to questions asked by\nthe package. This is currently used on Solaris and Debian. The\nvalue will be validated according to system rules, but it should\ngenerally be a fully qualified path.",
"name": "responsefile",
"namevar": false
},
{
"allowed_values": [
":keep",
":replace"
],
"default": ":keep",
"docstring": "Whether configfiles should be kept or replaced. Most packages\ntypes do not support this parameter. Defaults to `keep`.",
"name": "configfiles",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A read-only parameter set by the package.",
"name": "category",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A read-only parameter set by the package.",
"name": "platform",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A read-only parameter set by the package.",
"name": "root",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A read-only parameter set by the package.",
"name": "vendor",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "A read-only parameter set by the package.",
"name": "description",
"namevar": false
},
{
"allowed_values": [
":true",
":false"
],
"default": null,
"docstring": "Tells apt to allow cdrom sources in the sources.list file.\nNormally apt will bail if you try this.",
"name": "allowcdrom",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "OpenBSD supports 'flavors', which are further specifications for\nwhich type of package you want.",
"name": "flavor",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "An array of additional options to pass when installing a package. These\noptions are package-specific, and should be documented by the software\nvendor. One commonly implemented option is `INSTALLDIR`:\n\n package { 'mysql':\n ensure => installed,\n source => 'N:/packages/mysql-5.5.16-winx64.msi',\n install_options => [ '/S', { 'INSTALLDIR' => 'C:\\\\mysql-5.5' } ],\n }\n\nEach option in the array can either be a string or a hash, where each\nkey and value pair are interpreted in a provider specific way. Each\noption will automatically be quoted when passed to the install command.\n\nOn Windows, this is the **only** place in Puppet where backslash\nseparators should be used. Note that backslashes in double-quoted\nstrings _must_ be double-escaped and backslashes in single-quoted\nstrings _may_ be double-escaped.",
"name": "install_options",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "An array of additional options to pass when uninstalling a package. These\noptions are package-specific, and should be documented by the software\nvendor. For example:\n\n package { 'VMware Tools':\n ensure => absent,\n uninstall_options => [ { 'REMOVE' => 'Sync,VSS' } ],\n }\n\nEach option in the array can either be a string or a hash, where each\nkey and value pair are interpreted in a provider specific way. Each\noption will automatically be quoted when passed to the uninstall\ncommand.\n\nOn Windows, this is the **only** place in Puppet where backslash\nseparators should be used. Note that backslashes in double-quoted\nstrings _must_ be double-escaped and backslashes in single-quoted\nstrings _may_ be double-escaped.",
"name": "uninstall_options",
"namevar": false
},
{
"allowed_values": [],
"default": "true",
"docstring": "Specifies if virtual package names are allowed for install and uninstall.",
"name": "allow_virtual",
"namevar": false
},
{
"allowed_values": [
":true",
":false"
],
"default": ":false",
"docstring": "Whether this resource should respond to refresh events (via `subscribe`,\n`notify`, or the `~>` arrow) by reinstalling the package. Only works for\nproviders that support the `reinstallable` feature.\n\nThis is useful for source-based distributions, where you may want to\nrecompile a package if the build options change.\n\nIf you use this, be careful of notifying classes when you want to restart\nservices. If the class also contains a refreshable package, doing so could\ncause unnecessary re-installs.\n\nDefaults to `false`.",
"name": "reinstall_on_refresh",
"namevar": false
}
],
"properties": [
{
"allowed_values": [],
"default": null,
"docstring": "Settings that can change the contents or configuration of a package.\n\nThe formatting and effects of package_settings are provider-specific; any\nprovider that implements them must explain how to use them in its\ndocumentation. (Our general expectation is that if a package is\ninstalled but its settings are out of sync, the provider should\nre-install that package with the desired settings.)\n\nAn example of how package_settings could be used is FreeBSD's port build\noptions --- a future version of the provider could accept a hash of options,\nand would reinstall the port if the installed version lacked the correct\nsettings.\n\n package { 'www/apache22':\n package_settings => { 'SUEXEC' => false }\n }\n\nAgain, check the documentation of your platform's package provider to see\nthe actual usage.",
"name": "package_settings"
}
]
},
{
"docstring": "Manage running services. Service support unfortunately varies\n* You can provide an explicit command for restarting with the `restart` attribute.\n* If you do neither, the service's stop and start commands will be used.",
"features": [
{
"docstring": "The provider can restart the service.",
"methods": [
"restart"
],
"name": "refreshable"
},
{
"docstring": "The provider can restart",
"methods": null,
"name": "nomethods"
},
{
"docstring": "The provider can restart the service.",
"methods": [
"restart"
],
"name": "refreshable"
},
{
"docstring": "The provider can restart",
"methods": null,
"name": "nomethods"
}
],
"file": "lib/service.rb",
"line": 10,
"name": "service",
"parameters": [
{
"allowed_values": [],
"default": null,
"docstring": "The path to the daemon. This is only used for\nsystems that do not support init scripts. This binary will be\nused to start the service if no `start` parameter is\nprovided.",
"name": "binary",
"namevar": false
},
{
"allowed_values": [
":true",
":false"
],
"default": ":true",
"docstring": "Declare whether the service's init script has a functional status\ncommand; defaults to `true`. This attribute's default value changed in\nPuppet 2.7.0.\nwithout providing a status command.",
"name": "hasstatus",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "The name of the service to run.\n\nThis name is used to find the service; on platforms where services\nhave short system names and long display names, this should be the\nshort name. (To take an example from Windows, you would use \"wuauserv\"\nrather than \"Automatic Updates.\")",
"name": "name",
"namevar": true
},
{
"allowed_values": [],
"default": "{ provider.class.defpath if provider.class.respond_to?(:defpath) }",
"docstring": "The search path for finding init scripts. Multiple values should\nbe separated by colons or provided as an array.",
"name": "path",
"namevar": false
},
{
"allowed_values": [],
"default": "{ @resource[:binary] || @resource[:name] }",
"docstring": "The pattern to search for in the process table.\nThis is used for stopping services on platforms that do not\nsupport init scripts, and is also used for determining service\nstatus on those service whose init scripts do not include a status\ncommand.\n\nDefaults to the name of the service. The pattern can be a simple string\nor any legal Ruby pattern, including regular expressions (which should\nbe quoted without enclosing slashes).",
"name": "pattern",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "Specify a *restart* command manually. If left\nunspecified, the service will be stopped and then started.",
"name": "restart",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "Specify a *start* command manually. Most service subsystems\nsupport a `start` command, so this will not need to be\nspecified.",
"name": "start",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "Specify a *status* command manually. This command must\nreturn 0 if the service is running and a nonzero value otherwise.\nIdeally, these exit codes should conform to [the LSB's\nspecification][lsb-exit-codes] for init script status actions, but\nPuppet only considers the difference between 0 and nonzero to be\nrelevant.\n\nIf left unspecified, the status of the service will be determined\nautomatically, usually by looking for the service in the process\ntable.\n\n[lsb-exit-codes]: http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html",
"name": "status",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "Specify a *stop* command manually.",
"name": "stop",
"namevar": false
},
{
"allowed_values": [],
"default": "{ resource.name.gsub(\".\",\"_\").upcase + \"_START\" if resource.provider.controllable? }",
"docstring": "The control variable used to manage services (originally for HP-UX).\nDefaults to the upcased service name plus `START` replacing dots with\nunderscores, for those providers that support the `controllable` feature.",
"name": "control",
"namevar": false
},
{
"allowed_values": [
":true",
":false"
],
"default": null,
"docstring": "Specify that an init script has a `restart` command. If this is\nfalse and you do not specify a command in the `restart` attribute,\nthe init script's `stop` and `start` commands will be used.\n\nDefaults to false.",
"name": "hasrestart",
"namevar": false
},
{
"allowed_values": [],
"default": null,
"docstring": "Specify a command to config a service, or a path to a manifest to do so.",
"name": "manifest",
"namevar": false
}
],
"properties": [
{
"allowed_values": [
":true",
":false"
],
"default": null,
"docstring": "Whether a service should be enabled to start at boot.\na given service.",
"name": "enable"
},
{
"allowed_values": [
":stopped",
":running"
],
"default": null,
"docstring": "Whether a service should be running.",
"name": "ensure"
},
{
"allowed_values": [],
"default": null,
"docstring": "Specify a string of flags to pass to the startup script.",
"name": "flags"
}
]
},
{
"docstring": "Manages files, including their content, ownership, and permissions.\nThe provider can manage symbolic links.",
"features": [
{
"docstring": "The provider can pass flags to the service.",
"methods": null,
"name": "flaggable"
},
{
"docstring": "The provider can 'mask' the service.",
"methods": [
"mask"
],
"name": "maskable"
},
{
"docstring": "The provider can pass flags to the service.",
"methods": null,
"name": "flaggable"
},
{
"docstring": "The provider can 'mask' the service.",
"methods": [
"mask"
],
"name": "maskable"
}
],
"file": "lib/minifile.rb",
"line": 2,
"name": "minifile",
"parameters": [
{
"allowed_values": [],
"default": ":true",
"docstring": "",
"name": "why_rubbby",
"namevar": true
},
{
"allowed_values": [],
"default": null,
"docstring": "",
"name": "fubar",
"namevar": true
},
{
"allowed_values": [],
"default": null,
"docstring": "The path to the file to manage. Must be fully qualified.\n\nOn Windows, the path should include the drive letter and should use `/` as\nthe separator character (rather than `\\\\`).",
"name": "minifile",
"namevar": true
},
{
"allowed_values": [],
"default": "\"puppet\"",
"docstring": "Whether (and how) file content should be backed up before being replaced.\nThis attribute works best as a resource default in the site manifest\n(`File { backup => main }`), so it can affect all file resources.\n\n* If set to `false`, file content won't be backed up.\n* If set to a string beginning with `.` (e.g., `.puppet-bak`), Puppet will\n use copy the file in the same directory with that value as the extension\n of the backup. (A value of `true` is a synonym for `.puppet-bak`.)\n* If set to any other string, Puppet will try to back up to a filebucket\n with that title. See the `filebucket` resource type for more details.\n (This is the preferred method for backup, since it can be centralized\n and queried.)\n\nDefault value: `puppet`, which backs up to a filebucket of the same name.\n(Puppet automatically creates a **local** filebucket named `puppet` if one\ndoesn't already exist.)\n\nBacking up to a local filebucket isn't particularly useful. If you want\nto make organized use of backups, you will generally want to use the\npuppet master server's filebucket service. This requires declaring a\nfilebucket resource and a resource default for the `backup` attribute\nin site.pp:\n\n # /etc/puppetlabs/puppet/manifests/site.pp\n filebucket { 'main':\n path => false, # This is required for remote filebuckets.\n server => 'puppet.example.com', # Optional; defaults to the configured puppet master.\n }\n\n File { backup => main, }\n\nIf you are using multiple puppet master servers, you will want to\ncentralize the contents of the filebucket. Either configure your load\nbalancer to direct all filebucket traffic to a single master, or use\nsomething like an out-of-band rsync task to synchronize the content on all\nmasters.",
"name": "backup",
"namevar": true
}
],
"properties": []
}
]
}
@iankronquist
Copy link
Author

Please comment with any changes to the structure you would like to see.

@adreyer
Copy link

adreyer commented Sep 10, 2015

what is type_info?

@adreyer
Copy link

adreyer commented Sep 10, 2015

I'm concerned about magic lists of [$name, $type] for params. Those should probably be objects with keys.

@adreyer
Copy link

adreyer commented Sep 10, 2015

The provider doesn't seem to be linked back to the type at all.

@iankronquist
Copy link
Author

@adreyer

  1. Type info is the internal name for a data structure representing the type information gleaned from the code.
  2. The magic lists have been turned into hashes.
  3. Oops, it turns out I forgot to update this gist to the latest version. It is now up to date.

@iankronquist
Copy link
Author

I added a long description of this data structure to the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment