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

Added default undef to environment variable #20

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
1 change: 0 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
$sqlite_version = $liquibase::sqlite_version,
$jt400_version = $liquibase::jt400_version,
$mariadb_version = $liquibase::mariadb_version,
$environment = hiera('environment'),
) inherits liquibase::params {
class {'liquibase::install': } -> Class['liquibase']
}
19 changes: 7 additions & 12 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
# [jtds_version] the version of the jtds driver to use, by default 1.3.1
# [mysql_version] the version of the mysql driver to use, by default 5.1.34
# [sqlite_version] the version of the sqlite driver to use, by default 3.7.8
# [environment] the proxy configuration if needed
#
#
#
# === Examples
#
#class { 'liquibase':
# version => '3.4.0',
# environment => ["http_proxy=http://proxy_user:proxy_passwd@proxy_server:proxy_port", "https_proxy=https://proxy_user:proxy_passwd@proxy_server:proxy_port"],
#}
#
#class { 'liquibase':
Expand All @@ -44,16 +42,21 @@
include staging

staging::file { "liquibase-${version}-bin.tar.gz":
environment => $environment,
source => "https://github.com/liquibase/liquibase/releases/download/liquibase-parent-${version}/liquibase-${version}-bin.tar.gz",
}

if (!defined(File['/opt/apps'])) {
file { '/opt/apps':
ensure => directory,
}
}

file { '/opt/apps/liquibase/':
ensure => directory,
recurse => true,
purge => true,
force => true,
require => Staging::File["liquibase-${version}-bin.tar.gz"],
require => [Staging::File["liquibase-${version}-bin.tar.gz"], File['/opt/apps']],
}

file { "/opt/apps/liquibase/liquibase-${version}":
Expand Down Expand Up @@ -89,7 +92,6 @@
# Copie des drivers
# PostgreSQL
staging::file { "postgresql-${postgresql_version}.jar":
environment => $environment,
source => "http://central.maven.org/maven2/org/postgresql/postgresql/${postgresql_version}/postgresql-${postgresql_version}.jar",
require => Staging::Extract["liquibase-${version}-bin.tar.gz"],
}
Expand All @@ -103,7 +105,6 @@

# Derby
staging::file { "derbyclient-${derby_version}.jar":
environment => $environment,
source => "http://central.maven.org/maven2/org/apache/derby/derbyclient/${derby_version}/derbyclient-${derby_version}.jar",
require => Staging::Extract["liquibase-${version}-bin.tar.gz"],
}
Expand All @@ -117,7 +118,6 @@

# H2
staging::file { "h2-${h2_version}.jar":
environment => $environment,
source => "http://central.maven.org/maven2/com/h2database/h2/${h2_version}/h2-${h2_version}.jar",
require => Staging::Extract["liquibase-${version}-bin.tar.gz"],
}
Expand All @@ -131,7 +131,6 @@

# Hsqldb
staging::file { "hsqldb-${hsqldb_version}.jar":
environment => $environment,
source => "http://central.maven.org/maven2/org/hsqldb/hsqldb/${hsqldb_version}/hsqldb-${hsqldb_version}.jar",
require => Staging::Extract["liquibase-${version}-bin.tar.gz"],
}
Expand All @@ -145,7 +144,6 @@

# Jtds
staging::file { "jtds-${jtds_version}.jar":
environment => $environment,
source => "http://central.maven.org/maven2/net/sourceforge/jtds/jtds/${jtds_version}/jtds-${jtds_version}.jar",
require => Staging::Extract["liquibase-${version}-bin.tar.gz"],
}
Expand All @@ -159,7 +157,6 @@

# MySql
staging::file { "mysql-connector-java-${mysql_version}.jar":
environment => $environment,
source => "http://central.maven.org/maven2/mysql/mysql-connector-java/${mysql_version}/mysql-connector-java-${mysql_version}.jar",
require => Staging::Extract["liquibase-${version}-bin.tar.gz"],
}
Expand All @@ -173,7 +170,6 @@

# Jt400
staging::file { "jt400-${jt400_version}.jar":
environment => $environment,
source => "http://central.maven.org/maven2/net/sf/jt400/jt400/${jt400_version}/jt400-${jt400_version}.jar",
require => Staging::Extract["liquibase-${version}-bin.tar.gz"],
}
Expand All @@ -187,7 +183,6 @@

# MariaDB
staging::file { "mariadb-${mariadb_version}.jar":
environment => $environment,
source => "http://central.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/${mariadb_version}/mariadb-java-client-${mariadb_version}.jar",
require => Staging::Extract["liquibase-${version}-bin.tar.gz"],
}
Expand Down
3 changes: 1 addition & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
$h2_version = '1.4.191'
$hsqldb_version = '2.3.4'
$jtds_version = '1.3.1'
$mysql_version = '6.0.2'
$mysql_version = '5.1.40'
$sqlite_version = '3.7.8'
$jt400_version = '9.0'
$mariadb_version = '1.4.5'
$environment = undef
}