diff --git a/manifests/init.pp b/manifests/init.pp index bd91efe..e530bda 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -121,7 +121,9 @@ class cgit( require => User['cgit'], } - file { '/var/lib/git': + $local_git_dir = '/var/lib/git' + + file { $local_git_dir: ensure => directory, owner => 'cgit', group => 'cgit', @@ -129,6 +131,12 @@ class cgit( require => User['cgit'], } + file { "${local_git_dir}/p": + ensure => link, + target => $local_git_dir, + require => File[$local_git_dir], + } + ::httpd::vhost { $vhost_name: port => $https_port, serveraliases => $serveraliases, diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb index 1b867d6..91f673d 100644 --- a/spec/acceptance/basic_spec.rb +++ b/spec/acceptance/basic_spec.rb @@ -128,6 +128,10 @@ describe 'puppet-cgit module', :if => ['fedora', 'redhat'].include?(os[:family]) end end + describe file('/var/lib/git/p') do + it { should be_linked_to '/var/lib/git' } + end + describe file('/usr/lib/systemd/system/git-daemon.socket'), :if => ['fedora', 'redhat'].include?(os[:family]) && os[:release] >= '7' do it { should be_file } it { should be_owned_by 'root' }