Skip to content

Commit

Permalink
Enables check and diff mode on plays
Browse files Browse the repository at this point in the history
Allows "Capture installed Java provider" & "Capture installed Java version" tasks to run during check/diff mode, so that facts are populated successfully later
Allows Postgres or MySQL Connectors to run during check/diff mode

Signed-off-by: Chuck Levesque <clevesque@cloudera.com>
  • Loading branch information
clevesque committed Nov 20, 2023
1 parent fba1174 commit 0d97975
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions roles/prereqs/mysql_connector/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,23 @@
lock_timeout: "{{ (ansible_os_family == 'RedHat') | ternary(60, omit) }}"
name: unzip
state: present
ignore_errors: "{{ ansible_check_mode }}"

- name: Extract MySQL Connector/J zip file
unarchive:
src: "{{ mysql_connector_download_dir }}/mysql-connector-java.zip"
dest: "{{ mysql_connector_extract_dir }}"
exclude:
- src
ignore_errors: "{{ ansible_check_mode }}"

- name: Copy MySQL Connector/J jar file to correct location
copy:
src: "{{ mysql_connector_local_path }}"
dest: /usr/share/java/mysql-connector-java.jar
remote_src: yes
mode: 0644
ignore_errors: "{{ ansible_check_mode }}"

# MySql on rhel8 fix
- name: Fix MySQL on RHEL8
Expand All @@ -70,6 +73,7 @@
template:
src: my_config.h
dest: /usr/include/mysql/my_config.h
ignore_errors: "{{ ansible_check_mode }}"

## TODO Fix for RHEL8
- name: Install Mysql packages for python - PyMySQL
Expand Down
3 changes: 2 additions & 1 deletion roles/prereqs/postgresql_connector/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
src: "{{ local_temp_dir }}/postgresql-connector-java.jar"
dest: /usr/share/java/postgresql-connector-java.jar
mode: 0644
ignore_errors: "{{ ansible_check_mode }}"

# SSB will need the python3-psycopg2 connector

Expand All @@ -47,4 +48,4 @@

- name: Install python3-psycopg2
shell: "pip3 install psycopg2-binary==2.8.5 -t /usr/share/python3"
when: install_py3_psycopg2 == true
when: install_py3_psycopg2 == true

0 comments on commit 0d97975

Please sign in to comment.