Skip to content

Latest commit

 

History

History
272 lines (158 loc) · 7.4 KB

REFERENCE.md

File metadata and controls

272 lines (158 loc) · 7.4 KB

Reference

Table of Contents

Classes

  • incron: This class manages /etc/incron.allow and /etc/incron.deny and the incrond service.
  • incron::service: This class wraps the incrond service

Defined types

  • incron::system_table: Add a system table $name to /etc/incron.d If multiple path and/or command options are specified, they will be expanded into all matc
  • incron::user: Add the user $name to /etc/incron.allow

Resource types

  • incron_system_table: Creates an 'incrond' compatible system table Line order will be preserved Any paths that contain globs '*' will be expanded into the approp

Data types

Classes

incron

This class manages /etc/incron.allow and /etc/incron.deny and the incrond service.

Parameters

The following parameters are available in the incron class:

package_ensure

Data type: String

The ensure parameter of Package resources in the incron namespace.

Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })

users

Data type: Array[String[1]]

An Array of additional incron users, using the defined type incron::user.

Default value: []

max_open_files

Data type: Variant[Enum['unlimited'],Integer[0]]

The maximum open files limit that should be set for incrond

  • This should generally be left as unlimited since incrond could be watching a great number of events. However, you may need to lower this if you find that it is simply overwhelming your system (and analyze your incrond rules).

Default value: 'unlimited'

system_table

Data type: Hash

Create incron::system_table resources with hiera

Default value: {}

purge

Data type: Boolean

Whether or not to purge unknown incron tables

Default value: false

incron::service

This class wraps the incrond service

Defined types

incron::system_table

Add a system table $name to /etc/incron.d

If multiple path and/or command options are specified, they will be expanded into all matching possibilities.

Examples

Multiplexed Path and Command
incron::system_table { 'test':
  path    => ['/foo/bar', '/foo2/bar2'],
  command => ['/bin/baz', '/bin/baz2']
}

Results in /etc/incron.d/test with contents:
  /foo/bar IN_MODIFY,IN_MOVE,IN_CREATE,IN_DELETE /bin/baz
  /foo/bar IN_MODIFY,IN_MOVE,IN_CREATE,IN_DELETE /bin/baz2
  /foo2/bar2 IN_MODIFY,IN_MOVE,IN_CREATE,IN_DELETE /bin/baz
  /foo2/bar2 IN_MODIFY,IN_MOVE,IN_CREATE,IN_DELETE /bin/baz2
Path Globbing
For the following directory structure:
   /foo/bar/one/one_more/baz/one.txt
   /foo/bar/one/one_other/baz/ignore.me
   /foo/bar/two/baz/two.txt

incron::system_table { 'glob':
  path    => '/foo/bar/**/baz/*.txt',
  command => '/bin/baz'
}

Results in /etc/incron.d/glob with contents:
  /foo/bar/one/one_more/baz/one.txt IN_MODIFY,IN_MOVE,IN_CREATE,IN_DELETE /bin/baz
  /foo/bar/two/baz/two.txt IN_MODIFY,IN_MOVE,IN_CREATE,IN_DELETE /bin/baz

Parameters

The following parameters are available in the incron::system_table defined type:

enable

Data type: Boolean

Whether to enable or disable the table

Default value: true

path

Data type: Optional[Variant[Array[String], String]]

Filesystem path(s) to monitor

  • May contain Ruby Dir.glob compatible Strings

Default value: undef

mask

Data type: Array[String]

Symbolic array or numeric mask for events

Default value: ['IN_MODIFY','IN_MOVE','IN_CREATE','IN_DELETE']

command

Data type: Optional[Variant[Array[String], String]]

Command(s) to run on detection of event in $path

Default value: undef

custom_content

Data type: Optional[String]

Custom content to add to /etc/incron.d/$name. Defining this disables validation on the content and take priority.

Default value: undef

incron::user

Add the user $name to /etc/incron.allow

Resource types

incron_system_table

Creates an 'incrond' compatible system table

Line order will be preserved

Any paths that contain globs '*' will be expanded into the appropriate number of rules based on glob expansion on the target system

Globbed paths that do not result in a valid path expansion will be ignored

Globs starting with /** will also be ignored due to the burden placed on the system

WARNING: TAKE CARE THAT YOU KNOW WHAT YOUR GLOBS WILL EXPAND TO!

Properties

The following properties are available in the incron_system_table type.

ensure

Valid values: present, absent

The state that should be enforced for the table

Default value: present

Parameters

The following parameters are available in the incron_system_table type.

command

The command(s) to apply when the paths change

If multiple paths and commands are specified, they will create multiple lines that contain all possible combinations

content

Raw content to add to the file - Will be validated

mask

The incron "masks" to apply

name

namevar

The filename to use for the table - Non-word characters will be replaced

path

Path(s) to watch and apply the command

provider

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

Data types

Incron::Mask

Valid incron masks

Alias of Enum['IN_ACCESS', 'IN_ALL_EVENTS', 'IN_ATTRIB', 'IN_CLOSE', 'IN_CLOSE_NOWRITE', 'IN_CLOSE_WRITE', 'IN_CREATE', 'IN_DELETE', 'IN_DELETE_SELF', 'IN_DONT_FOLLOW', 'IN_MODIFY', 'IN_MOVE', 'IN_MOVED_FROM', 'IN_MOVED_TO', 'IN_MOVE_SELF', 'IN_NO_LOOP', 'IN_ONESHOT', 'IN_ONLYDIR', 'IN_OPEN', 'loopable=true', 'recursive=false', 'dotdirs=true']