- Description
- Setup - The basics of getting started with chattr
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This module contains the chattr
custom type to add or remove file attributes from a file on a Linux filesystem. One of the most useful file attributes that can be managed with this type is immutable
to prevent any future modification of the file.
The module contains a custom type so pluginsync must be enabled.
Set the immutable file attribute for a configuration file that should not be modified after the initial installation:
chattr { '/etc/machine-id':
immutable => true,
}
The type implements an optional boolean parameter for each file attribute. The current setting for the file attribute will not be changed if you leave the parameter unset.
Setting the parameter to true
will set the attribute and setting the parameter to false
will remove the attribute from the file.
The module does not yet support all available file attributes.
Some file attributes are read-only and can't be changed.
Also note that different file systems might support different subsets of the available file attributes. Check if the intended file attribute is really available on your system.
Feel free to open issues or pull requests on Github.