From 1f1a52ab41db0352cc4d9ff76ee86169bbb679b7 Mon Sep 17 00:00:00 2001 From: SteBaum Date: Tue, 30 Jul 2024 11:00:57 +0200 Subject: [PATCH] fix: mysql-connector-java install --- roles/hive/metastore/tasks/install.yml | 20 ++++++++++++++------ roles/ranger/admin/tasks/install.yml | 16 ++++++++++++---- roles/ranger/kms/tasks/install.yml | 16 ++++++++++++---- tdp_vars_defaults/hive/hive.yml | 3 ++- tdp_vars_defaults/ranger/ranger.yml | 2 +- 5 files changed, 41 insertions(+), 16 deletions(-) diff --git a/roles/hive/metastore/tasks/install.yml b/roles/hive/metastore/tasks/install.yml index 446b9d09..6325a58f 100644 --- a/roles/hive/metastore/tasks/install.yml +++ b/roles/hive/metastore/tasks/install.yml @@ -7,15 +7,23 @@ name: tosit.tdp.hive.common tasks_from: install_hive -- name: Install jdbc connector - ansible.builtin.package: - name: "{{ hive_jdbc_connector_package }}" - state: present +- name: Upload {{ hive_jdbc_connector_package }} + ansible.builtin.copy: + src: "{{ binaries_local_dir }}/{{ hive_jdbc_connector_package }}" + dest: "{{ binaries_upload_dir }}" + owner: root + group: root + mode: "644" + diff: false + +- name: Install {{ hive_jdbc_connector_package }} + ansible.builtin.command: + cmd: "yum install -y {{ binaries_upload_dir }}/{{ hive_jdbc_connector_package }}" - name: Create a symbolic link to jdbc.jar ansible.builtin.file: - src: /usr/share/java/{{ hive_jdbc_connector_package }}.jar - dest: "{{ hive_install_dir }}/lib/{{ hive_jdbc_connector_package }}.jar" + src: /usr/share/java/{{ hive_jdbc_connector_jar }} + dest: "{{ hive_install_dir }}/lib/{{ hive_jdbc_connector_jar }}" state: link - name: Create configuration directory diff --git a/roles/ranger/admin/tasks/install.yml b/roles/ranger/admin/tasks/install.yml index 4946cc91..a7592277 100644 --- a/roles/ranger/admin/tasks/install.yml +++ b/roles/ranger/admin/tasks/install.yml @@ -56,10 +56,18 @@ owner: root mode: "770" -- name: Install jdbc connector - ansible.builtin.package: - name: "{{ ranger_jdbc_connector_package }}" - state: present +- name: Upload {{ ranger_jdbc_connector_package }} + ansible.builtin.copy: + src: "{{ binaries_local_dir }}/{{ ranger_jdbc_connector_package }}" + dest: "{{ binaries_upload_dir }}" + owner: root + group: root + mode: "644" + diff: false + +- name: Install {{ ranger_jdbc_connector_package }} + ansible.builtin.command: + cmd: "yum install -y {{ binaries_upload_dir }}/{{ ranger_jdbc_connector_package }}" - name: Template Ranger Admin service file ansible.builtin.template: diff --git a/roles/ranger/kms/tasks/install.yml b/roles/ranger/kms/tasks/install.yml index 425474eb..71d174bf 100644 --- a/roles/ranger/kms/tasks/install.yml +++ b/roles/ranger/kms/tasks/install.yml @@ -79,10 +79,18 @@ owner: root mode: "770" -- name: Install jdbc connector - ansible.builtin.package: - name: "{{ ranger_jdbc_connector_package }}" - state: present +- name: Upload {{ ranger_jdbc_connector_package }} + ansible.builtin.copy: + src: "{{ binaries_local_dir }}/{{ ranger_jdbc_connector_package }}" + dest: "{{ binaries_upload_dir }}" + owner: root + group: root + mode: "644" + diff: false + +- name: Install {{ ranger_jdbc_connector_package }} + ansible.builtin.command: + cmd: "yum install -y {{ binaries_upload_dir }}/{{ ranger_jdbc_connector_package }}" - name: Template Ranger KMS service file ansible.builtin.template: diff --git a/tdp_vars_defaults/hive/hive.yml b/tdp_vars_defaults/hive/hive.yml index 3e512b3a..e07504cb 100644 --- a/tdp_vars_defaults/hive/hive.yml +++ b/tdp_vars_defaults/hive/hive.yml @@ -45,7 +45,8 @@ java_home: /usr/lib/jvm/jre-1.8.0-openjdk hdfs_user: hdfs # JDBC connector to be installed -hive_jdbc_connector_package: mysql-connector-java +hive_jdbc_connector_package: mysql-connector-j-8.4.0-1.el8.noarch.rpm +hive_jdbc_connector_jar: mysql-connector-j.jar # Hive Metastore database properties hive_ms_db_url: jdbc:mysql://tdp-db-1.lxd:3306 diff --git a/tdp_vars_defaults/ranger/ranger.yml b/tdp_vars_defaults/ranger/ranger.yml index c1a853f8..59833393 100644 --- a/tdp_vars_defaults/ranger/ranger.yml +++ b/tdp_vars_defaults/ranger/ranger.yml @@ -68,7 +68,7 @@ ranger_truststore_location: /etc/ssl/certs/truststore.jks ranger_truststore_password: Truststore123! # JDBC connector to be installed -ranger_jdbc_connector_package: mysql-connector-java +ranger_jdbc_connector_package: mysql-connector-j-8.4.0-1.el8.noarch.rpm # Ranger Admin install.properties install_properties: