Skip to content

smoeding/puppet-chattr

Repository files navigation

chattr

Build Status Puppet Forge License

Table of Contents

  1. Description
  2. Setup - The basics of getting started with chattr
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

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.

Setup

Setup Requirements

The module contains a custom type so pluginsync must be enabled.

Beginning with chattr

Set the immutable file attribute for a configuration file that should not be modified after the initial installation:

chattr { '/etc/machine-id':
  immutable => true,
}

Usage

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.

Limitations

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.

Development

Feel free to open issues or pull requests on Github.

Languages