-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
86 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
--- | ||
|
||
- name: Install additional supporting packages | ||
ansible.builtin.package: | ||
name: | ||
- bison | ||
- gcc | ||
- bc | ||
- byacc | ||
- dejavu-fonts-common | ||
- flex | ||
- fontconfig | ||
- fuse | ||
- fuse-libs | ||
- gcc | ||
- make | ||
- patch | ||
- perf | ||
- psmisc | ||
- python3-docutils | ||
- R-core | ||
- sysstat | ||
- tmux | ||
- unzip | ||
state: present | ||
when: ansible_os_family == "RedHat" | ||
become: true | ||
|
||
- name: Install packages for DBT-7 Database | ||
ansible.builtin.dnf: | ||
name: | ||
- 'https://github.com/osdldbt/dbt7-packaging/releases/download/v{{ dbt7_version }}/dbt7-{{ dbt7_version }}-1.el8.x86_64.rpm' | ||
state: present | ||
disable_gpg_check: true | ||
when: ansible_os_family == "RedHat" | ||
- name: Download DBT-7 AppImage | ||
ansible.builtin.get_url: | ||
url: "{{ dbt7_appimage }}" | ||
checksum: "sha256:{{ dbt7_checksum }}" | ||
dest: "{{ dbt7_path }}" | ||
mode: '0755' | ||
become: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,19 @@ | ||
--- | ||
- name: Check that 'tpcfile' is set to local TPC-H Tools location | ||
- name: Check that 'tpcdsfile' is set to local TPC-H Tools location | ||
ansible.builtin.fail: | ||
msg: >- | ||
The Ansible variable 'tpcfile' must be set to a locally downloaded copy | ||
The Ansible variable 'tpcdsfile' must be set to a locally downloaded copy | ||
of the TPC supplied TPC-H Tools from: | ||
https://www.tpc.org/tpc_documents_current_versions/current_specifications5.asp | ||
when: tpcfile|length < 1 | ||
when: tpcdsfile | length < 1 | ||
|
||
- name: Copy and unarchive TPC-H Tools to remote host | ||
ansible.builtin.unarchive: | ||
src: "{{ tpcfile }}" | ||
src: "{{ tpcdsfile }}" | ||
dest: "{{ pg_user_home }}" | ||
become_user: "{{ pg_owner }}" | ||
|
||
- name: Patch TPC-H Tools for PostgreSQL | ||
ansible.posix.patch: | ||
remote_src: true | ||
src: "{{ item }}" | ||
basedir: "{{ pg_user_home }}" | ||
strip: 1 | ||
become_user: "{{ pg_owner }}" | ||
loop: | ||
- /usr/share/dbt7/dbt7-DSGen-software-code-3.2.0rc1.diff | ||
- /usr/share/dbt7/dbt7-DSGen-software-code-3.2.0rc1-postgresql-queries.diff | ||
|
||
- name: Build TPC-H Tools for PostgreSQL | ||
community.general.make: | ||
chdir: "{{ pg_user_home }}/DSGen-software-code-3.2.0rc1/tools" | ||
- name: Build TPC-DS Tools for PostgreSQL | ||
ansible.builtin.shell: >- | ||
dbt7 build-dsgen {{ pg_user_home }}/DSGen-software-code-3.2.0rc1 | ||
become_user: "{{ pg_owner }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,39 @@ | ||
--- | ||
# validate dbt7 package | ||
- name: Set dbt7 package name | ||
# validate dbt7 db packages installation | ||
- name: Set dbt7_db_pkg_list | ||
ansible.builtin.set_fact: | ||
dbt7_package: 'dbt7' | ||
dbt7_db_pkg_list: ['bc', 'byacc', 'dejavu-fonts-common', 'flex', 'fontconfig', 'fuse', 'fuse-libs', 'gcc', 'make', 'patch', 'perf', 'psmisc', 'sysstat', 'tmux', 'unzip'] | ||
|
||
- name: Gather the package facts | ||
ansible.builtin.package_facts: | ||
strategy: "all" | ||
|
||
- name: Check that DBT7 packages have been installed | ||
- name: Check that all packages in dbt7_db_pkg_list has been installed | ||
ansible.builtin.assert: | ||
that: | ||
- "{{ ansible_facts.packages[dbt7_package] }} is defined" | ||
fail_msg: "Package {{ dbt7_package }} has not been installed." | ||
success_msg: "Package {{ dbt7_package }} has been installed." | ||
- "{{ ansible_facts.packages[package] }} is defined" | ||
fail_msg: "Package {{ package }} has not been installed." | ||
success_msg: "Package {{ package }} has been installed." | ||
loop: "{{ dbt7_db_pkg_list }}" | ||
loop_control: | ||
loop_var: package | ||
|
||
# validate dbt7 user | ||
- name: Run query to check dbt7 user is in pg_user | ||
ansible.builtin.include_role: | ||
name: manage_dbserver | ||
tasks_from: execute_sql_scripts | ||
vars: | ||
pg_query: | ||
- query: "Select * from pg_user where usename = '{{ pg_owner }}'" | ||
db: "{{ pg_database }}" | ||
|
||
- name: Set user_query_result with sql_query_output | ||
ansible.builtin.set_fact: | ||
user_query_result: "{{ sql_query_output }}" | ||
# ensure the DBT-7 AppImage has been installed to the proper location | ||
- name: Stat to dbt7_path | ||
ansible.builtin.stat: | ||
path: "{{ dbt7_path }}" | ||
register: dbt7_path_stat | ||
become: true | ||
|
||
- name: Check if DBT7 postgres user was successfully created | ||
- name: Check if DBT-7 AppImage was installed properly on DB | ||
ansible.builtin.assert: | ||
that: | ||
- user_query_result.results[0].query_result[0]['usename'] == pg_owner | ||
fail_msg: "DBT7 postgres user was not successfully created." | ||
success_msg: "DBT7 postgres user was successfully created." | ||
run_once: true | ||
- dbt7_path_stat.stat['exists']|bool | ||
fail_msg: "DBT-7 AppImage at {{ dbt7_path }} was not created properly" | ||
success_msg: "DBT-7 AppImage at {{ dbt7_path }} was created successfully" | ||
|
||
# reset variables | ||
- name: Reset variables | ||
ansible.builtin.set_fact: | ||
dbt7_package: null | ||
user_query_result: null | ||
dbt7_db_pkg_list: null | ||
dbt7_path_stat: null |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
--- | ||
pg_owner: "enterprisedb" | ||
pg_port: "5444" | ||
pg_superuser: "enterprisedb" | ||
pg_instance_name: "main" | ||
pg_data: "/var/lib/edb/as{{ pg_version }}/{{ pg_instance_name }}/data" | ||
pg_user_home: "/var/lib/edb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
--- | ||
pg_owner: "postgres" | ||
pg_port: "5432" | ||
pg_superuser: "postgres" | ||
pg_instance_name: "main" | ||
pg_data: "/var/lib/pgsql/{{ pg_version }}/{{ pg_instance_name }}/data" | ||
pg_user_home: "/var/lib/pgsql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters