Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #15 from kevincoakley/0.9.0
Browse files Browse the repository at this point in the history
0.9.0
  • Loading branch information
kevincoakley authored May 2, 2021
2 parents f23b4d6 + 6387c20 commit d2d0223
Show file tree
Hide file tree
Showing 17 changed files with 139 additions and 91 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/molecule-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Molecule Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
molecule_distro: ['centos7', 'centos8', 'ubuntu1804', 'ubuntu2004']
java_version: ['8', '11']
include:
- molecule_distro: centos7
java_version: latest
- molecule_distro: centos8
java_version: latest
- molecule_distro: ubuntu2004
java_version: 13
- molecule_distro: ubuntu2004
java_version: 14

env:
ANSIBLE_CALLBACK_WHITELIST: profile_tasks

steps:
- uses: actions/checkout@v1
- name: Set up Python 3
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible ansible-lint flake8 molecule molecule-docker docker yamllint
ansible --version
ansible-lint --version
molecule --version
- name: Test with molecule
run: |
molecule test --all
env:
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
JAVA_VERSION: ${{ matrix.java_version }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Created by .ignore support plugin (hsz.mobi)
*.retry
.cache/
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ansible-role-zeppelin
=====================

[![Build Status](https://travis-ci.org/kevincoakley/ansible-role-zeppelin.svg?branch=master)](https://travis-ci.org/kevincoakley/ansible-role-zeppelin)
[![Molecule Test](https://github.com/kevincoakley/ansible-role-zeppelin/actions/workflows/molecule-test.yml/badge.svg)](https://github.com/kevincoakley/ansible-role-zeppelin/actions/workflows/molecule-test.yml)

Install Apache Zeppelin - https://zeppelin.apache.org . Tested with CentOS 7 and Ubuntu 18.04.
Install Apache Zeppelin - https://zeppelin.apache.org . Tested with Zeppelin 0.9.0 with CentOS 7 & 8 and Ubuntu 18.04 & 20.04.

Requirements
------------
Expand Down
9 changes: 5 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
zeppelin_version: 0.8.1
zeppelin_version: 0.9.0
zeppelin_download_url: http://archive.apache.org/dist/zeppelin/zeppelin-{{ zeppelin_version }}/zeppelin-{{ zeppelin_version }}-bin-all.tgz
zeppelin_service_username: zeppelin
zeppelin_service_group: zeppelin
zeppelin_working_directory: /tmp/zeppelin_working_directory
zeppelin_java_home:
# Supported Java Versions:
# CentOS 7: 11, 8, or 7
# CentOS 7: latest, 11, 8, or 7
# CentOS 8: latest, 11, 8
# Ubuntu 18.04: 11 or 8
# Ubuntu 16.04: 8
zeppelin_java_version: 8
# Ubuntu 20.04: 14, 13, 11, or 8
zeppelin_java_version: 11

# Config options for zeppelin-site.xml
# See templates/zeppelin-site.xml.j2 for defaults.
Expand Down
6 changes: 4 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
galaxy_info:
role_name: zeppelin
namespace: kevincoakley
author: Kevin Coakley
description: Install Apache Zeppelin (https://zeppelin.apache.org)
# If the issue tracker for your role is not on github, uncomment the
license: BSD
min_ansible_version: 2.0
min_ansible_version: 2.5
platforms:
- name: EL
versions:
- 7
- 8
- name: Ubuntu
versions:
- xenial
- bionic
- focal
#
# Below are all categories currently available. Just as with
# the platforms above, uncomment those that apply to your role.
Expand Down
6 changes: 6 additions & 0 deletions molecule/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
warn_list:
- internal-error
- role-name
skip_list:
- yaml
10 changes: 1 addition & 9 deletions molecule/default/playbook.yml → molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
become: true

vars:
- zeppelin_java_version: "{{ lookup('env','JAVA_VERSION') | default('11', True) }}"
- zeppelin_working_directory: /zeppelin_working_directory
- zeppelin_mem: "-Xmx512m -XX:MaxPermSize=256m"

Expand All @@ -13,12 +14,3 @@
post_tasks:
- name: Restart any services before running the tests
meta: flush_handlers

- name: Give the Zeppelin time to start
pause:
seconds: 60

- name: Verify that Zeppelin is running on port 8080
uri:
url: http://127.0.0.1:8080
status_code: 200
20 changes: 10 additions & 10 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
options:
config-file: molecule/default/yaml-lint.yml
lint: |
set -e
yamllint -c molecule/yaml-lint.yml .
ansible-lint -c molecule/ansible-lint.yml .
flake8
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
Expand All @@ -21,13 +22,12 @@ platforms:
pre_build_image: true
provisioner:
name: ansible
lint:
name: ansible-lint
log: false
options:
vvv: false
playbooks:
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8
name: ansible
25 changes: 0 additions & 25 deletions molecule/default/playbook-java11.yml

This file was deleted.

10 changes: 10 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Verify
hosts: all
become: true

tasks:
- name: Verify that Zeppelin is running on port 8080
uri:
url: http://127.0.0.1:8080
status_code: 200
File renamed without changes.
22 changes: 22 additions & 0 deletions tasks/Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199
- name: Ensure 'man' directory exists.
file:
path: /usr/share/man/man1
state: directory
recurse: true
when: ansible_distribution == 'Ubuntu'

- name: fail on unsupported java version (18.04)
fail:
msg: "Java version must be 8 or 11"
when:
- zeppelin_java_version|string not in ["8", "11"]
- ansible_distribution_version == "18.04"

- name: fail on unsupported java version (20.04)
fail:
msg: "Java version must be 8, 11, 13 or 14"
when:
- zeppelin_java_version|string not in ["8", "11", "13", "14"]
- ansible_distribution_version == "20.04"
14 changes: 14 additions & 0 deletions tasks/RedHat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: fail on unsupported java version (RedHat 7)
fail:
msg: "Java version must be 7, 8, 11 or latest"
when:
- zeppelin_java_version|string not in ["7", "8", "11", "latest"]
- ansible_distribution_major_version == "7"

- name: fail on unsupported java version (RedHat 8)
fail:
msg: "Java version must be 8, 11 or latest"
when:
- zeppelin_java_version|string not in ["8", "11", "latest"]
- ansible_distribution_major_version == "8"
7 changes: 5 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- name: Include OS family specific variables
include_vars: "{{ ansible_os_family }}.yml"

- name: Include OS specific tasks
include_tasks: "{{ ansible_os_family }}.yml"

- name: Create the zeppelin group
group:
name: "{{ zeppelin_service_group }}"
Expand Down Expand Up @@ -41,15 +44,15 @@

- name: Install Java packages
package: name={{ item }}
with_items: "{{ zeppelin_java_package[zeppelin_java_version] }}"
with_items: "{{ zeppelin_java_package[zeppelin_java_version|string] }}"
register: zeppelin_java_install
until: zeppelin_java_install is success
retries: 10
delay: 2

- name: Set Java home from system packages
set_fact:
zeppelin_java_home: "{{ zeppelin_java_package_home[zeppelin_java_version] }}"
zeppelin_java_home: "{{ zeppelin_java_package_home[zeppelin_java_version|string] }}"
when: not (zeppelin_java_home | default)

#
Expand Down
12 changes: 8 additions & 4 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
zeppelin_java_package:
11: openjdk-11-jre-headless
8: openjdk-8-jre-headless
"14": openjdk-14-jre-headless
"13": openjdk-13-jre-headless
"11": openjdk-11-jre-headless
"8": openjdk-8-jre-headless
zeppelin_java_package_home:
11: /usr/lib/jvm/java-11-openjdk-amd64
8: /usr/lib/jvm/java-8-openjdk-amd64/jre
"14": /usr/lib/jvm/java-14-openjdk-amd64
"13": /usr/lib/jvm/java-13-openjdk-amd64
"11": /usr/lib/jvm/java-11-openjdk-amd64
"8": /usr/lib/jvm/java-8-openjdk-amd64/jre
zeppelin_packages: [sudo]
14 changes: 8 additions & 6 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
zeppelin_java_package:
11: java-11-openjdk-headless
8: java-1.8.0-openjdk-headless
7: java-1.7.0-openjdk-headless
latest: java-latest-openjdk-headless
"11": java-11-openjdk-headless
"8": java-1.8.0-openjdk-headless
"7": java-1.7.0-openjdk-headless
zeppelin_java_package_home:
11: /usr/lib/jvm/jre-11
8: /usr/lib/jvm/jre-1.8.0
7: /usr/lib/jvm/jre-1.7.0
latest: /usr/lib/jvm/jre
"11": /usr/lib/jvm/jre-11
"8": /usr/lib/jvm/jre-1.8.0
"7": /usr/lib/jvm/jre-1.7.0
zeppelin_packages: [sudo]

0 comments on commit d2d0223

Please sign in to comment.