Add support for CentOS/EL.

This commit is contained in:
Andrea Dell'Amico 2020-07-30 15:19:19 +02:00
parent a3ff075ee9
commit 2cbd5580d2
9 changed files with 89 additions and 49 deletions

View File

@ -8,8 +8,27 @@ cdh_ubuntu_repo_key: 'http://archive.cloudera.com/cm5/ubuntu/xenial/amd64/cm/arc
cdh_ubuntu_packages_repo: 'deb [arch=amd64] http://archive.cloudera.com/cm5/ubuntu/xenial/amd64/cm xenial-cm5 contrib'
cdh_ubuntu_manager_repo_url: 'https://archive.cloudera.com/cdh5/ubuntu/xenial/amd64/cdh/cloudera.list'
#cdh_manager_download_url: 'http://archive.cloudera.com/cm5/installer/5.9.3/cloudera-manager-installer.bin'
cdh_centos_repo_url: 'https://archive.cloudera.com/cm5/redhat/7/x86_64/cm/cloudera-manager.repo'
cdh_csd_directory: /opt/cloudera/csd
cdh_el_firewalld_ports:
- { port: '1-65535', protocol: 'tcp', state: 'enabled', zone: '{{ firewalld_default_zone }}' }
- { port: '1-65535', protocol: 'udp', state: 'enabled', zone: '{{ firewalld_default_zone }}' }
cdh_cm_deb_packages:
- 'cloudera-manager-server'
- 'cloudera-manager-daemons'
- 'postgresql-client'
cdh_cm_el_packages:
- 'cloudera-manager-server'
- 'cloudera-manager-daemons'
- 'postgresql'
cdh_agent_packages:
- 'cloudera-manager-agent'
- 'cloudera-manager-daemons'
# Set it to true on the oozie server nodes
cdh_oozie_server: False
cdh_oozie_ext_libs_url: 'https://archive.cloudera.com/gplextras/misc/ext-2.2.zip'
@ -19,7 +38,7 @@ cdh_impala_haproxy: False
cdh_cmf_server_args: ''
cdh_cmf_heap: '4G'
cdh_cmf_java_opts: '-Xmx{{ cdh_cmf_heap }} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'
cdh_cmf_jdbc_pg_driver: '/srv/postgres.jar'
cdh_cmf_jdbc_pg_driver: '/srv/postgresql-jdbc.jar'
cdh_use_separate_postgres_db: True
cdh_postgres_db_host: localhost

View File

@ -15,7 +15,11 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- bionic
- trusty
- xenial
- name: EL
versions:
- 7
galaxy_tags:
- hadoop
@ -30,7 +34,7 @@ dependencies:
version: master
name: nginx
state: latest
when: nginx_enabled
when: cdh_manager_install
- src: git+https://gitea-s2i2s.isti.cnr.it/ISTI-ansible-roles/ansible-role-haproxy.git
version: master
name: haproxy

View File

@ -1,47 +1,19 @@
---
- block:
- name: apt key for the Cloudera Manager repository
apt_key: url='{{ cdh_ubuntu_repo_key }}' state=present
- name: Disable the signature check, because the signature is too old
copy: src=apt-99cloudera dest=/etc/apt/apt.conf.d/99cloudera owner=root mode='0644'
when: cdh_major_version <= 5
- name: Install the Cloudera CDH packages repository
apt_repository: repo='{{ cdh_ubuntu_packages_repo }}' update_cache=yes
- name: Install the CDH Manager server
apt: pkg=cloudera-manager-server state=present update_cache=yes cache_valid_time=1800
- name: Install the CDH Manager daemons
apt: pkg=cloudera-manager-daemons state=present update_cache=yes cache_valid_time=1800
- name: Install the Cloudera Manager DB configuration
template: src=db.properties.j2 dest=/etc/cloudera-scm-server/db.properties mode=0640 owner=cloudera-scm group=cloudera-scm
tags: [ 'cdh', 'hadoop', 'cdh_m_conf' ]
- block:
- name: Download the jdbc driver
get_url: url=https://jdbc.postgresql.org/download/postgresql-{{ postgresql_jdbc_driver_version }}.jar dest='{{ cdh_cmf_jdbc_pg_driver }}'
- name: Install the Cloudera Manager defaults
template: src=cloudera-scm-server.default.j2 dest=/etc/default/cloudera-scm-server owner=root group=root mode='0444'
notify: Restart cloudera-scm-server
tags: [ 'cdh', 'hadoop', 'cdh_conf' ]
- name: Install the Cloudera Manager DB configuration
template: src=db.properties.j2 dest=/etc/cloudera-scm-server/db.properties mode=0640 owner=cloudera-scm group=cloudera-scm
notify: Restart cloudera-scm-server
tags: [ 'cdh', 'hadoop', 'cdh_m_conf' ]
- name: Ensure that the cloudera manager daemon is running and enabled
service: name=cloudera-scm-server state=restarted enabled=yes
when:
- cdh_manager_install
- ansible_distribution_file_variety == "Debian"
tags: [ 'cdh', 'hadoop' ]
- block:
- name: Install the Postgresql client
apt: pkg=postgresql-client state=latest update_cache=yes cache_valid_time=1800
when: ansible_distribution_file_variety == "Debian"
- name: Download the jdbc driver
get_url: url=https://jdbc.postgresql.org/download/postgresql-{{ postgresql_jdbc_driver_version }}.jar dest='{{ cdh_cmf_jdbc_pg_driver }}'
when:
- cdh_manager_install
tags: [ 'cdh', 'hadoop', 'cdh_manager', 'cdh_pg' ]
- name: Install the Cloudera Manager defaults
template: src=cloudera-scm-server.default.j2 dest=/etc/default/cloudera-scm-server owner=root group=root mode='0444'
notify: Restart cloudera-scm-server
tags: [ 'cdh', 'hadoop', 'cdh_conf' ]
- name: Ensure that the cloudera manager daemon is running and enabled
service: name=cloudera-scm-server state=started enabled=yes
tags: [ 'cdh', 'hadoop' ]

