AnsibleShipyard / ansible-zookeeper

Ansible playbook for ZooKeeper
MIT License
95 stars 114 forks source link

data_dir & log_dir not properly initialized for debian/ubuntu (non tarball deployment) #63

Open lhoss opened 7 years ago

lhoss commented 7 years ago

Just found out on a deployment on Ubuntu 16.04 I will def. provide a PR fix ASAP, by extracting the working task (from tarball.yml) out into common-config.yml

- name: "Create zookeeper {{item}} directory."
  file: path={{item}} state=directory owner=zookeeper group=zookeeper
  tags: bootstrap
  with_items:
    - "{{data_dir}}"
    - "{{log_dir}}"

Actually I'ld like todo the same with (not too old) task/feature (also in tarball):

- name: Add zookeeper's bin dir to the PATH
  copy: content="export PATH=$PATH:{{zookeeper_dir}}/bin" dest="/etc/profile.d/zookeeper_path.sh" mode=755
  when: zookeeper_register_path_env

@ernestas-poskus ok for you todo in the same PR ?

ps: Finally we would like to apply more cleanups in the role (sep. PR!), especially renaming those vars without zookeeper_ prefix. Again the question howto best keep downward compatibility (after renaming). I'ld propose to add an info block in the README incl. howto map from new->old vars (rather than add an automatic mapping in the default vars)

data_dir: zookeeper_data_dir
log_dir: zookeeper_ log_dir
ernestas-poskus commented 7 years ago

ok for you todo in the same PR ?

if they are related then ok

Finally we would like to apply more cleanups in the role (sep. PR!), especially renaming those vars without zookeeper_ prefix.

sounds good, this bothered me for a long time

I'ld propose to add an info block in the README incl. howto map from

info info README will be enough, in release I will mention breaking changes and notice to update as well.

lhoss commented 7 years ago

sounds good, this bothered me for a long time

👍

if they are related then ok

they are related in the sense that currently some common things (like dirs-init and optional env-vars) aren't present for all the deployment modes

Oh and finally (sep. PR) should try to unwrangle slightly diff. tasks around zoo.cfg and myid. ps: Do you have a clue why the 'myid' file is/was different between tarball (orig. only used for centos/redhat) and Debian(deb) version.. maybe distro specific(packaging) ? :

Debian.yml
  template: src=myid.j2 dest={{zookeeper_conf_dir}}/conf/myid force="{{ zookeeper_force_myid }}"
tarball.yml
  template: src=myid.j2 dest={{data_dir}}/myid owner=zookeeper group=zookeeper force="{{ zookeeper_force_myid }}"

Before doing all the cleanups, I've now revived the movitation to complete my test PR https://github.com/AnsibleShipyard/ansible-zookeeper/issues/60

ernestas-poskus commented 7 years ago

Do you have a clue why the 'myid' file is/was different between tarball (orig. only used for centos/redhat) and Debian(deb) version.. maybe distro specific(packaging) ?

might be related to packaging