Skip to content

Commit 7a44ee0

Browse files
author
Riccardo Calixte
committed
Updating for Puppet 4.0
Dropping support for el5 Sorting values in updatedb.conf
1 parent d700865 commit 7a44ee0

File tree

20 files changed

+285
-268
lines changed

20 files changed

+285
-268
lines changed

.fixtures.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ fixtures:
22
forge_modules:
33
stdlib:
44
repo: 'puppetlabs/stdlib'
5-
ref: '4.3.2'
5+
ref: '4.13.1'
66
symlinks:
7-
"mlocate": "#{source_dir}"
7+
mlocate: "#{source_dir}"

.sync.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
spec/spec_helper.rb:
3+
mock_with: ':rspec'
4+
hiera_config: "'spec/fixtures/hiera.yaml'"

.travis.yml

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,23 @@
11
language: ruby
2+
cache: bundler
23
bundler_args: --without development system_tests
3-
before_install: rm Gemfile.lock || true
4-
script: bundle exec rake test
4+
before_install:
5+
- rm -f Gemfile.lock || true
6+
script:
7+
- 'bundle exec rake $CHECK'
58
sudo: false
6-
rvm:
7-
- 1.9.3
8-
- 2.0.0
9-
- 2.1.0
10-
11-
env:
12-
- PUPPET_VERSION="~> 3.4.0"
13-
- PUPPET_VERSION="~> 3.5.0" STRICT_VARIABLES=yes
14-
- PUPPET_VERSION="~> 3.6.0" STRICT_VARIABLES=yes
15-
- PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes
16-
- PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes
17-
- PUPPET_VERSION="~> 4.0.0" STRICT_VARIABLES=yes
18-
- PUPPET_VERSION="~> 4.1.0"
19-
- PUPPET_VERSION="~> 4.2.0"
20-
- PUPPET_VERSION="~> 4.3.0"
21-
229
matrix:
23-
exclude:
24-
- rvm: 1.9.3
25-
env: PUPPET_VERSION="~> 4.0.0"
26-
- rvm: 1.9.3
27-
env: PUPPET_VERSION="~> 4.1.0"
28-
- rvm: 1.9.3
29-
env: PUPPET_VERSION="~> 4.2.0"
30-
- rvm: 1.9.3
31-
env: PUPPET_VERSION="~> 4.3.0"
32-
- rvm: 2.0.0
33-
env: PUPPET_VERSION="~> 4.0.0"
34-
- rvm: 2.0.0
35-
env: PUPPET_VERSION="~> 4.1.0"
36-
- rvm: 2.0.0
37-
env: PUPPET_VERSION="~> 4.2.0"
38-
- rvm: 2.0.0
39-
env: PUPPET_VERSION="~> 4.3.0"
40-
- rvm: 2.1.0
41-
env: PUPPET_VERSION="~> 3.4.0"
10+
fast_finish: true
11+
include:
12+
- rvm: 2.1.9
13+
bundler_args: --without system_tests development
14+
env: PUPPET_VERSION="~> 4.10" CHECK=test
15+
- rvm: 2.4.4
16+
bundler_args: --without system_tests development
17+
env: PUPPET_VERSION="~> 5.6" CHECK=test
18+
- rvm: 2.5.1
19+
bundler_args: --without system_tests development
20+
env: PUPPET_VERSION="~> 6.1" CHECK=rubocop
4221
notifications:
4322
email:
4423

Gemfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ source "https://rubygems.org"
22

33
group :test do
44
gem 'rake'
5-
gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.8.0'
6-
gem 'rspec-puppet', git: 'https://github.com/rodjek/rspec-puppet.git'
5+
gem 'puppet', ENV['PUPPET_VERSION']
6+
gem 'rspec-puppet'
77
gem 'puppetlabs_spec_helper'
8-
gem 'metadata-json-lint', '~> 1.0.0' if RUBY_VERSION < '2.0.0'
9-
gem 'metadata-json-lint' if RUBY_VERSION >= '2.0.0'
8+
gem 'metadata-json-lint'
109
gem 'rspec-puppet-facts'
10+
gem 'rspec-puppet-utils'
1111
gem 'rspec'
1212
gem 'puppet-blacksmith'
13-
gem 'rubocop', '~> 0.39.0' if RUBY_VERSION < '2.0.0'
14-
gem 'rubocop' if RUBY_VERSION >= '2.0.0'
13+
gem 'rubocop'
14+
gem 'rubocop-rspec'
1515
gem 'puppet-lint-absolute_classname-check'
1616
gem 'puppet-lint-leading_zero-check'
1717
gem 'puppet-lint-trailing_comma-check'
1818
gem 'puppet-lint-version_comparison-check'
1919
gem 'puppet-lint-classes_and_types_beginning_with_digits-check'
2020
gem 'puppet-lint-unquoted_string-check'
2121
gem 'puppet-lint-variable_contains_upcase'
22-
gem 'json_pure', '~> 1.x'
22+
gem 'json_pure'
2323
end
2424

2525
group :development do

