|
@@ -3,26 +3,27 @@ class hdp-sqoop::mysql-connector()
|
|
|
include hdp-sqoop::params
|
|
|
include hdp-hive::params
|
|
|
|
|
|
- $url = $hdp-hive::params::mysql_connector_url
|
|
|
- notice($url)
|
|
|
- $zip_name = regsubst($url,'^.+/([^/]+$)','\1')
|
|
|
- $jar_name = regsubst($zip_name,'zip$','.jar')
|
|
|
$target = "${hdp::params::artifact_dir}/${zip_name}"
|
|
|
$sqoop_lib = $hdp-sqoop::params::sqoop_lib
|
|
|
-
|
|
|
- exec{ "curl sqoop_mysql_url":
|
|
|
- command => "mkdir -p ${artifact_dir} ; curl -f --retry 10 ${url} -o ${target} ",
|
|
|
- creates => $target,
|
|
|
- path => ["/bin","/usr/bin/"]
|
|
|
- }
|
|
|
- exec{ "unzip sqoop_mysql_url":
|
|
|
- command => "unzip -o -j ${target}",
|
|
|
- cwd => $sqoop_lib,
|
|
|
- #user => $hdp::params::sqoop_user,
|
|
|
- group => $hdp::params::hadoop_user_group,
|
|
|
- creates => "${sqoop_lib}/${$zip_name}",
|
|
|
- path => ["/usr/bin/"]
|
|
|
- }
|
|
|
|
|
|
- Exec["curl sqoop_mysql_url"] -> Exec["unzip sqoop_mysql_url"]
|
|
|
+ anchor { 'hdp-sqoop::mysql-connector::begin':}
|
|
|
+
|
|
|
+ hdp::exec { 'yum install -y mysql-connector-java-5.0.8-4.jpp5'
|
|
|
+ command => "yum install -y mysql-connector-java-5.0.8-4.jpp5",
|
|
|
+ unless => "rpm -qa | grep mysql-connector-java-5.0.8-4.jpp5",
|
|
|
+ path => ["/bin","/usr/bin/"],
|
|
|
+ require => Anchor['hdp-sqoop::mysql-connector::begin']
|
|
|
+ }
|
|
|
+
|
|
|
+ hdp::exec { 'sqoop mkdir -p ${artifact_dir} ; cp /usr/share/java/mysql-connector-java.jar ${target}':
|
|
|
+ command => "mkdir -p ${artifact_dir} ; cp /usr/share/java/mysql-connector-java.jar ${target}",
|
|
|
+ unless => "test -f ${target}",
|
|
|
+ creates => $target,
|
|
|
+ path => ["/bin","/usr/bin/"],
|
|
|
+ require => Hdp::Exec['yum install -y mysql-connector-java-5.0.8-4.jpp5'],
|
|
|
+ notify => Anchor['hdp-sqoop::mysql-connector::end'],
|
|
|
+ }
|
|
|
+
|
|
|
+ anchor { 'hdp-sqoop::mysql-connector::end':}
|
|
|
+
|
|
|
}
|