Skip to content

Latest commit

 

History

History
1636 lines (889 loc) · 38.7 KB

REFERENCE.md

File metadata and controls

1636 lines (889 loc) · 38.7 KB

Reference

Table of Contents

Classes

  • lvm: Manage LVM

Defined types

Resource types

Functions

Tasks

  • ensure_fs: Ensures settings on a filesystem using the type & provider
  • ensure_lv: Ensures settings on a logical volume using the type & provider
  • ensure_pv: Ensures settings on a physical volumes using the type & provider
  • ensure_vg: Ensures settings on a volume group using the type & provider
  • extend_lv: Extends a logical volume
  • extend_vg: Adds physical volumes to a volume group
  • mount_lv: Mounts a logical volume

Plans

  • lvm::expand: An opinionated method for expanding storage on machines that use LVM. If this doesn't fit your needs, simply tie the tasks together in some way that does.

Classes

lvm

Manage LVM

Parameters

The following parameters are available in the lvm class:

package_ensure

Data type: Enum['installed', 'present', 'latest', 'absent']

Ensure value for the lvm2 package.

Default value: 'installed'

manage_pkg

Data type: Boolean

Whether to manage the lvm2 package.

Default value: false

volume_groups

Data type: Hash

Hash of lvm::volume_group resources to create.

Default value: {}

Defined types

lvm::logical_volume

This will automatically set this volume group as a dependency, but it must be defined elsewhere using the volume_group resource type.

the partition size.

(if the LV found is larger then the size requests this is just logged not causing a FAIL)

are in sync. Cannot be changed on already mirrored volume. Take your mirror size in terabytes and round up that number to the next power of 2, using that number as the -R argument

Parameters

The following parameters are available in the lvm::logical_volume defined type:

volume_group

Data type: String[1]

The volume group name associated with this logical volume.

size

Data type: Optional[String[1]]

Configures the size of the filesystem. Supports filesystem resizing. The size will be rounded up to the nearest multiple of

Default value: undef

initial_size

Data type: Optional[String[1]]

The initial size of the logical volume. This will only apply to newly-created volumes

Default value: undef

ensure

Data type: Enum['absent', 'present']

Default value: present

options

Data type: String[1]

Params for the mkfs command

Default value: 'defaults'

pass

Data type: Variant[String[1], Integer]

Default value: '2'

dump

Data type: Variant[String[1], Integer]

Default value: '0'

fs_type

Data type: String[1]

The file system type. eg. ext3.

Default value: 'ext4'

mkfs_options

Data type: Optional[String[1]]

Default value: undef

mountpath

Data type: Stdlib::Absolutepath

Default value: "/${name}"

mountpath_require

Data type: Boolean

Default value: false

mounted

Data type: Boolean

If puppet should mount the volume. This only affects what puppet will do, and not what will be mounted at boot-time.

Default value: true

createfs

Data type: Boolean

Default value: true

extents

Data type: Optional[String[1]]

The number of logical extents to allocate for the new logical volume. Set to undef to use all available space

Default value: undef

stripes

Data type: Optional[Variant[String[1], Integer]]

The number of stripes to allocate for the new logical volume.

Default value: undef

stripesize

Data type: Optional[Variant[String[1], Integer]]

The stripesize to use for the new logical volume.

Default value: undef

readahead

Data type: Optional[Variant[String[1], Integer]]

The readahead count to use for the new logical volume.

Default value: undef

range

Data type: Optional[Enum['maximum', 'minimum']]

  • Set to true if the ‘size’ parameter specified, is just the minimum size you need

Default value: undef

size_is_minsize

Data type: Optional[Boolean]

Lists strings for access control for connection method, users, databases, IPv4 addresses;

Default value: undef

type

Data type: Optional[String[1]]

Configures the logical volume type. AIX only

Default value: undef

thinpool

Data type: Variant[Boolean, String]

  • Set to true to create a thin pool or to pool name to create thin volume

