Skip to content

Commit

Permalink
Merge pull request #352 from voxpupuli/vcsrepo-user
Browse files Browse the repository at this point in the history
Clone git repository as $user
  • Loading branch information
smortex authored Mar 31, 2022
2 parents fb9fe6d + 7366b4e commit 091eaf8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
9 changes: 2 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
vcsrepo { "${basedir}/puppetboard":
ensure => present,
provider => git,
owner => $user,
user => $user,
source => $git_source,
revision => $revision,
require => [
Expand All @@ -148,12 +148,7 @@
before => [
File[$settings_file],
],
}

file { "${basedir}/puppetboard":
owner => $user,
recurse => true,
require => Vcsrepo["${basedir}/puppetboard"],
notify => Python::Requirements["${basedir}/puppetboard/requirements.txt"],
}

$pyvenv_proxy_env = $python_proxy ? {
Expand Down
4 changes: 3 additions & 1 deletion spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

require 'spec_helper_acceptance'

describe 'puppetboard class' do
require_relative 'support/puppetdb'

describe 'puppetboard class', if: has_puppetdb do
case fact('os.family')
when 'RedHat'
apache_conf_file = '/etc/httpd/conf.d/25-puppetboard.conf'
Expand Down
10 changes: 10 additions & 0 deletions spec/acceptance/support/puppetdb.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

def has_puppetdb
case host_inventory['facter']['os']['name']
when 'Debian'
return false if ENV['BEAKER_PUPPET_COLLECTION'] == 'puppet6' && host_inventory['facter']['os']['release']['major'] == '11'
end

true
end
1 change: 0 additions & 1 deletion spec/classes/puppetboard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
it { is_expected.to contain_package('py38-puppetboard') }
else
it { is_expected.to contain_file('/srv/puppetboard/puppetboard/settings.py') }
it { is_expected.to contain_file('/srv/puppetboard/puppetboard') }
it { is_expected.to contain_file('/srv/puppetboard') }
it { is_expected.to contain_python__pyvenv('/srv/puppetboard/virtenv-puppetboard') }
it { is_expected.to contain_vcsrepo('/srv/puppetboard/puppetboard') }
Expand Down
8 changes: 8 additions & 0 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if $facts['os']['name'] == 'Ubuntu' {
# Needed for facter to fetch facts used by the postgresql module
if versioncmp($facts['facterversion'], '4.0.0') <= 0 {
package{ 'lsb-release':
ensure => present,
}
}
}

0 comments on commit 091eaf8

Please sign in to comment.