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 #12 from kevincoakley/0.8.0
Browse files Browse the repository at this point in the history
0.8.0
  • Loading branch information
kevincoakley authored Feb 14, 2019
2 parents 4074b97 + 2ca7328 commit a00d55f
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 55 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ before_install:
- printf "Host 127.0.0.1\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null" > ~/.ssh/config

install:
- sudo pip install docker-py
- sudo pip install docker
# software-properties-common for ubuntu 14.04
- sudo apt-get install -y sshpass software-properties-common
- sudo apt-add-repository -y ppa:ansible/ansible
Expand All @@ -32,12 +32,11 @@ install:
script:
# ansible-lint checks playbooks for practices and behaviour that could potentially be improved
# Ignore [ANSIBLE0006] yum used in place of yum module
# Ignore [ANSIBLE0016] Tasks that run when changed should likely be handlers
- ansible-lint -x ANSIBLE0006,ANSIBLE0016 -R .
- ansible-lint -x ANSIBLE0006 -R .
# Perform a syntax check on the playbook
- ansible-playbook -i tests/inventory tests/test.yml --syntax-check
# Run the playbook, don't bother stopping the Docker containers
- ansible-playbook -i tests/inventory --skip-tags=docker-stop tests/test.yml -vvvv
- ansible-playbook -i tests/inventory --skip-tags=docker-stop tests/test.yml
# Run again to test idempotence
- >
ansible-playbook -i tests/inventory --tags=zeppelin tests/test.yml
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ansible-role-zeppelin

[![Build Status](https://travis-ci.org/kevincoakley/ansible-role-zeppelin.svg?branch=master)](https://travis-ci.org/kevincoakley/ansible-role-zeppelin)

Install Apache Zeppelin - https://zeppelin.apache.org . Tested with CentOS 7, Ubuntu 14.04 and Ubuntu 16.04.
Install Apache Zeppelin - https://zeppelin.apache.org . Tested with CentOS 7 and Ubuntu 18.04.

Requirements
------------
Expand Down
10 changes: 7 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
zeppelin_version: 0.7.3
zeppelin_version: 0.8.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
Expand Down Expand Up @@ -81,8 +81,12 @@ zeppelin_pyspark_python:
zeppelin_pythonpath:

# Config options for shiro.ini
zeppelin_users: {}
zeppelin_roles: {}
zeppelin_users:
user: user
password: password
zeppelin_roles:
role: role
perms: '*'
zeppelin_auth_active_directory_enabled: no
zeppelin_auth_active_directory_options: {}
zeppelin_auth_ldap_enabled: no
Expand Down
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
service:
name: zeppelin
state: restarted
when: service_control == True
when: service_control
6 changes: 3 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ galaxy_info:
- 7
- name: Ubuntu
versions:
- trusty
- xenial
- bionic
#
# Below are all categories currently available. Just as with
# the platforms above, uncomment those that apply to your role.
#
categories:
galaxy_tags:
- spark
- big-data
- bigdata
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
Expand Down
48 changes: 24 additions & 24 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@
append: yes
shell: /bin/bash

- name: Update system repositories (Debian)
apt:
update_cache: yes
when: ansible_os_family == 'Debian'

- name: Check if Java 8 is available from system repositories (Debian)
shell: apt-cache search {{ zeppelin_java_8_package }} | grep -qF {{ zeppelin_java_8_package }}
shell: set -o pipefail && apt-cache search {{ zeppelin_java_8_package }} | grep -qF {{ zeppelin_java_8_package }}
args:
executable: /bin/bash
when: not (zeppelin_java_home | default) and ansible_os_family == 'Debian'
register: zeppelin_java_8_debian_check
failed_when: False
Expand All @@ -32,21 +39,32 @@
- name: Install common packages
package: name={{ item }}
with_items: "{{ zeppelin_packages }}"
register: zeppelin_common_install
until: zeppelin_common_install is success
retries: 10
delay: 2

- name: Install Java 8 package
package: name={{ zeppelin_java_8_package }}
when: >
(zeppelin_java_8_debian_check.rc | default) == 0 or
(zeppelin_java_8_redhat_check.rc | default) == 0
register: zeppelin_java_8_install
until: zeppelin_java_8_install is success
retries: 10
delay: 2

- name: Install Java 7 package
package: name={{ zeppelin_java_7_package }}
when: not (zeppelin_java_home | default) and (zeppelin_java_8_install | skipped)
register: zeppelin_java_7_install
until: zeppelin_java_7_install is success
retries: 10
delay: 2
when: not (zeppelin_java_home | default) and (zeppelin_java_8_install is skipped)

- name: Set Java home from system packages
set_fact:
zeppelin_java_home: "{{ zeppelin_java_7_home if zeppelin_java_8_install | skipped else zeppelin_java_8_home }}"
zeppelin_java_home: "{{ zeppelin_java_7_home if zeppelin_java_8_install is skipped else zeppelin_java_8_home }}"
when: not (zeppelin_java_home | default)
#
# Install Zeppelin
Expand All @@ -68,7 +86,7 @@
get_url:
url: "{{ zeppelin_download_url }}"
dest: "/tmp/zeppelin-{{ zeppelin_version }}.tgz"
when: zeppelin_install_path.stat.exists == False
when: not zeppelin_install_path.stat.exists

- name: Extract Zeppelin into the install directory
unarchive:
Expand All @@ -77,7 +95,7 @@
copy: no
owner: "{{ zeppelin_service_username }}"
group: "{{ zeppelin_service_group }}"
when: zeppelin_install_path.stat.exists == False
when: not zeppelin_install_path.stat.exists

- name: Create a symlink for /opt/zeppelin
file:
Expand All @@ -86,7 +104,7 @@
owner: "{{ zeppelin_service_username }}"
group: "{{ zeppelin_service_group }}"
state: link
when: zeppelin_install_path.stat.exists == False
when: not zeppelin_install_path.stat.exists

- name: Create the Zeppelin Site config file
template:
Expand Down Expand Up @@ -137,24 +155,6 @@
tags:
- service

- name: Copy the Upstart service file
template:
src: zeppelin.upstart.conf.j2
dest: /etc/init/zeppelin.conf
owner: root
group: root
mode: 0644
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'
register: upstart
tags:
- service

- name: Reload Upstart Configuration
command: /sbin/initctl reload-configuration
when: upstart.changed
tags:
- service

- name: Ensure Zeppelin is started and enabled on boot
service:
name: zeppelin
Expand Down
10 changes: 0 additions & 10 deletions templates/zeppelin.upstart.conf.j2

This file was deleted.

9 changes: 1 addition & 8 deletions tests/docker_containers.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
docker_containers:
- name: ubuntu-system
image: kevincoakley/ubuntu16.04-systemd
image: kevincoakley/ubuntu18.04-systemd
expose:
- "8080"
ports:
Expand All @@ -18,10 +18,3 @@ docker_containers:
- "8082:8080"
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup"
- name: upstart-system
image: ubuntu-upstart:14.04
expose:
- "8080"
ports:
- "2244:22"
- "8083:8080"
1 change: 0 additions & 1 deletion tests/inventory
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ localhost ansible_connection=local
[zeppelin]
ubuntu-system ansible_ssh_host=127.0.0.1 ansible_port=2200
centos-system ansible_ssh_host=127.0.0.1 ansible_port=2222
upstart-system ansible_ssh_host=127.0.0.1 ansible_port=2244 ansible_ssh_pass=docker.io

0 comments on commit a00d55f

Please sign in to comment.