Default value: false

poolmetadatasize

Data type: Optional[Integer[0, 4]]

Set the initial size of the logical volume pool metadata on creation

Default value: undef

mirror

Data type: Optional[String[1]]

The number of mirrors of the volume.

Default value: undef

mirrorlog

Data type: Optional[Enum['core', 'disk', 'mirrored']]

How to store the mirror log (Allowed values: core, disk, mirrored).

Default value: undef

no_sync

Data type: Optional[Boolean]

An optimization in lvcreate, at least on Linux.

Default value: undef

region_size

Data type: Optional[Variant[String[1], Integer]]

A mirror is divided into regions of this size (in MB), the mirror log uses this granularity to track which regions

Default value: undef

alloc

Data type: Optional[Enum['anywhere', 'contiguous', 'cling', 'inherit', 'normal']]

The allocation policy when a command needs to allocate Physical Extents from the Volume Group.

Default value: undef

yes_flag

Data type: Boolean

If set to true, do not prompt for confirmation interactively but always assume the answer yes.

Default value: false

lvm::physical_volume

Manage a physical volume

Parameters

The following parameters are available in the lvm::physical_volume defined type:

ensure

Data type: Enum['present', 'absent']

ensures phycial volume is present or absent

Default value: present

force

Data type: Boolean

Whether to force the creation without any confirmation.

Default value: false

unless_vg

Data type: Optional[String[1]]

Do not do anything if the VG already exists. The value should be the name of the volume group to check for.

Default value: undef

lvm::volume

Ensures a physical_volume, volume_group, and filesystem resource have been created on the block device supplied in the pv parameter.

physical_volume, volume_group, logical_volume, and filesystem resources are present for the volume. A value of cleaned will ensure that all of the resources are absent. Warning: this has a high potential for unexpected harm, so use it with caution. A value of absent will remove only the logical_volume resource from the system.

volume.

Set to undef to use all available space

This will only apply to newly-created volumes

Examples

Basic usage
lvm::volume { 'lv_example0':
  vg     => 'vg_example0',
  pv     => '/dev/sdd1',
  fstype => 'ext4',
  size   => '100GB',
}

Parameters

The following parameters are available in the lvm::volume defined type:

ensure

Data type: Enum['present', 'absent', 'cleaned']

Can only be set to cleaned, absent or present. A value of present will ensure that the

fstype

Data type: Optional[String[1]]

The type of filesystem to create on the logical

Default value: undef

pv

Data type: Stdlib::Absolutepath

path to physcial volume

vg

Data type: String[1]

value of volume group

size

Data type: Optional[String[1]]

The size the logical_voluem should be.

Default value: undef

extents

Data type: Optional[Variant[String[1], Integer]]

The number of logical extents to allocate for the new logical volume.

Default value: undef

initial_size

Data type: Optional[String[1]]

The initial size of the logical volume.

Default value: undef

lvm::volume_group

Manage a volume group.

Parameters

The following parameters are available in the lvm::volume_group defined type:

physical_volumes

Data type: Variant[Hash, Array, String]

The list of physical volumes to be included in the volume group. This will automatically set these as dependencies, but they must be defined elsewhere using the physical_volume resource type.

createonly

Data type: Boolean

If true, the volume group will be created if it does not exist. If the volume group does exist, no action will be taken.

Default value: false

ensure

Data type: Enum['present', 'absent']

Whether this volume group should be present or absent.

Default value: present

logical_volumes

Data type: Hash

A hash of lvm::logical_volume resources to create in this volume group.

Default value: {}

followsymlinks

Data type: Boolean

If true, all current and wanted values of the physical_volumes property will be followed to their real files on disk if they are in fact symlinks. This is useful to have Puppet determine what the actual PV device is if the property value is a symlink, like /dev/disk/by-path/xxxx -> ../../sda.

Default value: false

Resource types

filesystem

The filesystem type

Properties

The following properties are available in the filesystem type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

size

Configures the size of the filesystem. Supports filesystem resizing. The size will be rounded up to the nearest multiple of the partition size. AIX only.

Parameters

The following parameters are available in the filesystem type.

accounting

Valid values: true, false

Specify accounting subsystem support, AIX only

ag_size

Valid values: %r{\d+}

Specify the allocation group size in megabytes, AIX only.

agblksize

Valid values: %r{\d+}

JFS2 block size in bytes, AIX only.

atboot

Valid values: true, false

Specify whether the file system is mounted at boot time, AIX only

compress

Valid values: LG, no

Data compression, LZ or no. AIX only

device

Device to create the filesystem on, this can be a device or a logical volume. AIX only

encrypted

Valid values: true, false

Specify and encrypted filesystem. AIX only

extended_attributes

Valid values: v1, v2

Format to be used to store extended attributes. AIX only

frag

Valid values: %r{\d+}

JFS fragment size in bytes. AIX only

fs_type

The file system type. eg. ext3.

initial_size

Initial size of the filesystem, Used only for resource creation, when using this option Puppet will not manage or maintain the size. To resize filesystems see the size property. AIX only.

isnapshot

Valid values: true, false

Specify whether the filesystem supports internal snapshots, AIX only

large_files

Valid values: true, false

Large file enabled file system. AIX only

log_partitions

Specify the size of the log logical volume as number of logical partitions, AIX only

logname

Configure the log logical volume. AIX only

logsize

Valid values: %r{\d+}

Size for an inline log in MB, AIX only

maxext

Valid values: %r{\d+}

Size of a file extent in file system blocks, AIX only

mkfs_cmd

Command to use to create the file system. Defaults to mkswap for fs_type=swap, otherwise mkfs.{{fs_type}}

mount_options

Specify the options to be passed to the mount command. AIX only

mountgroup

Mount group for the filesystem, AIX only

mountguard

Valid values: true, false

Enable the mountguard. AIX only

name

namevar

Resource name

nbpi

Valid values: %r{\d+}

Bytes per inode. AIX only

nodename

Specify the remote host where the filesystem resides. AIX only

options

Params for the mkfs command. eg. -l internal,agcount=x

perms

Valid values: ro, rw

Permissions for the filesystem, AIX only

provider

The specific backend to use for this filesystem resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

vix

Valid values: true, false

Specify that the file system can allocate inode extents smaller than the default, AIX only

volume_group

Volume group that the file system should be created on. AIX only.

logical_volume

Logical volume resource type

Properties

The following properties are available in the logical_volume type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

mirror

The number of mirrors of the volume.

mirrorlog

Valid values: core, disk, mirrored

How to store the mirror log (core, disk, mirrored).

size

The size of the logical volume. Set to undef to use all available space

stripes

The number of stripes to allocate for the new logical volume.

volume_group

The volume group name associated with this logical volume. This will automatically set this volume group as a dependency, but it must be defined elsewhere using the volume_group resource type.

Parameters

The following parameters are available in the logical_volume type.

alloc

Valid values: anywhere, contiguous, cling, inherit, normal

Selects the allocation policy when a command needs to allocate Physical Extents from the Volume Group.

extents

The number of logical extents to allocate for the new logical volume. Set to undef to use all available space

initial_size

The initial size of the logical volume. This will only apply to newly-created volumes

minor

Set the minor number

name

namevar

The name of the logical volume. This is the unqualified name and will be automatically added to the volume group's device path (e.g., '/dev/$vg/$lv').

no_sync

An optimization in lvcreate, at least on Linux.

persistent

Set to true to make the block device persistent

poolmetadatasize

Change the size of logical volume pool metadata

provider

The specific backend to use for this logical_volume resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

range

Sets the inter-physical volume allocation policy. AIX only

readahead

