Storage promises refer to disks and filesystem properties.
storage:
"/disk volume or mountpoint"
volume => volume_body,
...;
bundle agent storage
{
storage:
"/usr" volume => mycheck("10%");
"/mnt" mount => nfs("nfsserv.example.org","/home");
}
body volume mycheck(free) # reusable template
{
check_foreign => "false";
freespace => "$(free)";
sensible_size => "10000";
sensible_count => "2";
}
body mount nfs(server,source)
{
mount_type => "nfs";
mount_source => "$(source)";
mount_server => "$(server)";
edit_fstab => "true";
}
[%CFEngine_include_markdown(common-attributes-include.markdown)%]
Type: body mount
See also: [Common Body Attributes][Promise Types and Attributes#Common Body Attributes]
Description: true/false add or remove entries to the file system table (“fstab”)
The default behavior is to not place edits in the file system table.
Type: [boolean
][boolean]
Default value: false
Example:
body mount example
{
edit_fstab => "true";
}
Description: Protocol type of remote file system
Type: (menu option)
Allowed input range:
nfs
nfs2
nfs3
nfs4
panfs
cifs
Example:
[%CFEngine_include_example(storage-cifs.cf)%]
History:
cifs
, panfs
added in 3.15.0Description: Path of remote file system to mount.
This is the location on the remote device, server, SAN etc.
Type: string
Allowed input range: "?(/.*)
Example:
body mount example
{
mount_source "/location/disk/directory";
}
Description: Hostname or IP or remote file system server.
Type: string
Allowed input range: (arbitrary string)
Example:
body mount example
{
mount_server => "nfs_host.example.org";
}
Description: List of option strings to add to the file system table (“fstab”).
This list is concatenated in a form appropriate for the filesystem. The options must be legal options for the system mount commands.
Type: slist
Allowed input range: (arbitrary string)
Example:
body mount example
{
mount_options => { "rw", "acls" };
}
Description: true/false unmount a previously mounted filesystem
Type: [boolean
][boolean]
Default value: false
Example:
body mount example
{
unmount => "true";
}
Type: body volume
See also: [Common Body Attributes][Promise Types and Attributes#Common Body Attributes]
Description: If true, verify storage that is mounted from a foreign system on this host.
CFEngine will not normally perform sanity checks on filesystems that are
not local to the host. If true
it will ignore a partition’s network
location and ask the current host to verify storage located physically
on other systems.
Type: [boolean
][boolean]
Default value: false
Example:
body volume example
{
check_foreign => "true";
}
Description: Absolute or percentage minimum disk space that should be available before warning
The amount of free space that is promised on a storage device. Once this promise is found not to be kept (that is, if the free space falls below the promised value), warnings are generated. You may also want to use the results of this promise to control other promises.
Type: string
Allowed input range: [0-9]+[MBkKgGmb%]
Example:
body volume example1
{
freespace => "10%";
}
body volume example2
{
freespace => "50M";
}
Description: Minimum size in bytes that should be used on a sensible-looking storage device
Type: int
Allowed input range: 0,99999999999
Example:
body volume example
{
sensible_size => "20K";
}
Description: Minimum number of files that should be defined on a sensible-looking storage device.
Files must be readable by the agent. In other words, it is assumed that the agent has privileges on volumes being checked.
Type: int
Allowed input range: 0,99999999999
Example:
body volume example
{
sensible_count => "20";
}
Description: If true, generate pseudo-periodic disk change arrival distribution.
This operation should not be left ‘on’ for more than a single run (maximum once per week). It causes CFEngine to perform an extensive disk scan noting the schedule of changes between files. This can be used for a number of analyses including optimum backup schedule computation.
Type: [boolean
][boolean]
Default value: false
Example:
body volume example
{
scan_arrivals => "true";
}