Skip to content

Commit

Permalink
set up some basic manifests for service control and package installs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Rørvik committed Jun 1, 2016
1 parent f01eb7f commit e669ab1
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 22 deletions.
32 changes: 21 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
class confluent (
class confluent (
$version = '3.0',
$scala_version = '2.11',
$kafka = false,
$kafkastreams = false,
$zookeeper = false,
$schemaregistry = false,
$restservice = false,
) {

if ! ($kafka or $kafkastreams or $zookeeper or $schemaregistry or $restservice) {
if ! ($kafka or $zookeeper or $schemaregistry or $restservice) {
fail('You must choose to install at least one component')
}

if $kafka {
include ::confluent::kafka
}
# Kafka and zookeeper are in same package

if $kafkastreams {
include ::confluent::kafkastreams
}
if ($kafka or $zookeeper) {

$packages = [ "confluent-kafka-${::confluent::scala_version}" ]

package { $packages:
ensure => installed,
}

if $kafka {
include ::confluent::kafka
}

if $zookeeper {
include ::confluent::zookeeper
}

if $zookeeper {
include ::confluent::zookeeper
}

#Separate components

if $schemaregistry {
include ::confluent::schemaregistry
}
Expand Down
8 changes: 7 additions & 1 deletion manifests/kafka.pp
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
class confluent::kafka { }
class confluent::kafka {

class { '::confluent::kafka::config': } ->
class { '::confluent::kafka::service': }


}
1 change: 0 additions & 1 deletion manifests/kafka/install.pp

This file was deleted.

15 changes: 14 additions & 1 deletion manifests/kafka/service.pp
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
class confluent::kafka::service { }
class confluent::kafka::service {

file { '/etc/init.d/kafka':
ensure => file,
mode => '0755',
}

service { 'kafka':
ensure => running,
enable => true,
require => File['/etc/init.d/kafka'],
}

}
1 change: 0 additions & 1 deletion manifests/kafkastreams/install.pp

This file was deleted.

8 changes: 7 additions & 1 deletion manifests/restservice/install.pp
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
class confluent::restservice::install { }
class confluent::restservice::install {

package { 'confluent-kafka-rest':
ensure => installed,
}

}
15 changes: 14 additions & 1 deletion manifests/restservice/service.pp
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
class confluent::restservice::service { }
class confluent::restservice::service {

file { '/etc/init.d/kafka-restservice':
ensure => file,
mode => '0755',
}

service { 'kafka-restservice':
ensure => running,
enable => true,
require => File['/etc/init.d/kafka-restservice'],
}

}
8 changes: 7 additions & 1 deletion manifests/schemaregistry/install.pp
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
class confluent::schemaregistry::install { }
class confluent::schemaregistry::install {

package { 'confluent-schema-registry':
ensure => installed,
}

}
15 changes: 14 additions & 1 deletion manifests/schemaregistry/service.pp
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
class confluent::schemaregistry::service { }
class confluent::schemaregistry::service {

file { '/etc/init.d/kafka-schemaregistry':
ensure => file,
mode => '0755',
}

service { 'kafka-schemaregistry':
ensure => running,
enable => true,
require => File['/etc/init.d/kafka-schemaregistry'],
}

}
7 changes: 6 additions & 1 deletion manifests/zookeeper.pp
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
class confluent::zookeeper { }
class confluent::zookeeper {

class { '::confluent::zookeeper::config': } ->
class { '::confluent::zookeeper::service': }

}
1 change: 0 additions & 1 deletion manifests/zookeeper/install.pp

This file was deleted.

15 changes: 14 additions & 1 deletion manifests/zookeeper/service.pp
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
class confluent::zookeeper::service { }
class confluent::zookeeper::service {

file { '/etc/init.d/zookeeper':
ensure => file,
mode => '0755',
}

service { 'zoookeeper':
ensure => running,
enable => true,
require => File['/etc/init.d/zookeeper'],
}

}

0 comments on commit e669ab1

Please sign in to comment.