-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtelemetry.yml
106 lines (75 loc) · 3.7 KB
/
telemetry.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
- name: "Openstack Telemetry playbook"
hosts: openstack
gather_facts: yes
remote_user: root
tasks:
- name: "Install openstack-ceilmeter packages"
yum: name=openstack-ceilometer-compute enablerepo=centos-openstack-ocata,epel state=present
- name: "Backup Original ceilmeter configuation"
copy: remote_src=True src=/etc/ceilometer/ceilometer.conf dest=/etc/ceilometer/ceilometer.conf.org
- name: "replace ansible_host in heat conf"
replace: dest=/etc/heat/heat.conf regexp='192.168.122.185' replace={{ ansible_host }} backup=yes
- name: "configure nova for ceilometer"
lineinfile: dest=/etc/nova/nova.conf
line={{ item.line }}
insertafter={{ item.insertafter }}
with_items:
- { line: "instance_usage_audit = True", insertafter: "^log_dir =" }
- { line: "instance_usage_audit_period = hour", insertafter: "^log_dir =" }
- { line: "notify_on_state_change = vm_and_task_state", insertafter: "^log_dir =" }
- { line: "driver = messagingv2", insertafter: "^api_paste_config =" }
- name: "start and enable ceilometer services"
service: name=openstack-ceilometer-compute state=started enabled=yes
- name: "restart nova services"
service: name=openstack-nova-compute state=restarted
- name: "add ceilometer user (set in service project)"
shell: source ~/keystonerc && openstack user create --domain default --project service --password servicepassword ceilometer
args:
executable: /bin/bash
register: ceilometer_user
- debug: var=ceilometer_user.stdout_lines
- name: "add ceilometer user in admin role"
shell: source ~/keystonerc && openstack role add --project service --user ceilometer admin
args:
executable: /bin/bash
- name: "add service entry for ceilometer"
shell: source ~/keystonerc && ""openstack service create --name ceilometer --description "OpenStack Telemetry" metering""
args:
executable: /bin/bash
register: heat_service
- debug: var=heat_service.stdout_lines
- name: "add gnocchi user (set in service project)"
shell: source ~/keystonerc && openstack user create --domain default --project service --password servicepassword gnocchi
args:
executable: /bin/bash
register: gnocchi_user
- debug: var=gnocchi_user.stdout_lines
- name: "add service entry for gnocchi"
shell: source ~/keystonerc && ""openstack service create --name gnocchi --description "Openstack Metric Service" metric""
args:
executable: /bin/bash
register: metric_service
- debug: var=metric_service.stdout_lines
- name: "add endpoint for metric (public,internal,admin)"
shell: source ~/keystonerc && ""openstack endpoint create --region RegionOne metric {{ item }} http://{{ ansible_host }}:8041""
args:
executable: /bin/bash
with_items:
- public
- internal
- admin
- name: "Install openstack-ceilometer componet packages"
yum: name={{ item }} enablerepo=centos-openstack-ocata,epel state=present
with_items:
- openstack-ceilometer-collector
- openstack-ceilometer-notification
- openstack-ceilometer-central
- python-ceilometerclient
- name: "configure cinder for ceilometer"
lineinfile: dest=/etc/cinder/cinder.conf
line='driver = messagingv2'
insertafter='^lock_path ='
- shell: ""cinder-volume-usage-audit --start_time='YYYY-MM-DD HH:MM:SS' --end_time='YYYY-MM-DD HH:MM:SS' --send_actions""
arg:
executable: /bin/bash