From d47ab8b0d2477c3a1395d56306ab4e0327cc8a4c Mon Sep 17 00:00:00 2001 From: Ernestas Poskus Date: Tue, 20 Sep 2016 17:03:40 +0300 Subject: [PATCH] Do not overwrite Zookeeper myid unless stated --- README.md | 3 +++ defaults/main.yml | 3 +++ tasks/Debian.yml | 2 +- tasks/tarball.yml | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6de61d2..c35c0c2 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,9 @@ zookeeper_hosts: # Dict of ENV settings to be written into the (optional) conf/zookeeper-env.sh zookeeper_env: {} + +# Controls Zookeeper myid generation +zookeeper_force_myid: true ``` Example Playbook diff --git a/defaults/main.yml b/defaults/main.yml index 0b7e55d..37295e8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -30,3 +30,6 @@ zookeeper_hosts: # Dict of ENV settings to be written into the (optional) conf/zookeeper-env.sh zookeeper_env: {} + +# Controls Zookeeper myid generation +zookeeper_force_myid: true diff --git a/tasks/Debian.yml b/tasks/Debian.yml index 9eb5f2f..1da9302 100644 --- a/tasks/Debian.yml +++ b/tasks/Debian.yml @@ -11,7 +11,7 @@ - zookeeperd - name: Overwrite myid file. - template: src=myid.j2 dest=/etc/zookeeper/conf/myid + template: src=myid.j2 dest=/etc/zookeeper/conf/myid force="{{ zookeeper_force_myid }}" tags: deploy notify: - Restart zookeeper diff --git a/tasks/tarball.yml b/tasks/tarball.yml index 1648724..2607f0b 100644 --- a/tasks/tarball.yml +++ b/tasks/tarball.yml @@ -28,7 +28,7 @@ - "{{log_dir}}" - name: Write myid file. - template: src=myid.j2 dest={{data_dir}}/myid owner=zookeeper group=zookeeper + template: src=myid.j2 dest={{data_dir}}/myid owner=zookeeper group=zookeeper force="{{ zookeeper_force_myid }}" tags: deploy notify: - Restart zookeeper