4.5 KiB
Reference
Classes
klass
: A simple class.
Defined types
klass::dt
: A simple defined type.
Resource types
apt_key
: Example resource type using the new API.database
: An example database server resource type.
Functions
func
: A simple Puppet function.func4x
: An example 4.x function.func4x_1
: An example 4.x function with only one signature.
Classes
klass
-
Since 1.0.0
-
See also www.puppet.com
Examples
This is an example
class { 'klass':
param1 => 1,
param3 => 'foo',
}
Parameters
The following parameters are available in the klass
class.
param1
Data type: Integer
First param.
Default value: 1
param2
Data type: Any
Second param.
Default value: undef
param3
Data type: String
Third param.
Default value: 'hi'
Defined types
klass::dt
-
Since 1.1.0
-
See also www.puppet.com
Examples
Here's an example of this type:
klass::dt { 'foo':
param1 => 33,
param4 => false,
}
Parameters
The following parameters are available in the klass::dt
defined type.
param1
Data type: Integer
First param.
Default value: 44
param2
Data type: Any
Second param.
param3
Data type: String
Third param.
Default value: 'hi'
param4
Data type: Boolean
Fourth param.
Default value: true
Resource types
apt_key
This type provides Puppet with the capabilities to manage GPG keys needed
by apt to perform package validation. Apt has it's own GPG keyring that can
be manipulated through the apt-key
command.
Autorequires:
If Puppet is given the location of a key file which looks like an absolute
path this type will autorequire that file.
Examples
here's an example
apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F':
source => 'http://apt.puppetlabs.com/pubkey.gpg'
}
Properties
The following properties are available in the apt_key
resource type.
ensure
Data type: Enum[present, absent]
Whether this apt key should be present or absent on the target system.
created
Data type: String
Date the key was created, in ISO format.
Parameters
The following parameters are available in the apt_key
resource type.
id
namevar
Data type: Variant[Pattern[/A(0x)?[0-9a-fA-F]{8}Z/], Pattern[/A(0x)?[0-9a-fA-F]{16}Z/], Pattern[/A(0x)?[0-9a-fA-F]{40}Z/]]
*this data type contains a regex that may not be accurately reflected in generated documentation
The ID of the key you want to manage.
database
An example database server resource type.
Examples
here's an example
database { 'foo':
address => 'qux.baz.bar',
}
Properties
The following properties are available in the database
resource type.
ensure
Valid values: present, absent, up, down
Aliases: "up"=>"present", "down"=>"absent"
What state the database should be in.
Default value: up
file
The database file to use.
log_level
Valid values: debug, warn, error
The log level to use.
Default value: warn
Parameters
The following parameters are available in the database
resource type.
address
namevar
The database server name.
encryption_key
The encryption key to use.
encrypt
Valid values: true
, false
, yes, no
Whether or not to encrypt the database.
Default value: false
Functions
func
func(Integer $param1, Any $param2, String $param3 = hi)
A simple Puppet function.
Returns: Undef
Returns nothing.
param1
Data type: Integer
First param.
param2
Data type: Any
Second param.
param3
Data type: String
Third param.
func4x
func4x(Integer $param1, Any $param2, Optional[Array[String]] $param3)
An overview for the first overload.
Returns: Undef
Returns nothing.
param1
Data type: Integer
The first parameter.
param2
Data type: Any
The second parameter.
param3
Data type: Optional[Array[String]]
The third parameter.
func4x(Boolean $param, Callable &$block)
An overview for the second overload.
Returns: String
Returns a string.
param
Data type: Boolean
The first parameter.
&block
Data type: Callable
The block parameter.
func4x_1
func4x_1(Integer $param1)
An example 4.x function with only one signature.
Returns: Undef
Returns nothing.
param1
Data type: Integer
The first parameter.