From 01f2374f5fead696d1447326ffd8b5aeba6a397d Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 7 Dec 2017 17:34:19 +0100 Subject: [PATCH] HDP: add the tasks needed to support a remote postgresql server. --- hadoop/HDP/defaults/main.yml | 2 ++ hadoop/HDP/tasks/main.yml | 26 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/hadoop/HDP/defaults/main.yml b/hadoop/HDP/defaults/main.yml index 55b9c45b..3296e4af 100644 --- a/hadoop/HDP/defaults/main.yml +++ b/hadoop/HDP/defaults/main.yml @@ -5,3 +5,5 @@ hdp_ambari_repo_url: 'http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/u hdp_ambari_repo_key: 'B9733A7A07513CAD' ambari_use_separate_postgres_db: False +ambari_postgresql_version: 9.6 +postgresql_jdbc_driver_version: 42.1.4 diff --git a/hadoop/HDP/tasks/main.yml b/hadoop/HDP/tasks/main.yml index e69f10f1..d2118da6 100644 --- a/hadoop/HDP/tasks/main.yml +++ b/hadoop/HDP/tasks/main.yml @@ -12,7 +12,29 @@ when: ( ambari_repo | changed ) - name: Install the ambari server - apt: pkg=ambari-server state=latest - + apt: pkg=ambari-server state=latest update_cache=yes cache_valid_time=1800 + when: hdp_ambari_install tags: [ 'hdp', 'hadoop', 'ambari' ] + +- block: + + - name: Get the signing key for the postgresql.org repository + apt_key: url=https://www.postgresql.org/media/keys/ACCC4CF8.asc state=present + when: ambari_use_separate_postgres_db + + - name: Setup the postgresql.org repository + apt_repository: repo='deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_lsb.codename }}-pgdg main' update_cache=yes + when: ambari_use_separate_postgres_db + + - name: Install the Postgresql client + apt: pkg=postgresql-client-{{ ambari_postgresql_version }} state=latest update_cache=yes cache_valid_time=1800 + when: ambari_use_separate_postgres_db + + - name: Download the jdbc driver + get_url: url=https://jdbc.postgresql.org/download/postgresql-{{ postgresql_jdbc_driver_version }}.jar dest=/srv/postgresql.jar + when: ambari_use_separate_postgres_db + + when: hdp_ambari_install + tags: [ 'hdp', 'hadoop', 'ambari', 'ambari_pg' ] +