Skip to content

Commit

Permalink
fix: mysql-connector-java install
Browse files Browse the repository at this point in the history
  • Loading branch information
SteBaum authored and SteBaum committed Jul 30, 2024
1 parent 7db0dd8 commit 1f1a52a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 16 deletions.
20 changes: 14 additions & 6 deletions roles/hive/metastore/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 12 additions & 4 deletions roles/ranger/admin/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 12 additions & 4 deletions roles/ranger/kms/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion tdp_vars_defaults/hive/hive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tdp_vars_defaults/ranger/ranger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1f1a52a

Please sign in to comment.