Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable systemd service for Debian 8 #69

Merged

Conversation

dzeban
Copy link

@dzeban dzeban commented Jun 13, 2017

Currently, when running ansible-zookeeper role on Debian 8 host, it
fails:

TASK [AnsibleShipyard.ansible-zookeeper : Enable zookeeper service] 
***************************************************
fatal: [debian8-host]: FAILED! => {"changed": false, "failed": true, "msg": "Could not find the requested service zookeeper: host"}

This happens because zookeeper_debian_systemd_enabled variable is
enabled only for Ubuntu >= 15.04 hosts.

This PR adds check for Debian >= 8.0, so Zookeeper successfully installs
on Debian 8.0

@@ -4,7 +4,7 @@ zookeeper_url: http://www.us.apache.org/dist/zookeeper/zookeeper-{{zookeeper_ver

# 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_systemd_enabled: "{{ ansible_distribution_version|version_compare(15.04, '>=') or ansible_distribution_version|version_compare(8.0, '>=') }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now this check includes all versions from 8.0 please change or condition to or (debian and version >= 8.0)

Currently, when running ansible-zookeeper role on Debian 8 host, it
fails:

    TASK [AnsibleShipyard.ansible-zookeeper : Enable zookeeper service] ***************************************************
    fatal: [debian8-host]: FAILED! => {"changed": false, "failed": true, "msg": "Could not find the requested service zookeeper: host"}

This happens because `zookeeper_debian_systemd_enabled` variable is
enabled only for Ubuntu >= 15.04 hosts.

This PR adds check for Debian >= 8.0, so Zookeeper successfully installs
on Debian 8.0
@dzeban dzeban force-pushed the enable-systemd-debian8 branch from 9fff4b4 to eb88708 Compare June 14, 2017 08:40
@dzeban
Copy link
Author

dzeban commented Jun 14, 2017

@ernestas-poskus Good catch! Sorry for my sloppiness - I've fixed version compare. It's now a bit more verbose but more robust - it checks versions for Ubuntu and Debian separately. If it seems complicated I can put the comparison inside zookeeper_debian_systemd_enabled template but it'll be huge. What do you think?

@ernestas-poskus
Copy link
Member

It's now a bit more verbose but more robust - it checks versions for Ubuntu and Debian separately

Yes looks very good !

If it seems complicated I can put the comparison inside zookeeper_debian_systemd_enabled template but it'll be huge.

Reads better now, I like extra underscore in front 👍

@ernestas-poskus ernestas-poskus merged commit d57a942 into AnsibleShipyard:master Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants