Fixes in monitoring service VM-2

Change-Id: I4a35a300c9fa97d5f79467f2688aeef6d52a88a9
diff --git a/xos/synchronizer/steps/sync_ceilometerservice.yaml b/xos/synchronizer/steps/sync_ceilometerservice.yaml
index f532e79..f05ce45 100644
--- a/xos/synchronizer/steps/sync_ceilometerservice.yaml
+++ b/xos/synchronizer/steps/sync_ceilometerservice.yaml
@@ -34,6 +34,19 @@
     become: yes
     shell: update-keystone-endpoints.py --username root --password password --host localhost --endpoint {{ private_ip }} --endpoint-type admin 
 
+  - name: Update host specific configs in /etc/kafka/server.properties
+    become: yes
+    lineinfile:
+      dest=/etc/kafka/server.properties
+      regexp="{{ '{{' }} item.regexp {{ '}}' }}"
+      line="{{ '{{' }} item.line {{ '}}' }}"
+    with_items:
+      - { regexp: '^[#]{0,}host\.name=', line: 'host.name=0.0.0.0' }
+      - { regexp: '^[#]{0,}advertised\.host\.name=', line: 'advertised.host.name={{ instance_hostname }}' }
+      - { regexp: '^[#]{0,}zookeeper\.connect=', line: 'zookeeper.connect={{ instance_hostname }}:2181' }
+    notify:
+     - restart kafka service
+
   - name: Enabling/Disabling kafka publishing
     become: yes
     template: src=/opt/xos/synchronizers/monitoring/templates/ceilometer_pipeline.yaml.j2 dest=/etc/ceilometer/pipeline.yaml owner=root group=root mode=0777
@@ -48,6 +61,9 @@
 #     - restart ceilometer-agent-notification service
 
   handlers:
+  - name: restart kafka service
+    become: yes
+    service: name=kafka state=restarted
   - name: restart ceilometer-agent-notification service
     become: yes
     service: name=ceilometer-agent-notification state=restarted