Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation for true/false parameters #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
8 changes: 4 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ _Apache Module_
*Setup the initial Gitolite Admin keys and bootstrap*
<pre>
class { 'gitolite':
server => 'true',
server => true,
site_name => 'Frymanet.com Git Repository',
ssh_key => 'ssh-rsa AAAA....',
vhost => 'git.frymanet.com',
Expand All @@ -28,7 +28,7 @@ _Apache Module_
*Setup the initial Gitolite Admin keys and bootstrap using an external apache module*
<pre>
class { 'gitolite':
server => 'true',
server => true,
site_name => 'Frymanet.com Git Repository',
ssh_key => 'ssh-rsa AAAA....',
vhost => 'git.frymanet.com',
Expand All @@ -40,8 +40,8 @@ _Apache Module_
*Setup the initial Gitolite Admin keys and bootstrap, but don't manage apache*
<pre>
class { 'gitolite':
server => 'true',
manage_apache => 'false',
server => true,
manage_apache => false,
site_name => 'Frymanet.com Git Repository',
ssh_key => 'ssh-rsa AAAA....',
}
Expand Down
7 changes: 4 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#
# Manage Apache:
# class { 'gitolite':
# server => 'true',
# server => true,
# site_name => 'Frymanet.com Git Repository',
# ssh_key => 'ssh-rsa AAAA....',
# vhost => 'git.frymanet.com',
Expand All @@ -58,7 +58,7 @@
#
# Use and External Apache Module:
# class { 'gitolite':
# server => 'true',
# server => true,
# site_name => 'Frymanet.com Git Repository',
# ssh_key => 'ssh-rsa AAAA....',
# vhost => 'git.frymanet.com',
Expand All @@ -69,7 +69,7 @@
#
# Do not manage Apache:
# class { 'gitolite':
# server => 'true',
# server => true,
# site_name => 'Frymanet.com Git Repository',
# ssh_key => 'ssh-rsa AAAA....',
# }
Expand All @@ -89,6 +89,7 @@
) {
include stdlib
include gitolite::params
validate_bool($server)

anchor { 'gitolite::begin': }
-> class { 'gitolite::client': }
Expand Down
4 changes: 2 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#
# Do not manage Apache:
# class { 'gitolite::server':
# manage_apache => 'false',
# manage_apache => false,
# site_name => 'Frymanet.com Git Repository',
# ssh_key => 'ssh-rsa AAAA....',
# }
Expand All @@ -68,7 +68,7 @@
$ssh_key,
$site_name = '',
$vhost = '',
$manage_apache = '',
$manage_apache = false,
$apache_notify = '',
$write_apache_conf_to = '',
$wildrepos = false
Expand Down
3 changes: 3 additions & 0 deletions manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
$write_apache_conf_to,
$wildrepos
) {
validate_bool($wildrepos)
validate_bool($manage_apache)

File {
owner => $gitolite::params::gt_uid,
group => $gitolite::params::gt_gid,
Expand Down
8 changes: 4 additions & 4 deletions tests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#
# Manage Apache:
class { 'gitolite':
server => 'true',
server => true,
site_name => 'Frymanet.com Git Repository',
ssh_key => 'ssh-rsa AAAA....',
vhost => 'git.frymanet.com',
}
#
# Use and External Apache Module:
class { 'gitolite':
server => 'true',
server => true,
site_name => 'Frymanet.com Git Repository',
ssh_key => 'ssh-rsa AAAA....',
vhost => 'git.frymanet.com',
Expand All @@ -20,8 +20,8 @@
#
# Do not manage Apache:
class { 'gitolite':
server => 'true',
manage_apache => 'false',
server => true,
manage_apache => false,
site_name => 'Frymanet.com Git Repository',
ssh_key => 'ssh-rsa AAAA....',
}
Expand Down