Skip to content

Commit

Permalink
More lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
solarkennedy committed Jan 24, 2015
1 parent 9994f99 commit dcf81cf
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 10 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ end

group :development do
gem 'json'
gem 'beaker', '~> 1.11.0'
gem 'beaker-rspec'
end
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ end
desc "Run syntax, lint, and spec tests."
task :test => [
:syntax,
# :lint,
:lint,
:spec,
]
6 changes: 4 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
case $::architecture {
'x86_64', 'amd64': { $arch = 'amd64' }
'i386': { $arch = '386' }
default: { fail("Unsupported kernel architecture: ${::architecture}") }
default: {
fail("Unsupported kernel architecture: ${::architecture}")
}
}

$os = downcase($::kernel)
Expand All @@ -42,6 +44,6 @@
default => undef
}
if $init_style == undef {
fail("Unsupported O/S")
fail('Unsupported OS')
}
}
32 changes: 29 additions & 3 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# == Define consul::service
#
# Sets up a Consul service definition
# http://www.consul.io/docs/agent/services.html
#
# == Parameters
#
# [*service_name*]
# Name of the service. Defaults to title.
#
# [*tags*]
# Array of strings.
#
# [*port*]
# TCP port the service runs on.
#
# [*check_ttl*]
# If provided, the number of seconds before a failing healthcheck
# is considered hard-down.
#
# [*check_script*]
# Full path to a nagios compliant healthcheck script
#
# [*check_interval*]
# Seconds between healthcheck executions.
#
define consul::service(
$service_name = $title,
$tags = [],
Expand All @@ -16,12 +42,12 @@
}

if $check_ttl and $check_interval {
fail("Only one of check_ttl and check_interval can be defined")
fail('Only one of check_ttl and check_interval can be defined')
}

if $check_ttl {
if $check_script {
fail("check_script must not be defined for ttl checks")
fail('check_script must not be defined for ttl checks')
}
$check_hash = {
check => {
Expand All @@ -30,7 +56,7 @@
}
} elsif $check_interval {
if (! $check_script) {
fail("check_script must be defined for interval checks")
fail('check_script must be defined for interval checks')
}
$check_hash = {
check => {
Expand Down
46 changes: 43 additions & 3 deletions manifests/watch.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@

# == Define: consul::watch
#
# Sets up Consul watch, to span commands when data changes.
# http://www.consul.io/docs/agent/watches.html
#
# == Parameters
#
# [*handler*]
# Full path to the script that will be excuted.
#
# [*datacenter*]
# String overriding consul's default datacenter.
#
# [*token*]
# String to override the default token.
#
# [*type*]
# Type of data to watch. (Like key, service, services, nodes)
#
# [*key*]
# Watch a specific key.
#
# [*keyprefix*]
# Watch a whole keyprefix
#
# [*service*]
# Watch a particular service
#
# [*service_tag*]
# This actually maps to the "tag" param for service watches.
# (`tag` is a puppet builtin metaparameter)
#
# [*passingonly*]
# Watch only those services that are passing healthchecks.
#
# [*state*]
# Watch a state change on a service healthcheck.
#
# [*event_name*]
# Name of an event to watch for.
#
define consul::watch(
$handler = undef,
$datacenter = undef,
Expand All @@ -7,10 +47,10 @@
$key = undef,
$keyprefix = undef,
$service = undef,
$service_tag = undef, #Note: this actually maps to the "tag" param for service watches
$service_tag = undef,
$passingonly = undef,
$state = undef,
$event_name = undef, #Note: this actually maps to the "name" param for event watches
$event_name = undef,
) {
include consul
$id = $title
Expand Down

0 comments on commit dcf81cf

Please sign in to comment.