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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ Tells Puppet what the path of `LOCAL_CODE` setting of `.gitolite.rc` file is. Va

Whether the user/group resources will be managed by this module. Default value: true

##### `mirror_hostname`

Tells Puppet whether to enable the `Mirroring` feature and set the value of `Hostname` in `.gitolite.rc`. Valid options: string. Default value: undef
For more details, see : http://gitolite.com/gitolite/mirroring/

##### `package_ensure`

Tells Puppet whether the Gitolite package should be installed, and what version. Valid options: 'present', 'latest', or a specific version number. Default value: 'present'
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$git_config_keys = $gitolite::params::git_config_keys,
$group_name = $gitolite::params::group_name,
$home_dir = $gitolite::params::home_dir,
$mirror_hostname = $gitolite::params::mirror_hostname,
$local_code_in_repo = $gitolite::params::local_code_in_repo,
$local_code_path = $gitolite::params::local_code_path,
$manage_home_dir = $gitolite::params::manage_home_dir,
Expand Down Expand Up @@ -69,6 +70,7 @@
validate_string($local_code_path)
validate_bool($manage_home_dir_bool)
validate_bool($manage_user_bool)
validate_string($mirror_hostname)
validate_string($package_ensure)
validate_string($package_name)
validate_bool($repo_specific_hooks_bool)
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$local_code_path = 'local'
$manage_home_dir = true
$manage_user = true
$mirror_hostname = undef
$package_ensure = 'present'
$repo_specific_hooks = false
$umask = '0077'
Expand Down
10 changes: 8 additions & 2 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@
it { should contain_file('gitolite_home_dir').with_path('/opt/gitolite') }
end

context 'when mirror_hostname is set to valid string <.*>' do
let(:params) { { :mirror_hostname => '.*' } }
it { should contain_file('gitolite_config').with_content(/^\s+'Mirroring',/) }
it { should contain_file('gitolite_config').with_content(/^\s+HOSTNAME\s+=>\s+".*",$/) }
end

context 'when allow_local_code and local_code_in_repo are set to valid bool <true>' do
let(:params) { { :allow_local_code => true, :local_code_in_repo => true } }
it { should contain_file('gitolite_config').with_content(/^\s+# LOCAL_CODE\s+=>\s+"\$ENV\{HOME\}\/local",$/) }
Expand Down Expand Up @@ -452,8 +458,8 @@
},
'string' => {
:name => %w(
admin_key_content git_config_keys group_name
local_code_path package_ensure package_name user_name
admin_key_content git_config_keys group_name local_code_path
mirror_hostname package_ensure package_name user_name
),
:valid => ['present'],
:invalid => [%w(array), { 'ha' => 'sh' }],
Expand Down
4 changes: 2 additions & 2 deletions templates/gitolite3.rc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
# CPU_TIME_WARN_LIMIT => 0.1,

# the Mirroring feature needs this
# HOSTNAME => "foo",
<% if ! @mirror_hostname %><%= '# ' -%><% end %>HOSTNAME => "<%= @mirror_hostname %>",

# TTL for redis cache; PLEASE SEE DOCUMENTATION BEFORE UNCOMMENTING!
# CACHE_TTL => 600,
Expand Down Expand Up @@ -144,7 +144,7 @@
# system admin stuff

# enable mirroring (don't forget to set the HOSTNAME too!)
# 'Mirroring',
<% if ! @mirror_hostname %><%= '# ' -%><% end %>'Mirroring',

# allow people to submit pub files with more than one key in them
# 'ssh-authkeys-split',
Expand Down