Skip to content

Commit e26f51e

Browse files
authored
Add Ubuntu 18.04, Ubuntu 20.04, EL8 support (#62)
* Add support for EL8 * Add support for Ubuntu 18.04 bionic * Add support for Ubuntu 20.04 focal fossa Signed-off-by: Daniel Chaffelson <[email protected]>
1 parent f62a733 commit e26f51e

File tree

6 files changed

+77
-14
lines changed

6 files changed

+77
-14
lines changed

cluster.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
- full_cluster
7070

7171
- name: Verify definition [verify_definition]
72-
hosts: localhost
72+
hosts: cloudera_manager
7373
gather_facts: no
7474
roles:
7575
- cloudera.cluster.verify.definition
@@ -92,7 +92,7 @@
9292

9393
# Moved from verify_parcels to reduce duplication
9494
- name: Verify definition [verify_parcels_and_roles]
95-
hosts: localhost
95+
hosts: cloudera_manager
9696
gather_facts: no
9797
roles:
9898
- cloudera.cluster.verify.parcels_and_roles
@@ -106,7 +106,7 @@
106106
# STARTBLOCK # Prepare Nodes
107107

108108
- name: Apply OS pre-requisite configurations
109-
hosts: cloudera_manager, cluster
109+
hosts: cloudera_manager, cluster, ca_server
110110
become: yes
111111
roles:
112112
- cloudera.cluster.prereqs.os
@@ -441,6 +441,7 @@
441441
when: cloudera_manager_agent_wait_for_heartbeat | default(True)
442442
tags:
443443
- heartbeat
444+
- default_cluster
444445
- full_cluster
445446

446447
- name: Deploy Cloudera Management Service
@@ -466,7 +467,7 @@
466467
- full_cluster
467468

468469
- name: Deploy clusters
469-
hosts: localhost
470+
hosts: cloudera_manager
470471
gather_facts: no
471472
roles:
472473
- cloudera.cluster.deployment.cluster

roles/cloudera_deploy/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use_default_cluster_definition: no
4343

4444
# Default parcel cache
4545
default_enable_download_mirror: no
46-
default_parcel_distro: el7.parcel
46+
default_parcel_distro: el7 # el8, bionic, focal
4747
default_download_link_expiry: 3600
4848

4949
# Default Deployment Controls

roles/cloudera_deploy/tasks/init.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@
277277
- "Permissions are {{ __private_key_file_stat.stat.mode }}"
278278
- "Permissions should be 0400 or 0600"
279279

280+
# Parcel Distro
281+
- name: Determine preferred Parcel Distribution
282+
ansible.builtin.set_fact:
283+
init__parcel_distro: "{{ parcel_distro | default(default_parcel_distro) }}"
284+
280285
# Read in Dynamic Inventory
281286
- name: Seek Inventory Template in Definition Path
282287
register: __di_template_stat
@@ -329,6 +334,7 @@
329334
- dynamic_inventory:
330335
vm:
331336
count: "{{ __dynamic_inventory_host_list | count }}"
337+
os: "{{ init__parcel_distro }}"
332338
always:
333339
- name: Remove Dynamic Inventory Template from current inventory
334340
include_tasks: refresh_inventory.yml

roles/cloudera_deploy/tasks/inject_download_mirror.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,26 @@
8686
ansible.builtin.set_fact:
8787
init__cluster_repo_entries: "{{ init__cluster_repo_entries | default([]) + [__cluster_repo_item | urlsplit('path') ] }}"
8888

89-
- name: Create list of Download Mirror URLs filtered to required repositories for run
89+
- name: Create list of Download Mirror URLs filtered to required repositories and distros
9090
loop: "{{ init__cluster_repo_entries }}"
9191
loop_control:
9292
loop_var: __cluster_repo_path_item
9393
ansible.builtin.set_fact:
94-
init__urls_to_sign: "{{ init__urls_to_sign | default([]) + __download_mirror_ini_entry | select('search', __cluster_repo_path_item) | list }}"
94+
init__urls_to_sign: "{{ init__urls_to_sign
95+
| default([]) + __download_mirror_ini_entry
96+
| select('search', __cluster_repo_path_item)
97+
| select('search', init__parcel_distro)
98+
| list }}"
99+
100+
- name: Ensure manifest is included in Download Mirror URLs if present
101+
loop: "{{ init__cluster_repo_entries }}"
102+
loop_control:
103+
loop_var: __cluster_repo_path_item
104+
ansible.builtin.set_fact:
105+
init__urls_to_sign: "{{ init__urls_to_sign
106+
| default([]) + __download_mirror_ini_entry
107+
| select('search', 'manifest.json')
108+
| list }}"
95109