21
tasks/cdm_deb.yml Normal file
View File

@ -0,0 +1,21 @@
---
- block:
- name: apt key for the Cloudera Manager repository
apt_key: url='{{ cdh_ubuntu_repo_key }}' state=present
- name: Disable the signature check, because the signature is too old
copy: src=apt-99cloudera dest=/etc/apt/apt.conf.d/99cloudera owner=root mode='0644'
when: cdh_major_version <= 5
- name: Install the Cloudera CDH packages repository
apt_repository: repo='{{ cdh_ubuntu_packages_repo }}' update_cache=yes
- name: Install the CDH Manager server packages
apt: pkg={{ cdh_cm_deb_packages }} state=present cache_valid_time=1800
when: cdh_manager_install
- name: Install the CDH Manager agents and daemons
apt: pkg={{ cdh_agent_packages }} state=present cache_valid_time=1800
when: not cdh_manager_install
tags: [ 'cdh', 'hadoop' ]

20
tasks/cdm_el.yml Normal file
View File

@ -0,0 +1,20 @@
---
- name: CentOS packages and firewall rules
block:
- name: Manage the dovecot related tcp/udp ports
firewalld: port={{ item.port }}/{{ item.protocol }} zone={{ item.zone }} permanent={{ item.permanent | default(True) }} state={{ item.state }} immediate=True
with_items: '{{ cdh_el_firewalld_ports }}'
when: firewalld_enabled
- name: Download the Cloudera yum repository definition
get_url: url={{ cdh_centos_repo_url }} dest=/etc/yum.repos.d/cloudera-manager.repo
- name: Install the CDH Manager server and daemons
yum: pkg={{ cdh_cm_el_packages }} state=present
when: cdh_manager_install
- name: Install the CDH Manager agents and daemons
yum: pkg={{ cdh_agent_packages }} state=present
when: not cdh_manager_install
tags: [ 'cdh', 'hadoop' ]

View File

@ -1,4 +1,8 @@
---
- import_tasks: cdh_deb.yml
when: ansible_distribution_file_variety == "Debian"
- import_tasks: cdh_el.yml
when: ansible_distribution_file_variety == "RedHat"
- import_tasks: cdm.yml
when: cdh_manager_install
- import_tasks: spark2.yml

View File

@ -1,7 +1,7 @@
---
- block:
- name: Install the haproxy configuration
template: src=hue-hive-impala_haproxy.cfg dest=/etc/haproxy/haproxy.cfg owner=root group=root
template: src=hue-hive-impala_haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg owner=root group=root
notify: Reload haproxy
tags: [ 'cdh', 'haproxy', 'impala', 'hue', 'hive' ]

View File

@ -5,4 +5,4 @@
notify: Restart cloudera-scm-server
when: cdh_spark2_enabled
tags: [ 'cdh', 'hadoop', 'spark' ]
tags: [ 'cdh', 'hadoop', 'spark' ]