Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
Begin to separate out module functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mukaibot committed Aug 1, 2014
1 parent 9cd4fe4 commit 8ed9519
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 16 deletions.
28 changes: 12 additions & 16 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
class artifactory($jdk = "java-1.7.0-openjdk",
$sourceforge = "http://downloads.sourceforge.net/project",
$version = "3.0.1") {
class artifactory { #($jdk = "java-1.7.0-openjdk",
#$sourceforge = "http://downloads.sourceforge.net/project",
#$version = "3.0.1") {

# http://downloads.sourceforge.net/project/artifactory/artifactory/2.5.1.1/artifactory-2.5.1.1.rpm

if ! defined (Package[$jdk]) {
package { $jdk: ensure => installed }
}
#if ! defined (Package[$jdk]) {
# package { $jdk: ensure => installed }
#}

package { 'artifactory':
ensure => installed,
Expand All @@ -15,12 +13,10 @@
require => Package[$jdk]
}

service { 'artifactory':
ensure => 'running',
enable => "true",
hasstatus => "false",
provider => "redhat",
require => Package['artifactory']
}

} inherits artifactory::params {
anchor { '::artifactory::start': } ->
class { '::artifactory::user': } ->
class { '::artifactory::install': } ->
class { '::artifactory::service': } ->
anchor { '::artifactory::end': }
}
20 changes: 20 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class artifactory::install inherits artifactory {
$url = "http://dl.bintray.com/jfrog/artifactory/artifactory-${app_version}.zip"

if $caller_module_name != $module_name {
fail("Use of private class ${name} by ${caller_module_name}")
}

staging::deploy { "artifactory-${app_version}.zip":
source => $url,
target => $app_dir,
creates => "$app_dir/artifactory-${app_version}"
}

file { $app_data:
ensure => directory,
mode => '0755',
owner => $username,
group => $username
}
}
11 changes: 11 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# == Class Artifactory::Params
# Contains all the parameters for the Artifactory module
class artifactory::params {
$username = 'artifactory',
$pass_hash = undef,
$manage_java = false,
$java_version = '7',
$app_dir = '/opt/artifactory',
$app_data = '/var/artifactory',
$app_version = '3.3.0'
}
11 changes: 11 additions & 0 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class artifactory::server inherits artifactory {

# service { 'artifactory':
# ensure => 'running',
# enable => "true",
# hasstatus => "false",
# provider => "redhat",
# require => Package['artifactory']
# }

}
12 changes: 12 additions & 0 deletions manifests/user.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class artifactory::user inherits artifactory {

if $caller_module_name != $module_name {
fail("Use of private class ${name} by ${caller_module_name}")
}

user { $username:
ensure => present,
manage_home => false,
password => $pass_hash
}
}

0 comments on commit 8ed9519

Please sign in to comment.