Puppet resources
A Puppet resource is a unit of configuration. Puppet uses manifests to store resources.
Puppet manages types of resources. Each resource has a type, a title, and one or more attributes. Every attribute has a value. The value specifies the state desired for the resource. You can specify the state of a device by setting values for attributes regardless of how the device enters the state. The following resource example shows how to configure a device to create VLAN 2 and configure the description for VLAN 2.
netdev_vlan{'vlan2': ensure => undo_shutdown, id => 2, description => 'sales-private', require => Netdev_device['device'], }
The following are the resource type and title:
netdev_vlan—Type of the resource. The netdev_vlan type resources are used for VLAN configuration.
vlan2—Title of the resource. The title is the unique identifier of the resource.
The example contains the following attributes:
ensure—Creates, modifies, or deletes a VLAN. To create a VLAN, set the attribute value to undo_shutdown. To delete a VLAN, set the attribute value to shutdown.
id—Specifies a VLAN by its ID. In this example, VLAN 2 is specified.
description—Configures the description for the VLAN. In this example, the description for VLAN 2 is sales-private.
require—Indicates that the resource depends on another resource (specified by resource type and title). In this example, the resource depends on a netdev_device type resource titled device.
NOTE: For information about resource types supported by Puppet, see "Puppet resources." | ||