blob: 8ef9c96f77cb6aa2e0d41ee927b38d8b5e4f7ae5 [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
37 - name: Enabling/Disabling kafka publishing
38 become: yes
39 template: src=/opt/xos/synchronizers/monitoring/templates/ceilometer_pipeline.yaml.j2 dest=/etc/ceilometer/pipeline.yaml owner=root group=root mode=0777
40 notify:
41 - restart ceilometer-agent-notification service
42
43 - name: Apply ceilometer kafka publisher patch until monitoring service is migrated to Newton release or later
44 become: yes
45 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
46 notify:
47 - restart ceilometer-agent-notification service
48
49 handlers:
50 - name: restart ceilometer-agent-notification service
51 become: yes
52 service: name=ceilometer-agent-notification state=restarted