README.md

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/adamcrews/puppet-mlocate.svg)](https://travis-ci.org/adamcrews/puppet-mlocate)
44
[![Puppet Forge](http://img.shields.io/puppetforge/v/adamcrews/mlocate.svg)](http://forge.puppetlabs.com/adamcrews/mlocate)
5+
[![License (Apache 2.0)](https://img.shields.io/badge/license-Apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)
56

67
#### Table of Contents
78

@@ -23,7 +24,6 @@
2324
7. [Contributors](#contributors)
2425

2526
## Overview
26-
2727
Install and manage the mlocate/updatedb package.
2828

2929
## Module Description
@@ -48,7 +48,7 @@ Everything can be configured via the default mlocate class.
4848

4949
## Usage
5050

51-
Basic usage that will result is a setup very close to a default CentOS configuration
51+
Basic usage that will result is a setup very close to a default RedHat configuration
5252

5353
```puppet
5454
include ::mlocate
@@ -72,83 +72,85 @@ class { '::mlocate':
7272

7373
#### Private Classes
7474

75-
* mlocate::params: default parameters.
7675
* mlocate::install: install and configure the software.
7776
* mlocate::cron: setup the cron job.
7877

79-
###Parameters
78+
### Parameters
8079

8180
The following parameters are available as options to the default mlocate class.
8281

83-
####`package_name`
84-
85-
The name of the package to install. Default: mlocate
86-
87-
####`package_ensure`
88-
89-
Ensure the package is present, latest, or absent. Default: present
90-
91-
####`update_command`
92-
93-
The name of the updatedb wrapper script. Default: /usr/local/bin/mlocate.cron
94-
95-
####`update_on_install`
96-
97-
Run an initial update when the package is installed. Default: true
98-
99-
####`conf_file`
82+
#### `package_name`
83+
The name of the package to install.
84+
**Default: 'mlocate'**
10085

101-
The configuration file for updatedb. Default: /etc/updatedb.conf
86+
#### `package_ensure`
87+
Ensure the package is 'present', 'absent', or 'latest'.
88+
**Default: 'present'**
10289

103-
####`cron_ensure`
90+
#### `update_command`
91+
The name of the updatedb wrapper script.
92+
**Default: '/usr/local/bin/mlocate.cron'**
10493

105-
Ensure the cron jobs is present or absent. Default: present
94+
#### `update_on_install`
95+
Run an initial update when the package is installed.
96+
**Default: true**
10697

107-
####`cron_schedule`
98+
#### `conf_file`
99+
The configuration file for updatedb.
100+
**Default: '/etc/updatedb.conf'**
108101

109-
The standard cron time schedule. Default: once a week based on fqdn_rand
102+
#### `cron_ensure`
103+
Ensure the cron jobs is present or absent.
104+
**Default: 'present'**
110105

111-
####`cron_daily_path`
106+
#### `cron_schedule`
107+
The standard cron time schedule.
108+
**Default: once a week based on *fqdn_rand* **
112109

113-
The path to cron.daily file installed by mlocate and that is removed
110+
#### `cron_daily_path`
111+
The path to cron.daily file installed by mlocate and that is removed.
112+
**Default: '/etc/cron.daily/mlocate.cron' or '/etc/cron.daily/mlocate' (depending on OS version)**
114113

115-
####`prune_bind_mounts`
116-
117-
Prune out bind mounts or not. Default: yes
114+
#### `prune_bind_mounts`
115+
Prune out bind mounts or not.
116+
*Optional value*
117+
**Default: 'yes'**
118118
Refer to the updatedb.conf man page for more detail.
119-
On redhat 5 systems defaults to none.
120-
121-
####`prunenames`
122119

123-
Prune out directories matching this pattern. Default: .git .hg .svn
120+
#### `prunenames`
121+
Prune out directories matching this pattern.
122+
*Optional value*
123+
**Default: '.git .hg .svn'**
124124
Refer to the updatedb.conf man page for more detail.
125-
On redhat 5 systems defaults to none.
126-
127-
####`extra_prunenames`
128-
129-
Prune out additional directories matching this pattern. Default: none
130125

131-
####`prunefs`
126+
#### `extra_prunenames`
127+
Prune out additional directories matching this pattern.
128+
*Optional value*
129+
**Default: undef**
132130

133-
Prune out these FS types. Default: refer to the params.pp
131+
#### `prunefs`
132+
Prune out these filesystem types.
133+
**Default: refer to `mlocate::prunefs` in *data/common.yaml* **
134134
Refer to the updatedb.conf man page for more detail.
135135

136-
####`extra_prunefs`
136+
#### `extra_prunefs`
137+
Prune out additional filesystem types matching this pattern.
138+
*Optional value*
139+
**Default: undef**
137140

138-
Prune out additional directories matching this pattern. Default: none
139-
140-
####`prunepaths`
141-
142-
Prune out paths matching this pattern. Default: refer to params.pp
141+
#### `prunepaths`
142+
Prune out paths matching this pattern.
143+
**Default: refer to `mlocate::prunepaths` in *data/common.yaml* **
143144
Refer to the updatedb.conf man page for more detail.
144145

145-
####`extra_prunepaths`
146-
147-
Prune out additional directories matching this pattern. Default: none
146+
#### `extra_prunepaths`
147+
Prune out additional paths matching this pattern.
148+
*Optional value*
149+
**Default: undef**
148150

149151
## Limitations
150152

151-
This has only been tested on CentOS 6.5, but should work fine on any RHEL based system, versions 4+
153+
This has only been tested on CentOS 6 and RedHat 6/7, but should work fine on any supported RHEL-based system.
152154

153155
## Development
154156

@@ -165,4 +167,3 @@ With the 0.3.0 release, the cron job times will likely change as an extra seed a
165167
## Contributors
166168

167169
Contributors can be found on github.
168-

Rakefile

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
require 'puppetlabs_spec_helper/rake_tasks'
2-
require 'puppet/version'
3-
require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f < 3.6
1+
require 'rubygems'
2+
require 'bundler/setup'
3+
44
require 'puppet-lint/tasks/puppet-lint'
55
require 'puppet-syntax/tasks/puppet-syntax'
6+
require 'puppet/version'
7+
require 'puppetlabs_spec_helper/rake_tasks'
68

79
# These gems aren't always present, for instance
810
# on Travis with --without development
@@ -14,14 +16,10 @@ end
1416
Rake::Task[:lint].clear
1517

1618
PuppetLint.configuration.relative = true
17-
PuppetLint.configuration.send("disable_80chars")
19+
PuppetLint.configuration.send('disable_80chars')
1820
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
1921
PuppetLint.configuration.fail_on_warnings = true
20-
21-
# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
22-
# http://puppet-lint.com/checks/class_parameter_defaults/
2322
PuppetLint.configuration.send('disable_class_parameter_defaults')
24-
# http://puppet-lint.com/checks/class_inherits_from_params_class/
2523
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
2624

2725
exclude_paths = [
@@ -43,14 +41,10 @@ task :contributors do
4341
system("git log --format='%aN' | sort -u > CONTRIBUTORS")
4442
end
4543

46-
task :metadata do
47-
sh "metadata-json-lint metadata.json"
48-
end
49-
5044
desc "Run syntax, lint, and spec tests."
5145
task :test => [
5246
:syntax,
5347
:lint,
5448
:spec,
55-
:metadata,
49+
:metadata_lint,
5650
]

data/RedHat_6.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
mlocate::cron_daily_path: '/etc/cron.daily/mlocate.cron'

data/RedHat_7.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
mlocate::cron_daily_path: '/etc/cron.daily/mlocate'

data/RedHat_8.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
mlocate::cron_daily_path: '/etc/cron.daily/mlocate'

data/common.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
mlocate::package_name: 'mlocate'
3+
mlocate::package_ensure: 'present'
4+
mlocate::update_command: '/usr/local/bin/mlocate.cron'
5+
mlocate::deploy_update_command: true
6+
mlocate::update_on_install: true
7+
mlocate::conf_file: '/etc/updatedb.conf'
8+
mlocate::cron_ensure: 'present'
9+
mlocate::prune_bind_mounts: 'yes'
10+
mlocate::prunefs:
11+
- '9p'
12+
- 'afs'
13+
- 'anon_inodefs'
14+
- 'auto'
15+
- 'autofs'
16+
- 'bdev'
17+
- 'binfmt_misc'
18+
- 'cgroup'
19+
- 'cifs'
20+
- 'coda'
21+
- 'configfs'
22+
- 'cpuset'
23+
- 'debugfs'
24+
- 'devpts'
25+
- 'ecryptfs'
26+
- 'exofs'
27+
- 'fuse'
28+
- 'fuse.glusterfs'
29+
- 'fusectl'
30+
- 'gfs'
31+
- 'gfs2'
32+
- 'hugetlbfs'
33+
- 'inotifyfs'
34+
- 'iso9660'
35+
- 'jffs2'
36+
- 'lustre'
37+
- 'mqueue'
38+
- 'ncpfs'
39+
- 'nfs'
40+
- 'nfs4'
41+
- 'nfsd'
42+
- 'pipefs'
43+
- 'proc'
44+
- 'ramfs'
45+
- 'rootfs'
46+
- 'rpc_pipefs'
47+
- 'securityfs'
48+
- 'selinuxfs'
49+
- 'sfs'
50+
- 'sockfs'
51+
- 'sysfs'
52+
- 'tmpfs'
53+
- 'ubifs'
54+
- 'udf'
55+
- 'usbfs'
56+
mlocate::prunenames:
57+
- '.git'
58+
- '.hg'
59+
- '.svn'
60+
mlocate::prunepaths:
61+
- '/afs'
62+
- '/media'
63+
- '/net'
64+
- '/sfs'
65+
- '/tmp'
66+
- '/udev'
67+
- '/var/cache/ccache'
68+
- '/var/spool/cups'
69+
- '/var/spool/squid'
70+
- '/var/tmp'

0 commit comments

Comments
 (0)