The readahead count to use for the new logical volume.

region_size

A mirror is divided into regions of this size (in MB), the mirror log uses this granularity to track which regions are in sync. CAN NOT BE CHANGED on already mirrored volume. Take your mirror size in terabytes and round up that number to the next power of 2, using that number as the -R argument.

resize_fs

Whether or not to resize the underlying filesystem when resizing the logical volume.

Default value: true

size_is_minsize

Set to true if the 'size' parameter specified, is just the minimum size you need (if the LV found is larger then the size requests this is just logged not causing a FAIL)

Default value: false

stripesize

The stripesize to use for the new logical volume.

thinpool

Set to true to create a thin pool or to pool name to create thin volume

Default value: false

type

Configures the logical volume type.

yes_flag

If set to true, do not prompt for confirmation interactively but always assume the answer yes.

Default value: false

physical_volume

Physical volume resource type

Properties

The following properties are available in the physical_volume type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

Parameters

The following parameters are available in the physical_volume type.

force

Valid values: true, false

Force the creation without any confirmation.

Default value: false

name

namevar

Resource name

provider

The specific backend to use for this physical_volume resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

unless_vg

Do not do anything if the VG already exists. The value should be the name of the volume group to check for.

volume_group

Volume group resource type

Properties

The following properties are available in the volume_group type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

physical_volumes

The list of physical volumes to be included in the volume group; this will automatically set these as dependencies, but they must be defined elsewhere using the physical_volume resource type.

Parameters

The following parameters are available in the volume_group type.

createonly

Valid values: true, false, yes, no

Aliases: "yes"=>"true", "no"=>"false"

If set to true the volume group will be created if it does not exist. If the volume group does exist no action will be taken. Defaults to false.

Default value: false

extent_size

The physical extent size. Uses OS default if not provided. Only applicable on Linux.

followsymlinks

Valid values: true, false, yes, no

Aliases: "yes"=>"true", "no"=>"false"

If set to true all current and wanted values of the physical_volumes property will be followed to their real files on disk if they are in fact symlinks. This is useful to have Puppet determine what the actual PV device is if the property value is a symlink, like '/dev/disk/by-path/xxxx -> ../../sda'. Defaults to False.

Default value: false

name

namevar

The name of the volume group.

provider

The specific backend to use for this volume_group resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

Functions

lvm::bytes_to_size

Type: Puppet Language

Convert a number of bytes to a size format that LVM can understand

Examples

Return 200g
lvm::bytes_to_size(214748364800)

lvm::bytes_to_size(Numeric $size)

The lvm::bytes_to_size function.

Returns: Any LVM-formatted size

Examples
Return 200g
lvm::bytes_to_size(214748364800)
size

Data type: Numeric

lvm::size_to_bytes

Type: Puppet Language

Convert an LVM size to bytes, the opposite of lvm::bytes_to_size

lvm::size_to_bytes(String $size)

The lvm::size_to_bytes function.

Returns: Any byte value of LVM-formatted size

size

Data type: String

Tasks

ensure_fs

Ensures settings on a filesystem using the type & provider

Supports noop? false

Parameters

fs_type

Data type: String

The file system type. eg. ext3.

name

Data type: String

Fully qualified name

mkfs_cmd

Data type: Optional[String]

Command to use to create the file system. Defaults to mkswap for fs_type=swap, otherwise mkfs.{{fs_type}}

options

Data type: Optional[String]

Params for the mkfs command. eg. -l internal,agcount=x

initial_size

Data type: Optional[String]

Initial size of the filesystem, Used only for resource creation, when using this option Puppet will not manage or maintain the size. To resize filesystems see the size property. AIX only.

size

Data type: Optional[String]

Configures the size of the filesystem. Supports filesystem resizing. The size will be rounded up to the nearest multiple of the partition size. AIX only.

ag_size

Data type: Optional[Integer]

