diff --git a/README.md b/README.md index 0e23bee..29a5375 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,8 @@ zookeeper_autopurge_snapRetainCount: 10 data_dir: /var/lib/zookeeper log_dir: /var/log/zookeeper -zookeeper_dir: /opt/zookeeper-{{zookeeper_version}} +zookeeper_dir: /opt/zookeeper-{{zookeeper_version}} # or /usr/share/zookeeper when zookeeper_debian_apt_install is true +zookeeper_conf_dir: {{zookeeper_dir}} # or /etc/zookeeper when zookeeper_debian_apt_install is true zookeeper_tarball_dir: /opt/src # List of dict (i.e. {zookeeper_hosts:[{host:,id:},{host:,id:},...]}) diff --git a/defaults/main.yml b/defaults/main.yml index 5a18ec1..7675470 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -20,7 +20,8 @@ zookeeper_autopurge_snapRetainCount: 10 data_dir: /var/lib/zookeeper log_dir: /var/log/zookeeper -zookeeper_dir: /opt/zookeeper-{{zookeeper_version}} +zookeeper_dir: "{{ zookeeper_debian_apt_install | ternary('/usr/share/zookeeper', '/opt/zookeeper-' + zookeeper_version) }}" +zookeeper_conf_dir: "{{ zookeeper_debian_apt_install | ternary('/etc/zookeeper', zookeeper_dir) }}" zookeeper_tarball_dir: /opt/src # Rolling file appender setttings diff --git a/tasks/Debian.yml b/tasks/Debian.yml index 1da9302..e33536f 100644 --- a/tasks/Debian.yml +++ b/tasks/Debian.yml @@ -11,13 +11,13 @@ - zookeeperd - name: Overwrite myid file. - template: src=myid.j2 dest=/etc/zookeeper/conf/myid force="{{ zookeeper_force_myid }}" + template: src=myid.j2 dest={{zookeeper_conf_dir}}/conf/myid force="{{ zookeeper_force_myid }}" tags: deploy notify: - Restart zookeeper - name: Overwrite default config file - template: src=zoo.cfg.j2 dest=/etc/zookeeper/conf/zoo.cfg + template: src=zoo.cfg.j2 dest={{zookeeper_conf_dir}}/conf/zoo.cfg tags: deploy notify: - Restart zookeeper diff --git a/tasks/common-config.yml b/tasks/common-config.yml index ca8fdf4..79aca9c 100644 --- a/tasks/common-config.yml +++ b/tasks/common-config.yml @@ -1,13 +1,13 @@ --- - name: Configure zookeeper-env.sh - template: src=zookeeper-env.sh.j2 dest={{ zookeeper_dir }}/conf/zookeeper-env.sh owner=zookeeper group=zookeeper + template: src=zookeeper-env.sh.j2 dest={{ zookeeper_conf_dir }}/conf/zookeeper-env.sh owner=zookeeper group=zookeeper tags: deploy notify: - Restart zookeeper when: zookeeper_env is defined and zookeeper_env|length > 0 - name: Update the log4j config with saner production values - template: src=log4j.properties.j2 dest={{ zookeeper_dir }}/conf/log4j.properties + template: src=log4j.properties.j2 dest={{ zookeeper_conf_dir }}/conf/log4j.properties tags: deploy notify: - Restart zookeeper