Skip to content

Latest commit

 

History

History
847 lines (536 loc) · 21.6 KB

REFERENCE.md

File metadata and controls

847 lines (536 loc) · 21.6 KB

Reference

Table of Contents

Classes

Public Classes

  • autofs: Manages the autofs facility, optionally including configuring mount points and maps.

Private Classes

  • autofs::package: The autofs::package class installs the autofs package.
  • autofs::service: The autofs::service class configures the autofs service.

Defined types

  • autofs::map: Defined type to generate autofs map entry configuration files.
  • autofs::mapfile: Defined type to manage overall autofs map files
  • autofs::mapping: Defined type to manage a single filesystem mapping in a single map file.
  • autofs::mount: Defined type to manage mount point definitions in the Autofs master map.

Data types

  • Autofs::Fs_mapping: A type representing a single filesystem mapping, relative to the context provided by an (unspecified) autofs map. "Single" refers to a singl
  • Autofs::Mapentry: This type matches a map specfication with map type and optional format, or the built-in -hosts map.
  • Autofs::Options: A type representing an autofs options list, represented either as a single non-empty string or an array of such strings

Classes

autofs

Autofs mount points and their corresponding maps can also be managed via separate autofs::mount, autofs::mapfile, and autofs::mapping resources.

To use this module, simply declare it in your manifest. The module now supports the ability to not only enable autofs, but to also disable or uninstall it completely.

Examples

Declaring the autofs class
include autofs
Removing the package
class { 'autofs':
  package_ensure => 'absent',
}
Disable the autofs service
class { 'autofs':
  service_ensure => 'stopped',
  service_enable => false,
}
using hiera with automatic lookup
---
autofs::mounts:
  home:
    mount: '/home'
    mapfile: '/etc/auto.home'
    options: '--timeout=120'
    order: 01
autofs::mapfiles:
  '/etc/auto.home':
    'mappings':
      - key: '*'
        options: 'user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl'
        fs: 'server.example.com:/path/to/home/shares'

Parameters

The following parameters are available in the autofs class:

mounts

Data type: Hash[String, Hash]

the options with which to manage the autofs master map

Default value: {}

purge_map_dir

Data type: Boolean

Purge the $map_dir directory of unmanaged

Default value: false

ldap_auth_conf_path

Data type: Stdlib::Absolutepath

The path to the ldap_auth.conf file

Default value: '/etc/autofs_ldap_auth.conf'

ldap_auth_config

Data type: Hash

The hash to use for the configuration settings in the ldap_auth.conf file

Default value: { 'usetls' => 'no', 'tlsrequired' => 'no', 'authrequired' => 'no' }

service_conf_path

Data type: Stdlib::Absolutepath

The path to the service configuration file

Default value: '/etc/sysconfig/autofs'

service_options

Data type: Optional[Array[String]]

An array of options to add to the OPTIONS variable in the service configuration file

Default value: undef

service_conf_options

Data type: Optional[Hash]

A hash of environment variables to add to the service configuration file for LDAP configuration

Default value: undef

mapfiles

Data type: Optional[Hash[String, Hash]]

replace: whether to modify the map file if it already exists

Default value: undef

maps

Data type: Optional[Hash[String, Hash]]

Deprecated. Use the mapfiles parameter instead.

Default value: undef

package_ensure

Data type: String

Determines the state of the package. Can be set to: installed, absent, lastest, or a specific version string.

Default value: 'installed'

package_name

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

Determine the name of the package to install. Should be covered by hieradata.

Default value: 'autofs'

package_source

Data type: Optional[String]

Determine the source of the package, required on certain platforms (AIX)

Default value: undef

service_ensure

Data type: Enum['stopped', 'running']

Determines state of the service. Can be set to: running or stopped.

Default value: 'running'

service_enable

Data type: Boolean

Determines if the service should start with the system boot. true will start the autofs service on boot. false will not start the autofs service on boot.

Default value: true

service_name

Data type: String

Determine the name of the service for cross platform compatibility

Default value: 'autofs'

auto_master_map

Data type: String

Filename of the auto.master map for cross platform compatiblity

Default value: '/etc/auto.master'

map_file_owner

Data type: String

owner of the automount map files for cross platform compatiblity

Default value: 'root'

map_file_group

Data type: String

group of the automount map files for cross platform compatiblity

Default value: 'root'

manage_service_config

Data type: Boolean

Determines if the service configuration file (in /etc/default or /etc/sysconfig) should be managed

