Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ fixtures:
repositories:
stdlib:
repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '3.2.0'
ref: '4.6.0'
symlinks:
chattr: "#{source_dir}"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ spec/reports
test/tmp
test/version_tmp
tmp
Gemfile.lock

# YARD artifacts
.yardoc
Expand All @@ -27,4 +28,4 @@ doc/
# Puppet
coverage/
spec/fixtures/modules/*
spec/fixtures/
spec/fixtures
59 changes: 47 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,50 @@
---
language: ruby

rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- 2.1.0

env:
- PUPPET_VERSION=3.3.2
- PUPPET_VERSION=3.4.2
- PUPPET_VERSION=3.5.1
matrix:
- PUPPET_GEM_VERSION="~> 3.1"
- PUPPET_GEM_VERSION="~> 3.2"
- PUPPET_GEM_VERSION="~> 3.3"
- PUPPET_GEM_VERSION="~> 3.4"
- PUPPET_GEM_VERSION="~> 3.5"
- PUPPET_GEM_VERSION="~> 3.6"
- PUPPET_GEM_VERSION="~> 3.7"
- PUPPET_GEM_VERSION="~> 3.8"
- PUPPET_GEM_VERSION="~> 3" PARSER="future"
- PUPPET_GEM_VERSION="~> 4.0"
- PUPPET_GEM_VERSION="~> 4.1"
- PUPPET_GEM_VERSION="~> 4"

sudo: false

script: 'bundle exec metadata-json-lint metadata.json && bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec'

matrix:
fast_finish: true
exclude:
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.1"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.1"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.2"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.3"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.4"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.1"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4"

notifications:
email: false
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
language: ruby
before_script: "gem install --no-ri --no-rdoc bundler"
script: 'bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec'
gemfile: Gemfile
email: false
19 changes: 15 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
source "https://rubygems.org"
source 'https://rubygems.org'

puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3']
gem 'puppet', puppetversion
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end

gem 'metadata-json-lint'
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint', '>= 0.3.2'
gem 'puppet-lint', '>= 1.0.0'
gem 'facter', '>= 1.7.0'
gem 'rspec-puppet'

# rspec must be v2 for ruby 1.8.7
if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9'
gem 'rspec', '~> 2.0'
end
10 changes: 0 additions & 10 deletions Modulefile

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Hack to get around Puppet's inability to manage files with the immutable attribu

# Compatibility
---------------
This module is built for use with Puppet v3 with Ruby versions 1.8.7, 1.9.3, and 2.0.0 on all Linux systems.
This module is built for use with Puppet v4 and v3 (with and without future
parser) with Ruby versions 1.8.7, 1.9.3, 2.0.0 and 2.1.0 on all Linux systems.

===

Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.relative = true
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]

desc "Validate manifests, templates, and ruby files"
desc 'Validate manifests, templates, and ruby files'
task :validate do
Dir['manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$attribute_removes_hiera_merge = true,
) {

if type($attribute_adds_hiera_merge) == 'string' {
if type3x($attribute_adds_hiera_merge) == 'string' {
$attribute_adds_hiera_merge_real = str2bool($attribute_adds_hiera_merge)
} else {
$attribute_adds_hiera_merge_real = $attribute_adds_hiera_merge
Expand All @@ -28,7 +28,7 @@
create_resources('chattr::attribute_add',$attribute_adds_real)
}

if type($attribute_removes_hiera_merge) == 'string' {
if type3x($attribute_removes_hiera_merge) == 'string' {
$attribute_removes_hiera_merge_real = str2bool($attribute_removes_hiera_merge)
} else {
$attribute_removes_hiera_merge_real = $attribute_removes_hiera_merge
Expand Down
87 changes: 87 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"name": "kinneygroup-chattr",
"version": "0.1.0",
"author": "kinneygroup",
"summary": "deal with immutable attribute bug",
"license": "Apache-2.0",
"source": "git://github.com/kinneygroup/puppet-module-chattr.git",
"project_page": "https://github.com/kinneygroup/puppet-module-chattr",
"issues_url": "https://github.com/kinneygroup/puppet-module-chattr/issues",
"description": "manage chattr attributes",
"requirements": [
{
"name": "pe",
"version_requirement": ">= 3.2.0 < 5.0.0"
},
{
"name": "puppet",
"version_requirement": ">= 3.0.0 < 5.0.0"
}
],
"operatingsystem_support": [
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"6"
]
},
{
"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": "SLES",
"operatingsystemrelease": [
"10",
"11",
"12"
]
},
{
"operatingsystem": "SLED",
"operatingsystemrelease": [
"10",
"11",
"12"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"12.04",
"14.04"
]
}
],
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0"}
]
}
7 changes: 6 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
require 'rubygems'
require 'puppetlabs_spec_helper/module_spec_helper'

RSpec.configure do |config|
config.before :each do
Puppet[:parser] = 'future' if ENV['PARSER'] == 'future'
end
end