Specify the allocation group size in megabytes, AIX only.

large_files

Data type: Optional[Boolean]

Large file enabled file system. AIX only

compress

Data type: Optional[Enum[LG,no]]

Data compression, LZ or no. AIX only

frag

Data type: Optional[Integer]

JFS fragment size in bytes. AIX only

nbpi

Data type: Optional[Integer]

Bytes per inode. AIX only

logname

Data type: Optional[String]

Configure the log logical volume. AIX only

logsize

Data type: Optional[Integer]

Size for an inline log in MB, AIX only

maxext

Data type: Optional[Integer]

Size of a file extent in file system blocks, AIX only

mountguard

Data type: Optional[Boolean]

Enable the mountguard. AIX only

agblksize

Data type: Optional[Integer]

JFS2 block size in bytes, AIX only

extended_attributes

Data type: Optional[Enum[v1,v2]]

Format to be used to store extended attributes. AIX only

encrypted

Data type: Optional[Boolean]

Specify and encrypted filesystem. AIX only

isnapshot

Data type: Optional[Boolean]

Specify whether the filesystem supports internal snapshots, AIX only

mount_options

Data type: Optional[String]

Specify the options to be passed to the mount command. AIX only

vix

Data type: Optional[Boolean]

Specify that the file system can allocate inode extents smaller than the default, AIX only

log_partitions

Data type: Optional[String]

Specify the size of the log logical volume as number of logical partitions, AIX only

nodename

Data type: Optional[String]

Specify the remote host where the filesystem resides. AIX only

accounting

Data type: Optional[Boolean]

Specify accounting subsystem support, AIX only

mountgroup

Data type: Optional[String]

Mount group for the filesystem, AIX only

atboot

Data type: Optional[Boolean]

Specify whether the file system is mounted at boot time, AIX only

perms

Data type: Optional[Enum[ro,rw]]

Permissions for the filesystem, AIX only

device

Data type: Optional[String]

Device to create the filesystem on, this can be a device or a logical volume. AIX only

volume_group

Data type: Optional[String]

Volume group that the file system should be created on. AIX only.

ensure_lv

Ensures settings on a logical volume using the type & provider

Supports noop? false

Parameters

ensure

Data type: Enum[present,absent]

Present or absent

name

Data type: String[1]

The name of the logical volume. This is the unqualified name and will be automatically added to the volume group's device path (e.g., '/dev/$vg/$lv').

volume_group

Data type: Optional[String[1]]

The volume group name associated with this logical volume

size

Data type: Optional[Pattern[/^[0-9]+(\.[0-9]+)?[KMGTPEkmgtpe]/]]

The size of the logical volume. Set to undef to use all available space

extents

Data type: Optional[Pattern[/^\d+(%(?:vg|pvs|free|origin)?)?$/]]

The number of logical extents to allocate for the new logical volume. Set to undef to use all available space

persistent

Data type: Optional[Boolean]

Set to true to make the block device persistent

thinpool

Data type: Optional[Boolean]

Set to true to create a thin pool or to pool name to create thin volume

poolmetadatasize

Data type: Optional[Pattern[/^[0-9]+(\.[0-9]+)?[KMGTPEkmgtpe]/]]

Change the size of logical volume pool metadata

minor

Data type: Optional[Integer[0,255]]

Set the minor number

type

Data type: Optional[String[1]]

Configures the logical volume type

range

Data type: Optional[Enum[maximum,minimum]]

Sets the inter-physical volume allocation policy. AIX only

stripes

Data type: Optional[Integer]

The number of stripes to allocate for the new logical volume

stripesize

Data type: Optional[Integer]

The stripesize to use for the new logical volume

readahead

Data type: Optional[String]

The readahead count to use for the new logical volume

resize_fs

Data type: Optional[Boolean]

Whether or not to resize the underlying filesystem when resizing the logical volume

mirror

Data type: Optional[Integer[0,4]]

