Skip to content

Commit

Permalink
Merge pull request #58 from teralytics/support_custom_zookeeper_debia…
Browse files Browse the repository at this point in the history
…n_apt_repository

Support custom zookeeper debian apt repository (to use v3.4.8 on Ubuntu 14.04
  • Loading branch information
ernestas-poskus authored Jan 6, 2017
2 parents 8d00311 + 8dd152c commit 844e131
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ Role Variables
```yaml
---
ansible_playbook_version: 0.1
zookeeper_playbook_version: "0.9.2"
zookeeper_playbook_version: "0.17.0"
zookeeper_version: 3.4.6
zookeeper_url: http://www.us.apache.org/dist/zookeeper/zookeeper-{{zookeeper_version}}/zookeeper-{{zookeeper_version}}.tar.gz

# Flag that selects if systemd or upstart will be used for the init service:
# Note: by default Ubuntu 15.04 and later use systemd (but support switch to upstart)
zookeeper_debian_systemd_enabled: "{{ ansible_distribution_version|version_compare(15.04, '>=') }}"
zookeeper_debian_apt_install: false
# (Optional:) add custom 'ppa' repositories depending on the distro version (only with debian_apt_install=true)
# Example: to use a community zookeeper v3.4.8 deb pkg for Ubuntu 14.04 (where latest official is v3.4.5)
zookeeper_debian_apt_repositories:
- repository_url: "ppa:ufscar/zookeeper"
distro_version: "14.04"

apt_cache_timeout: 3600
zookeeper_register_path_env: false

Expand Down
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
ansible_playbook_version: 0.1
zookeeper_playbook_version: "0.9.2"
zookeeper_playbook_version: "0.17.0"
zookeeper_version: 3.4.6
zookeeper_url: http://www.us.apache.org/dist/zookeeper/zookeeper-{{zookeeper_version}}/zookeeper-{{zookeeper_version}}.tar.gz

# Flag that selects if systemd or upstart will be used for the init service:
# Note: by default Ubuntu 15.04 and later use systemd (but support switch to upstart)
zookeeper_debian_systemd_enabled: "{{ ansible_distribution_version|version_compare(15.04, '>=') }}"
zookeeper_debian_apt_install: false
zookeeper_debian_apt_repositories: []
apt_cache_timeout: 3600
zookeeper_register_path_env: false

Expand Down
6 changes: 6 additions & 0 deletions tasks/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---
- name: Add optional custom apt repositories (for additional zookeeper versions)
apt_repository: repo={{item.repository_url}} state=present
when: "{{ ansible_distribution_version|version_compare(item.distro_version, item.version_comparator|default('=')) }}"
with_items:
- "{{ zookeeper_debian_apt_repositories }}"

- name: Update apt cache
apt: update_cache=yes cache_valid_time={{apt_cache_timeout}}
tags: bootstrap
Expand Down

0 comments on commit 844e131

Please sign in to comment.