Default value: false

manage_ldap_auth_conf

Data type: Boolean

Determines if the /etc/autofs_ldap_auth.conf file should be managed

Default value: false

service_use_misc_device

Data type: Enum['no', 'yes']

Sets the USE_MISC_DEVICE value in the service configuration file

Default value: 'yes'

reload_command

Data type: Optional[String]

In lieu of a service reload capability in Puppet, exec this command to reload automount without restarting it.

Default value: undef

automountd_service_ensure

Data type: Optional[Enum['stopped', 'running']]

Determines state of the service. Can be set to: running or stopped.

Default value: undef

autounmountd_service_ensure

Data type: Optional[Enum['stopped', 'running']]

Determines state of the service. Can be set to: running or stopped.

Default value: undef

automountd_service_name

Data type: Optional[String]

Determine the name of the automountd service for cross platform compatibility

Default value: undef

autounmountd_service_name

Data type: Optional[String]

Determine the name of the autounmountd service for cross platform compatibility

Default value: undef

Defined types

autofs::map

Defined type to generate autofs map entry configuration files.

Examples

Using the autofs::map defined type to setup automount for nfs data directory.
autofs::map { 'data':
  mapcontents => 'mydata -user,rw,soft,intr,rsize=32768,wsize=32768  nfs.example.org:/path/to/some/data',
  mapfile => '/etc/auto.data',
  order   => '01',
}

Parameters

The following parameters are available in the autofs::map defined type:

ensure

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

Whether to create the mapfile or not.

Default value: 'present'

mapcontents

Data type: Variant[Array, String]

The mount point options and parameters, Example: '* -user,rw,soft nfs.example.org:/path/to'

Default value: []

mapfile

Data type: Stdlib::Absolutepath

Name of the "auto." configuration file that will be generated.

Default value: $title

template

Data type: Enum['autofs/auto.map.erb', 'autofs/auto.map.exec.erb']

Template to use to generate the mapfile.

Default value: 'autofs/auto.map.erb'

mapmode

Data type: String

UNIX permissions to be added to the file.

Default value: '0644'

replace

Data type: Boolean

Whether or not to replace an existing mapfile of the same filename/path.

Default value: true

order

Data type: Integer

Order in which entries will appear in the autofs map file.

Default value: 1

autofs::mapfile

Defined type to manage overall autofs map files

Parameters

The following parameters are available in the autofs::mapfile defined type:

ensure

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

Whether the mapfile should be present on the target system

Default value: 'present'

path

Data type: Stdlib::Absolutepath

An absolute path to the map file

Default value: $title

mappings

Data type: Array[Autofs::Fs_mapping]

an array of mappings to enroll in the file. Additional mappings can be specified for this mapfile via autofs::mapping resources

Default value: []

replace

Data type: Boolean

Whether to replace the contents of any an existing file at the specified path

Default value: true

execute

Data type: Boolean

Whether to make the mapfile executable or not

Default value: false

autofs::mapping

When ensured 'present', a autofs::mapfile resource managing the overall target map file must also be present in the catalog. This resource implements Autofs's 'sun' map format, which is the default.

It is not supported to declare multiple autofs::mappings with the same key, targetting the same map file, and ensured 'present'.

Examples

Options given as a string
autofs::mapping{ '/etc/auto.data_data':
  mapfile => '/etc/auto.data',
  key     => 'data',
  options => 'rw,sync,suid',
  fs      => 'storage_host.my.com:/path/to/data'
}
Options given as an array
autofs::mapping{ '/etc/auto.data_data':
  mapfile => '/etc/auto.data',
  key     => 'data',
  options => ['ro', 'noexec', 'nodev'],
  fs      => 'storage_host.my.com:/path/to/data'
}
No options
autofs::mapping{ '/etc/auto.data_data':
  mapfile => '/etc/auto.data',
  key     => 'data',
  fs      => 'storage_host.my.com:/path/to/data'
}

Parameters

The following parameters are available in the autofs::mapping defined type:

ensure

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

Whether the mapping should be present in the target mapfile; ensuring 'absent' is not meaningfully different from omitting the resource declaration altogether

Default value: 'present'

fs

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

the remote filesystem to mount

key

Data type: String[1]

the autofs key for this mapping. For indirect maps it is the basename of the mountpoint directory for $fs (not to be confused with an autofs mount point, which is the parent directory). For direct maps it is the absolute path to the mountpoint directory.

mapfile

Data type: Stdlib::Absolutepath

the absolute path to the file containing the Autofs map to which this mapping belongs

options

Data type: Optional[Autofs::Options]

a comma-delimited mount options string or an array of individual mount options; neither individual options nor the overall option list should be specified with a leading hyphen (-); that is part of the map file format, not of the options themselves, and it is provided by this resource

Default value: undef

order

Data type: Integer

an integer describing the relative order of the mapping represented by this resource within the target map file (default 10). The order matters only if the same kay is enrolled more than once in the map, in which case only the first is effective.

Default value: 10

autofs::mount

autofs::mount { 'home': mount => '/home', mapfile => '/etc/auto.home', options => '--timeout=120', }

autofs::mount { 'smb': mount => '/smb', mapfile => 'program:/etc/auto.smb', options => '--timeout=120', }

Examples

Declaring an autofs mount point for automounting user home directories. (The
corresponding map file needs to be managed separately.)
Declaring a mount point with an executable map (to be managed
separately, if needed).
Remove an entry from the master map (the map file is unaffected)
autofs::mount { '/smb':
  ensure  => 'absent',
  mapfile => 'program:/etc/auto.smb',
}

Parameters

The following parameters are available in the autofs::mount defined type:

ensure

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

Whether a definition of this mount point should be present in the master map. (default: 'present')

Default value: 'present'

mount

Data type: Stdlib::Absolutepath

The absolute path of the Autofs mount point being managed. For a direct map, this should be '/-'. Otherwise, it designates the parent directory of the filesystem mount points managed by the map assigned to this Autofs mount point. (default: the title of this resource)

Default value: $title

mapfile

Data type: Variant[Stdlib::Absolutepath,Autofs::Mapentry]

a designation for the Autofs map associated with this mount point. Typically, this is an absolute path to a map file, whose base name conventionally begins with "auto.", but Autofs recognizes other alternatives, too, that can be specified via this parameter.

master

Data type: Stdlib::Absolutepath

Full path, including filename, to the autofs master map. Usually the correct master map will be chosen automatically, and you will not need to specify this.

Default value: $autofs::auto_master_map

map_dir

Data type: Stdlib::Absolutepath

Full path, including directory name, to the autofs master map's drop-in directory. Relevant only when $use_dir is true. (default: '/etc/auto.master.d').

Default value: '/etc/auto.master.d'

use_dir

Data type: Boolean

If true, autofs will manage this mount via a file in the master map's drop-in directory instead of directly in the master map. The master map will still be managed, however, to ensure at least that it enables the (correct) drop-in directory.

Default value: false

options

Data type: Optional[String]

Options to be specified for the autofs mount point within the master map.

Default value: undef

order

Data type: Integer

The relative order in which entries will appear in the master map. Irrelevant when $use_dir is true.

Default value: 1

Data types

Autofs::Fs_mapping

A type representing a single filesystem mapping, relative to the context provided by an (unspecified) autofs map. "Single" refers to a single key, but not necessarily a single mounted filesystem. Autofs has the concept of a multi-mount, where the map specifies multiple filesystems to mount via a single key, and the concept of shared mounts, where multiple keys reference subdirectories of a single (auto-)mounted file system. This type simply provides for a generic representation of all those alternatives via the 'fs' member.

Examples

Typical mapping for an indirect map
{ 'key' => 'data', 'options' => 'rw,sync', 'fs' => 'fs.host.com:/path/to/data' }
Mapping for a direct map, demonstrating also that the options may be omitted
{ 'key' => '/path/to/mnt', fs => 'remote.org:/exported/path' }
Demonstrating specifying an array of options
{ 'key' => 'other', 'options' => [ 'ro', 'noexec' ], 'fs' => 'external.net:/the/exported/fs' }

Alias of

Struct[{
  key     => String[1],
  options => Optional[Autofs::Options],
  order   => Optional[Integer],
  fs      => Variant[String[1], Array[String[1]]],
}]

Autofs::Mapentry

This type matches a map specfication with map type and optional format, or the built-in -hosts map.

Examples

program:/etc/auto.smb
file:/etc/auto.file
file,sun:/etc/auto.file
yp:mnt.map
-hosts

Alias of Pattern[/\A([a-z]+(,[a-z]+)?:\S+|-hosts)\z/]

Autofs::Options

A type representing an autofs options list, represented either as a single non-empty string or an array of such strings

Alias of Variant[Pattern[/\A\S+\z/], Array[Pattern[/\A\S+\z/]]]