Skip to content

Latest commit

 

History

History
606 lines (388 loc) · 14.1 KB

REFERENCE.md

File metadata and controls

606 lines (388 loc) · 14.1 KB

Reference

Table of Contents

Classes

Public Classes

  • autofs: Class: autofs Manages the autofs facility, optionally including configuring mount points and maps. Autofs mount points and their correspond

Private Classes

  • autofs::package: Class: autofs::package The autofs::package class installs the autofs package. This class will determine if the OS running is a supported Li
  • autofs::service: Class: autofs::service The autofs::service class configures the autofs service. This class can be used to disable or limit the autofs servic

Defined types

  • autofs::map: Define: autofs::map Defined type to generate autofs map entry configuration files.
  • autofs::mapfile: Define autofs::mapfile Defined type to manage overall autofs map files
  • autofs::mapping: Define autofs::mapping Defined type to manage a single filesystem mapping in a single map file. When ensured 'present', a autofs::mapfile re
  • autofs::mount: Define: autofs::mount Defined type to manage mount point definitions in the Autofs master map. autofs::mount { 'home': mount

Classes

autofs

Class: autofs

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

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

Options:

  • :mount String: The autofs mount point to be managed
  • :order Integer: The relative order in which the mount point's definition will appear in the master map
  • :mapfile String: Name of the autofs map file for this mount point
  • :options String: Mount options to be recorded for this mount point in the master map
  • :master String: Full path, including file name, to the master map in which to manage this mount point
  • :map_dir String: Full path, including file name, to the master map drop-in directory in which to manage this mount's definition. Relevant only when :use_dir is set to true
  • :use_dir Boolean: Whether to manage this mount via a file in the master map's drop-in directory instead of directly in the master map
mapfiles

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

options with which to manage map files.

Options:

  • path: String: Full path, including file name, to a map file to manage. Defaults to the key with which this value is associated.
  • mappings: Array: an array of hashes defining specific, sun-format mappings that should appear in this map file. Each has a 'key', an option list in string or array form, and a filesystem specification as expected by the 'mount' command.
  • replace: Boolean: 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.

package_name

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

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

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.

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.

service_name

Data type: String

Determine the name of the service for cross platform compatibility

auto_master_map

Data type: String

Filename of the auto.master map for cross platform compatiblity

map_file_owner

Data type: String

owner of the automount map files for cross platform compatiblity

map_file_group

Data type: String

group of the automount map files for cross platform compatiblity

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

Defined types

autofs::map

Define: 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

Define 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

autofs::mapping

Define autofs::mapping

Defined type to manage a single filesystem mapping in a single map file. 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: Pattern[/\S/]

the remote filesystem to mount

key

Data type: Pattern[/\A\S+\z/]

the autofs key for this mappingr. 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

Define: autofs::mount

Defined type to manage mount point definitions in the Autofs master map.

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