blob: f05ce454ea2c11cfcf50cb3c6525265646bffe48 [file] [log] [blame]
raghunath dudyalaa927d562016-09-28 14:04:13 +05301---
2# ceilometer_service_playbook
3- hosts: "{{ instance_name }}"
4 gather_facts: False
5 connection: ssh
6 user: ubuntu
raghunath dudyalaa927d562016-09-28 14:04:13 +05307 vars:
8 host_name: {{ instance_hostname }}
9 host_private_ip: {{ private_ip }}
10 host_nat_ip: {{ nat_ip }}
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000011 ceilometer_enable_pub_sub: {{ ceilometer_enable_pub_sub }}
raghunath dudyalaa927d562016-09-28 14:04:13 +053012 tasks:
13
14 - name: Fix /etc/hosts
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000015 become: yes
raghunath dudyalaa927d562016-09-28 14:04:13 +053016 lineinfile:
17 dest=/etc/hosts
18 regexp="127.0.0.1 localhost"
19 line="127.0.0.1 localhost {{ instance_hostname }}"
20
21 - name : Adding Rabbitmq user
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000022 become: yes
Srikanth Vavilapalli4e5abb52017-01-27 04:45:06 +000023 shell : rabbitmqctl add_vhost /;rabbitmqctl add_user openstack "password";rabbitmqctl set_permissions openstack ".*" ".*" ".*"
raghunath dudyalaa927d562016-09-28 14:04:13 +053024
25 - name: Coping keystone endpoint script
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000026 become: yes
raghunath dudyalaa927d562016-09-28 14:04:13 +053027 template: src=/opt/xos/synchronizers/monitoring/templates/update-keystone-endpoints.py.j2 dest=/usr/local/bin/update-keystone-endpoints.py owner=root group=root mode=0777
28
29 - name: Changing keystone public endpoint in mysql
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000030 become: yes
raghunath dudyalaa927d562016-09-28 14:04:13 +053031 shell: update-keystone-endpoints.py --username root --password password --host localhost --endpoint {{ private_ip }} --endpoint-type public
32
33 - name: Changing keystone admin endpoint in mysql
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000034 become: yes
raghunath dudyalaa927d562016-09-28 14:04:13 +053035 shell: update-keystone-endpoints.py --username root --password password --host localhost --endpoint {{ private_ip }} --endpoint-type admin
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000036
Srikanth Vavilapallie88d7582017-02-01 00:42:23 +000037 - name: Update host specific configs in /etc/kafka/server.properties
38 become: yes
39 lineinfile:
40 dest=/etc/kafka/server.properties
41 regexp="{{ '{{' }} item.regexp {{ '}}' }}"
42 line="{{ '{{' }} item.line {{ '}}' }}"
43 with_items:
44 - { regexp: '^[#]{0,}host\.name=', line: 'host.name=0.0.0.0' }
45 - { regexp: '^[#]{0,}advertised\.host\.name=', line: 'advertised.host.name={{ instance_hostname }}' }
46 - { regexp: '^[#]{0,}zookeeper\.connect=', line: 'zookeeper.connect={{ instance_hostname }}:2181' }
47 notify:
48 - restart kafka service
49
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000050 - name: Enabling/Disabling kafka publishing
51 become: yes
52 template: src=/opt/xos/synchronizers/monitoring/templates/ceilometer_pipeline.yaml.j2 dest=/etc/ceilometer/pipeline.yaml owner=root group=root mode=0777
53 notify:
54 - restart ceilometer-agent-notification service
55
Srikanth Vavilapalli0d483e52017-01-31 05:21:08 +000056# No need of this step as this patch is directly applied inside monitoring service custom image
57# - name: Apply ceilometer kafka publisher patch until monitoring service is migrated to Newton release or later
58# become: yes
59# template: src=/opt/xos/synchronizers/monitoring/templates/kafka_broker.py dest=/usr/lib/python2.7/dist-packages/ceilometer/publisher/kafka_broker.py owner=root group=root mode=0777
60# notify:
61# - restart ceilometer-agent-notification service
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000062
63 handlers:
Srikanth Vavilapallie88d7582017-02-01 00:42:23 +000064 - name: restart kafka service
65 become: yes
66 service: name=kafka state=restarted
Srikanth Vavilapalli71aa28d2017-01-31 00:43:13 +000067 - name: restart ceilometer-agent-notification service
68 become: yes
69 service: name=ceilometer-agent-notification state=restarted