diff --git a/hadoop/CDH/defaults/main.yml b/hadoop/CDH/defaults/main.yml new file mode 100644 index 00000000..a84f6089 --- /dev/null +++ b/hadoop/CDH/defaults/main.yml @@ -0,0 +1,10 @@ +--- +cdh_manager_install: False +cdh_manager_repo_url: 'https://archive.cloudera.com/cdh5/ubuntu/trusty/amd64/cdh/cloudera.list' + +cdh_use_separate_postgres_db: False +cdh_postgres_db_name: cdh +cdh_postgres_db_user: cdh +cdh_postgres_db_schema: cdh +cdh_postgresql_version: 9.6 +postgresql_jdbc_driver_version: 42.1.4 diff --git a/hadoop/CDH/tasks/main.yml b/hadoop/CDH/tasks/main.yml new file mode 100644 index 00000000..aa05f904 --- /dev/null +++ b/hadoop/CDH/tasks/main.yml @@ -0,0 +1,43 @@ +--- +- block: + - name: apt key for the Cloudera Manager repository + apt_key: url=https://archive.cloudera.com/cm5/ubuntu/trusty/amd64/cm/archive.key state=present + + - name: Install the Cloudera Manager repository + get_url: url={{ cdh_manager_repo_url }} dest=/etc/apt/sources.list.d/cloudera.list + register: cdh_repo + + - name: Update the apt cache + apt: update_cache=yes + when: ( cdh_repo | changed ) + + - name: Install the CDH Manager server + apt: pkg=cloudera-manager-server state=latest update_cache=yes cache_valid_time=1800 + + - name: Install the CDH Manager daemons + apt: pkg=cloudera-manager-daemons state=latest update_cache=yes cache_valid_time=1800 + + when: cdh_manager_install + tags: [ 'cdh', 'hadoop' ] + +- 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: cdh_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: cdh_use_separate_postgres_db + + - name: Install the Postgresql client + apt: pkg=postgresql-client-{{ cdh_postgresql_version }} state=latest update_cache=yes cache_valid_time=1800 + when: cdh_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: cdh_use_separate_postgres_db + + when: cdh_manager_install + tags: [ 'cdh', 'hadoop', 'cdh_manager', 'cdh_pg' ] +