From bf9eafd66f15f24707155b494ff60af63ffe71b6 Mon Sep 17 00:00:00 2001 From: Erez Zarum Date: Tue, 20 Dec 2016 22:04:50 +0200 Subject: [PATCH] Initialize --- README.md | 18 ++++++++++++ manifests/init.pp | 8 ++++++ manifests/mount.pp | 62 +++++++++++++++++++++++++++++++++++++++ metadata.json | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 160 insertions(+) create mode 100644 README.md create mode 100644 manifests/init.pp create mode 100644 manifests/mount.pp create mode 100644 metadata.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..57812bd --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# mountt + +#### Table of Contents + +1. [Overview](#overview) +2. [Module Description](#module-description) +3. [Usage](#usage) +4. [Limitations](#limitations) + +## Overview + +Module for configuring mounts + +## Module Description + +## Usage + +## Limitations \ No newline at end of file diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..f425d7a --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,8 @@ +class mountt ( + $mounts = {} +) { + validate_hash($mounts) + if ($mounts != {}) { + create_resources('::mountt::mount', $mounts) + } +} \ No newline at end of file diff --git a/manifests/mount.pp b/manifests/mount.pp new file mode 100644 index 0000000..053da73 --- /dev/null +++ b/manifests/mount.pp @@ -0,0 +1,62 @@ +define mountt::mount ( + $ensure = 'present', + $mounttab_ensure = undef, + $mount_ensure = undef, + $mounttab = true, + $mount = true, + $remounts = true, + $dump = 1, + $pass = 2, + $atboot = true, + $provider = 'augeas', + $device = undef, + $fstype = undef, + $options = [] +) { + + validate_absolute_path($name) + validate_re($ensure, '^(present|absent)$') + + validate_bool($mounttab) + validate_bool($mount) + validate_bool($remounts) + validate_integer($pass) + validate_string($provider) + validate_string($device) + validate_string($fstype) + validate_array($options) + + $_mounttab_ensure = $mounttab_ensure ? { + undef => $ensure, + default => $mounttab_ensure, + } + validate_re($_mounttab_ensure, '^(present|absent)$') + + $_mount_ensure = $mount_ensure ? { + undef => $ensure, + default => $mount_ensure, + } + validate_re($_mount_ensure, '^(present|absent)$') + + if ($mounttab == true) { + mounttab { $name: + ensure => $_mounttab_ensure, + device => $device, + fstype => $fstype, + options => $options, + dump => $dump, + pass => $pass, + atboot => $atboot, + provider => $provider, + } + } + + if ($mount == true) { + mountpoint { $name: + ensure => $_mount_ensure, + device => $device, + options => $options, + remounts => $remounts, + } + } +} \ No newline at end of file diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..9f9f504 --- /dev/null +++ b/metadata.json @@ -0,0 +1,72 @@ +{ + "name": "erez-mountt", + "version": "0.0.1", + "author": "Erez Zarum", + "summary": "Module to configure mounts", + "license": "Apache-2.0", + "source": "https://github.com/erezzarum/puppet-mountt.git", + "project_page": null, + "issues_url": null, + "dependencies": [ + {"name": "puppetlabs/stdlib","version_requirement": ">= 4.4.0 <5.0.0"}, + {"name": "puppetlabs/mount_providers", "version_requirement": ">= 0.0.3"}, + {"name": "herculesteam/augeasproviders_mounttab","version_requirement": ">= 2.0.0"} + ], + "operatingsystem_support": [ + { + "operatingsystem": "RedHat", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "OracleLinux", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "Scientific", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "Debian", + "operatingsystemrelease": [ + "6", + "7", + "8" + ] + }, + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "10.04", + "12.04", + "14.04" + ] + } + ], + "requirements": [ + { + "name": "puppet", + "version_requirement": ">= 3.0.0 < 5.0.0" + } + ], + "data_provider": null +}