Skip to content

Commit

Permalink
Added ansible statement to ensure a CLEAN Zookeeper DB at everry startup
Browse files Browse the repository at this point in the history
  • Loading branch information
emielkuiper committed Apr 12, 2019
1 parent ca2a5f5 commit ff182b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Vagrant.configure("2") do |config|
ansible.playbook = "ansible-playbook.yml"
end # End of "config.vm.provision"

config.vm.provision "restart_kafka", type:'ansible_local', run: "never" do |restart_kafka|
config.vm.provision "restart_kafka", type:'ansible_local', run: "always" do |restart_kafka|
restart_kafka.verbose = "v"
restart_kafka.playbook = "ansible-playbook_restart_kafka.yml"
end # End of "config.vm.restart_kafka"
Expand Down
5 changes: 5 additions & 0 deletions vagrant/ansible-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@
path: /usr/local/bin/kafka-demo.sh
mode: 0755

- name: Clearing any old zookeeper databases so ensuring a clean ZK env
file:
path: /var/lib/zookeeper/version-2/log.*
state: absent


###
### Start Kafka services at boot time
Expand Down
5 changes: 5 additions & 0 deletions vagrant/ansible-playbook_restart_kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
### RESTART Kafka services
###

- name: Clearing any old zookeeper databases so ensuring a clean ZK env
file:
path: /var/lib/zookeeper/version-2/log.*
state: absent

- name: Make sure Kafka services are restarted
service:
name: "{{ item }}"
Expand Down

0 comments on commit ff182b3

Please sign in to comment.