The number of mirrors of the volume

mirrorlog

Data type: Optional[Enum[core,disk,mirrored]]

How to store the mirror log

alloc

Data type: Optional[Enum[anywhere,contiguous,cling,inherit,normal]]

Selects the allocation policy when a command needs to allocate Physical Extents from the Volume Group

no_sync

Data type: ``

An optimization in lvcreate, at least on Linux

region_size

Data type: Optional[Integer]

A mirror is divided into regions of this size (in MB), the mirror log uses this granularity to track which regions are in sync. CAN NOT BE CHANGED on already mirrored volume. Take your mirror size in terabytes and round up that number to the next power of 2, using that number as the -R argument.

yes_flag

Data type: Boolean

If set to true, do not prompt for confirmation interactively but always assume the answer yes.

ensure_pv

Ensures settings on a physical volumes using the type & provider

Supports noop? false

Parameters

name

Data type: String[1]

The name of the physical volume

ensure

Data type: Enum[present,absent]

Present or absent

unless_vg

Data type: Optional[String]

Do not do anything if the VG already exists. The value should be the name of the volume group to check for.

force

Data type: Optional[Boolean]

Force the creation without any confirmation

ensure_vg

Ensures settings on a volume group using the type & provider

Supports noop? false

Parameters

name

Data type: String[1]

The name of the volume group

ensure

Data type: Enum[present,absent]

Present or absent

createonly

Data type: Optional[Boolean]

If set to true the volume group will be created if it does not exist. If the volume group does exist no action will be taken

followsymlinks

Data type: Optional[Boolean]

If set to true all current and wanted values of the physical_volumes property will be followed to their real files on disk if they are in fact symlinks. This is useful to have Puppet determine what the actual PV device is if the property value is a symlink, like '/dev/disk/by-path/xxxx -> ../../sda'

physical_volumes

Data type: Array[String]

The list of physical volumes to be included in the volume group

extend_lv

Extends a logical volume

Supports noop? false

Parameters

size

Data type: String[1]

Intended size or 'full'

logical_volume

Data type: String[1]

Name of the logical volume to extend

volume_group

Data type: String[1]

Name of the volume group on which the logical volume resides

extend_vg

Adds physical volumes to a volume group

Supports noop? false

Parameters

volume_group

Data type: String[1]

The name of the volume group

physical_volumes

Data type: Array[String]

The list of physical volumes to be included in the volume group

mount_lv

Mounts a logical volume

Supports noop? false

Parameters

volume_group

Data type: String[1]

The name of the volume group

logical_volume

Data type: String[1]

The name of the logical_volume to mount

mountpoint

Data type: String[1]

Where to mount the logical volume

fstype

Data type: String

The mount type. Valid values depend on the operating system. This is a required option.

options

Data type: Optional[String]

A single string containing options for the mount, as they would appear in fstab on Linux. For many platforms this is a comma-delimited string

atboot

Data type: Optional[Boolean]

Whether to mount the mount at boot. Not all platforms support this.

owner

Data type: Optional[String]

Owner for the mountpoint

group

Data type: Optional[String]

Group for the mountpoint

mode

Data type: Optional[String]

Permissions for the mountpoint

Plans

lvm::expand

An opinionated method for expanding storage on machines that use LVM. If this doesn't fit your needs, simply tie the tasks together in some way that does.

Parameters

The following parameters are available in the lvm::expand plan:

server

Data type: String

The target for the plan

volume_group

Data type: String

The volume group to which the logical volume belongs

logical_volume

Data type: String

The logical volume which is to be expanded

additional_size

Data type: String

How much size to add to the LV. This should be specified in LVM format i.e. "200m" or "2.5g"

disks

Data type: Array[String]

Any physical disks that should be added to the volume group as part of the expand process

Default value: []

resize_fs

Data type: Boolean

Wheather or not to resize the filesystem

Default value: true