diff --git a/.travis.yml b/.travis.yml index 1d1a801..b65a0ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 diff --git a/README.md b/README.md index 70026b2..e773455 100644 --- a/README.md +++ b/README.md @@ -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 ------------ diff --git a/defaults/main.yml b/defaults/main.yml index 06d5205..08e4cf0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 @@ -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 diff --git a/handlers/main.yml b/handlers/main.yml index 5d80f00..561e183 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,4 +4,4 @@ service: name: zeppelin state: restarted - when: service_control == True + when: service_control diff --git a/meta/main.yml b/meta/main.yml index 4164d1e..3c04d06 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 6595d89..35281c0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 @@ -32,6 +39,10 @@ - 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 }} @@ -39,14 +50,21 @@ (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 @@ -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: @@ -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: @@ -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: @@ -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 diff --git a/templates/zeppelin.upstart.conf.j2 b/templates/zeppelin.upstart.conf.j2 deleted file mode 100644 index 927b191..0000000 --- a/templates/zeppelin.upstart.conf.j2 +++ /dev/null @@ -1,10 +0,0 @@ -description "zeppelin" - -start on (local-filesystems and net-device-up IFACE!=lo) -stop on shutdown - -respawn -respawn limit 7 5 - -chdir /opt/zeppelin -exec bin/zeppelin-daemon.sh upstart diff --git a/tests/docker_containers.yml b/tests/docker_containers.yml index 079566b..62e66f4 100644 --- a/tests/docker_containers.yml +++ b/tests/docker_containers.yml @@ -1,7 +1,7 @@ --- docker_containers: - name: ubuntu-system - image: kevincoakley/ubuntu16.04-systemd + image: kevincoakley/ubuntu18.04-systemd expose: - "8080" ports: @@ -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" diff --git a/tests/inventory b/tests/inventory index c790bf7..1f24576 100644 --- a/tests/inventory +++ b/tests/inventory @@ -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