diff --git a/.gemfile b/.gemfile deleted file mode 100644 index 2975f3e..0000000 --- a/.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -source 'https://rubygems.org' - -puppetversion = ENV['PUPPET_VERSION'] -gem 'rspec', '~> 3.1.0', :platforms => :ruby_18 -gem 'puppet', puppetversion, :require => false -gem 'puppet-lint' -gem 'puppetlabs_spec_helper', '>= 0.1.0' diff --git a/.gitignore b/.gitignore index 2fe4005..2e69ffc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /.gradle -/metadata.json /.rvmrc build pkg/ @@ -10,3 +9,4 @@ spec/fixtures vendor .bundle .gemfile.lock +Gemfile.lock diff --git a/.travis.yml b/.travis.yml index c2fef07..9bfe234 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: ruby +bundler_args: --without development rvm: - 1.8.7 - 1.9.3 @@ -29,7 +30,6 @@ matrix: - rvm: 2.1.4 env: PUPPET_VERSION="~> 3.3.0" sudo: false -gemfile: .gemfile notifications: email: - al@lab42.it diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..be1c34c --- /dev/null +++ b/Gemfile @@ -0,0 +1,19 @@ +source 'https://rubygems.org' + +puppetversion = ENV['PUPPET_VERSION'] + +is_ruby18 = RUBY_VERSION.start_with? '1.8' + +if is_ruby18 + gem 'rspec', "~> 3.1.0", :require => false + gem 'rake', '~> 10.5.0', :require => false +end +gem 'puppet', puppetversion, :require => false +gem 'puppet-lint' +gem 'puppetlabs_spec_helper', '>= 0.1.0' +gem 'rspec-puppet' +gem 'metadata-json-lint' + +group :development do + gem 'puppet-blacksmith' +end diff --git a/manifests/clone.pp b/manifests/clone.pp index 54491e9..a1ec681 100644 --- a/manifests/clone.pp +++ b/manifests/clone.pp @@ -47,7 +47,7 @@ 'present' : { exec { "git-clone-${name}": command => "git clone --recursive ${source_url} -b ${branch} ${extra_options} ${destination_dir}", - path => '/usr/bin', + path => '/usr/bin:/opt/csw/bin', creates => $creates, user => $owner, } @@ -64,4 +64,4 @@ } } -} \ No newline at end of file +} diff --git a/manifests/params.pp b/manifests/params.pp index 42a2275..222a964 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -17,6 +17,11 @@ ### Application related parameters $package = $::operatingsystem ? { + 'Solaris' => $::operatingsystemmajrelease ? { + '10' => 'CSWgit', + '11' => 'developer/versioning/git', + '5' => 'developer/versioning/git', + }, default => 'git', } @@ -48,6 +53,6 @@ $version = 'present' $absent = false $audit_only = false - $noops = undef + $noops = false } diff --git a/manifests/reposync.pp b/manifests/reposync.pp index b888ba4..5cde617 100644 --- a/manifests/reposync.pp +++ b/manifests/reposync.pp @@ -109,6 +109,14 @@ $manage_execute_on_change = any2bool($execute_on_change) + if ! defined(File[$basedir]) { + file { $basedir: + ensure => directory, + owner => 'root', + group => 'root', + mode => '0755', + } + } if ! defined(File['git_reposync']) { file { 'git_reposync': ensure => present, diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..a945983 --- /dev/null +++ b/metadata.json @@ -0,0 +1,81 @@ +{ + "name": "example42-git", + "version": "2.1.0", + "summary": "Puppet module for git", + "license": "Apache-2.0", + "author": "Alessandro Franceschi, Martin Alfke", + "checksums": { + }, + "source": "https://github.com/example42/puppet-git", + "project_page": "https://github.com/example42/puppet-git", + "issues_url": "https://github.com/example42/puppet-git/issues", + "operatingsystem_support": [ + { + "operatingsystem": "RedHat", + "operatingsystemrelease": [ + "7" + ] + }, + { + "operatingsystem": "Centos", + "operatingsystemrelease": [ + "7" + ] + }, + { + "operatingsystem": "Debian", + "operatingsystemrelease": [ + "7" + ] + }, + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "14.04" + ] + }, + { + "operatingsystem": "Solaris", + "operatingsystemrelease": [ + "10", + "11" + ] + } + ], + "requirements": [ + { + "name": "pe", + "version_requirement": ">= 3.0.0 < 5.0.0" + }, + { + "name": "puppet", + "version_requirement": ">= 3.0.0 < 5.0.0" + } + ], + "dependencies": [ + { + "name": "puppetlabs/stdlib", + "version_requirement": ">= 3.2.0 < 5.0.0" + }, + { + "name": "example42/puppi", + "version_requirement": ">= 2.0.0" + }, + { + "name": "example42/monitor", + "version_requirement": ">= 2.0.0" + }, + { + "name": "example42/iptables", + "version_requirement": ">= 2.0.0" + }, + { + "name": "example42/firewall", + "version_requirement": ">= 2.0.0" + }, + { + "name": "puppetlabs/concat", + "version_requirement": ">= 1.0.0" + } + ] +} diff --git a/templates/reposync/git_reposync-command.erb b/templates/reposync/git_reposync-command.erb index f9d8772..7864931 100644 --- a/templates/reposync/git_reposync-command.erb +++ b/templates/reposync/git_reposync-command.erb @@ -1,5 +1,5 @@ #!/bin/bash -export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/csw/bin <% if @manage_execute_on_change == true %> if [ ! -d <%= @destination_dir %> ] ; then diff --git a/templates/reposync/git_reposync-cron.erb b/templates/reposync/git_reposync-cron.erb index e2cfb34..fc00024 100644 --- a/templates/reposync/git_reposync-cron.erb +++ b/templates/reposync/git_reposync-cron.erb @@ -1,5 +1,5 @@ SHELL=/bin/bash -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/csw/bin <%= @cron %> <%= @user %> <%= @basedir %>/git_reposync_<%= @name %>