96110
- name: Get AWS Specific download URIs
97111
when:

roles/cloudera_deploy/tasks/populate_download_mirror.yml

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
loop: "{{ globals.download_mirror_targets }}"
2929
loop_control:
3030
loop_var: __mirror_fetch_item
31-
async: 3600
31+
async: 7200
3232
poll: 0
3333
ansible.builtin.get_url:
3434
url: "{{ __mirror_fetch_item }}"
@@ -42,8 +42,8 @@
4242
loop_var: __download_async_item
4343
register: __async_download_results
4444
until: __async_download_results.finished is defined and __async_download_results.finished
45-
delay: 15
46-
retries: 300
45+
delay: 30
46+
retries: 240
4747
async_status:
4848
jid: "{{ __download_async_item.ansible_job_id }}"
4949
failed_when:
@@ -66,18 +66,58 @@
6666
when: globals.infra_type == 'aws'
6767
block:
6868
# Prepare to sync cache dir to S3
69-
- name: Prepare host for Python actions
69+
- name: Setup System Rhel8
70+
when:
71+
- ansible_os_family == 'RedHat'
72+
- ansible_distribution_major_version | int >= 8
7073
become: yes
7174
ansible.builtin.package:
75+
lock_timeout: 180
7276
name: "{{ __package_item }}"
77+
update_cache: yes
7378
state: present
74-
lock_timeout: 180
79+
loop_control:
80+
loop_var: __package_item
81+
loop:
82+
- epel-release
83+
- python3
84+
85+
- name: Setup system Rhel7
86+
when:
87+
- ansible_os_family == 'RedHat'
88+
- ansible_distribution_major_version | int < 8
89+
become: yes
90+
ansible.builtin.package:
91+
name: "{{ __package_item }}"
92+
state: present
93+
lock_timeout: "{{ (ansible_os_family == 'RedHat') | ternary(180, omit) }}"
7594
loop_control:
7695
loop_var: __package_item
7796
loop:
7897
- epel-release
7998
- python-pip
8099

100+
- name: Setup system Debian
101+
when: ansible_os_family == "Debian"
102+
block:
103+
- name: enable Debian Repos
104+
become: yes
105+
apt_repository:
106+
repo: "{{ __repo_item }}"
107+
loop_control:
108+
loop_var: __repo_item
109+
loop:
110+
- "deb http://archive.ubuntu.com/ubuntu/ {{ globals.dynamic_inventory.vm.os }} universe"
111+
- "deb http://archive.ubuntu.com/ubuntu/ {{ globals.dynamic_inventory.vm.os }}-updates universe"
112+
- "deb http://security.ubuntu.com/ubuntu/ {{ globals.dynamic_inventory.vm.os }}-security universe"
113+
114+
- name: Install Pip on Debian
115+
become: yes
116+
ansible.builtin.apt:
117+
update_cache: yes
118+
name: python3-pip
119+
state: present
120+
81121
- name: Prepare host for s3 actions
82122
become: yes
83123
ansible.builtin.pip:
@@ -86,7 +126,7 @@
86126
loop_var: __pip_item
87127
loop:
88128
- futures
89-
- boto3 >= 1.4.4
129+
- "{{ (ansible_python_version[0] == '2') | ternary('boto3 >= 1.4.4,<1.18', 'boto3 >= 1.20.0') }}"
90130

91131
- name: Sync downloaded Files paths to S3 cache bucket
92132
become: yes

roles/cloudera_deploy/tasks/prepare_download_mirror.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@
3939
public: yes
4040
vars:
4141
repositories: "{{ __init_parcel_repos }}"
42+
cluster_os_distribution: "{{ init__parcel_distro }}"
4243

4344
- name: Extract Parcel URLs from Manifests
4445
ansible.builtin.set_fact:
4546
__parcel_urls: "{{ manifests.results | cloudera.cluster.extract_parcel_urls }}"
47+
__parcel_distro_search_term: "{{ init__parcel_distro }}.parcel"
4648

4749
- name: Filter Parcels by distro
4850
ansible.builtin.set_fact:
49-
__filtered_parcel_urls: "{{ __parcel_urls | select('search', parcel_distro | default(default_parcel_distro)) | list }}"
51+
__filtered_parcel_urls: "{{ __parcel_urls | select('search', __parcel_distro_search_term ) | list }}"
5052

5153
- name: Prepare target Download Mirror listing with parcels and attendant files
5254
when: __filtered_parcel_urls | length > 0

0 commit comments

Comments
 (0)