Browse Source

Add ceilometer_ipmi container into ceilometer role

refer to [0]

[0]: https://docs.openstack.org/ceilometer/latest/install/install-compute-rdo.html
Co-Authored-By: zhulingjie <easyzlj@gmail.com>

Change-Id: I4cda336dedb3d807b80d13bcc219268a8d667b4d
tags/8.0.0.0rc1
caoyuan 1 year ago
parent
commit
16900c2e37

+ 1
- 0
ansible/group_vars/all.yml View File

@@ -506,6 +506,7 @@ enable_barbican: "no"
506 506
 enable_blazar: "no"
507 507
 enable_cadf_notifications: "no"
508 508
 enable_ceilometer: "no"
509
+enable_ceilometer_ipmi: "no"
509 510
 enable_central_logging: "no"
510 511
 enable_ceph: "no"
511 512
 enable_ceph_mds: "no"

+ 3
- 0
ansible/inventory/all-in-one View File

@@ -580,6 +580,9 @@ ceilometer
580 580
 [ceilometer-compute:children]
581 581
 compute
582 582
 
583
+[ceilometer-ipmi:children]
584
+compute
585
+
583 586
 # Congress
584 587
 [congress-api:children]
585 588
 congress

+ 3
- 0
ansible/inventory/multinode View File

@@ -562,6 +562,9 @@ ceilometer
562 562
 [ceilometer-compute:children]
563 563
 compute
564 564
 
565
+[ceilometer-ipmi:children]
566
+compute
567
+
565 568
 # Aodh
566 569
 [aodh-api:children]
567 570
 aodh

+ 18
- 0
ansible/roles/ceilometer/defaults/main.yml View File

@@ -40,6 +40,18 @@ ceilometer_services:
40 40
       - "nova_libvirt:/var/lib/libvirt"
41 41
       - "{{ kolla_dev_repos_directory ~ '/ceilometer/ceilometer:/var/lib/kolla/venv/lib/python2.7/site-packages/ceilometer' if ceilometer_dev_mode | bool else '' }}"
42 42
     dimensions: "{{ ceilometer_compute_dimensions }}"
43
+  ceilometer-ipmi:
44
+    container_name: ceilometer_ipmi
45
+    group: ceilometer-ipmi
46
+    enabled: "{{ enable_ceilometer_ipmi }}"
47
+    image: "{{ ceilometer_ipmi_image_full }}"
48
+    volumes:
49
+      - "{{ node_config_directory }}/ceilometer-ipmi/:{{ container_config_directory }}/:ro"
50
+      - "/etc/localtime:/etc/localtime:ro"
51
+      - "ceilometer:/var/lib/ceilometer/"
52
+      - "kolla_logs:/var/log/kolla/"
53
+      - "{{ kolla_dev_repos_directory ~ '/ceilometer/ceilometer:/var/lib/kolla/venv/lib/python2.7/site-packages/ceilometer' if ceilometer_dev_mode | bool else '' }}"
54
+    dimensions: "{{ ceilometer_ipmi_dimensions }}"
43 55
 
44 56
 
45 57
 ####################
@@ -60,9 +72,15 @@ ceilometer_compute_image: "{{ docker_registry ~ '/' if docker_registry else '' }
60 72
 ceilometer_compute_tag: "{{ ceilometer_tag }}"
61 73
 ceilometer_compute_image_full: "{{ ceilometer_compute_image }}:{{ ceilometer_compute_tag }}"
62 74
 
75
+ceilometer_ipmi_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ ceilometer_install_type }}-ceilometer-ipmi"
76
+ceilometer_ipmi_tag: "{{ ceilometer_tag }}"
77
+ceilometer_ipmi_image_full: "{{ ceilometer_ipmi_image }}:{{ ceilometer_ipmi_tag }}"
78
+
63 79
 ceilometer_notification_dimensions: "{{ default_container_dimensions }}"
64 80
 ceilometer_central_dimensions: "{{ default_container_dimensions }}"
65 81
 ceilometer_compute_dimensions: "{{ default_container_dimensions }}"
82
+ceilometer_ipmi_dimensions: "{{ default_container_dimensions }}"
83
+
66 84
 
67 85
 ####################
68 86
 # OpenStack

+ 26
- 0
ansible/roles/ceilometer/handlers/main.yml View File

@@ -87,3 +87,29 @@
87 87
       or policy_overwriting.changed | bool
88 88
       or vcenter_ca_file.changed | bool
89 89
       or ceilometer_compute_container.changed | bool
90
+
91
+- name: Restart ceilometer-ipmi container
92
+  vars:
93
+    service_name: "ceilometer-ipmi"
94
+    service: "{{ ceilometer_services[service_name] }}"
95
+    config_json: "{{ ceilometer_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
96
+    ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
97
+    ceilometer_pipeline: "{{ ceilometer_pipelines.results|selectattr('item.key', 'equalto', service_name)|first }}"
98
+    policy_overwriting: "{{ ceilometer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
99
+    ceilometer_ipmi_container: "{{ check_ceilometer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
100
+  kolla_docker:
101
+    action: "recreate_or_restart_container"
102
+    common_options: "{{ docker_common_options }}"
103
+    name: "{{ service.container_name }}"
104
+    image: "{{ service.image }}"
105
+    volumes: "{{ service.volumes }}"
106
+    dimensions: "{{ service.dimensions }}"
107
+  when:
108
+    - kolla_action != "config"
109
+    - inventory_hostname in groups[service.group]
110
+    - service.enabled | bool
111
+    - config_json.changed | bool
112
+      or ceilometer_conf.changed | bool
113
+      or ceilometer_pipeline.changed | bool
114
+      or policy_overwriting.changed | bool
115
+      or ceilometer_ipmi_container.changed | bool

+ 4
- 0
ansible/roles/ceilometer/tasks/config.yml View File

@@ -70,6 +70,7 @@
70 70
     - Restart ceilometer-notification container
71 71
     - Restart ceilometer-central container
72 72
     - Restart ceilometer-compute container
73
+    - Restart ceilometer-ipmi container
73 74
 
74 75
 - name: Copying over ceilometer.conf
75 76
   vars:
@@ -93,6 +94,7 @@
93 94
     - Restart ceilometer-notification container
94 95
     - Restart ceilometer-central container
95 96
     - Restart ceilometer-compute container
97
+    - Restart ceilometer-ipmi container
96 98
 
97 99
 - name: Copying over event yaml for notification service
98 100
   vars:
@@ -186,6 +188,7 @@
186 188
     - Restart ceilometer-notification container
187 189
     - Restart ceilometer-central container
188 190
     - Restart ceilometer-compute container
191
+    - Restart ceilometer-ipmi container
189 192
 
190 193
 # check whether the containers parameter is changed. If yes, trigger the handler.
191 194
 - name: Check ceilometer containers
@@ -208,3 +211,4 @@
208 211
     - Restart ceilometer-notification container
209 212
     - Restart ceilometer-central container
210 213
     - Restart ceilometer-compute container
214
+    - Restart ceilometer-ipmi container

+ 30
- 0
ansible/roles/ceilometer/templates/ceilometer-ipmi.json.j2 View File

@@ -0,0 +1,30 @@
1
+{
2
+    "command": "ceilometer-polling --polling-namespaces ipmi",
3
+    "config_files": [
4
+        {
5
+            "source": "{{ container_config_directory }}/ceilometer.conf",
6
+            "dest": "/etc/ceilometer/ceilometer.conf",
7
+            "owner": "ceilometer",
8
+            "perm": "0600"
9
+        }{% if ceilometer_polling_file_path is defined %},
10
+        {
11
+            "source": "{{ container_config_directory }}/polling.yaml",
12
+            "dest": "/etc/ceilometer/polling.yaml",
13
+            "owner": "ceilometer",
14
+            "perm": "0600"
15
+        }{% endif %}{% if ceilometer_policy_file is defined %},
16
+        {
17
+            "source": "{{ container_config_directory }}/{{ ceilometer_policy_file }}",
18
+            "dest": "/etc/ceilometer/{{ ceilometer_policy_file }}",
19
+            "owner": "ceilometer",
20
+            "perm": "0600"
21
+        }{% endif %}
22
+    ],
23
+    "permissions": [
24
+        {
25
+            "path": "/var/log/kolla/ceilometer",
26
+            "owner": "ceilometer:ceilometer",
27
+            "recurse": true
28
+        }
29
+    ]
30
+}

+ 1
- 0
ansible/site.yml View File

@@ -913,6 +913,7 @@
913 913
     - ceilometer-central
914 914
     - ceilometer-notification
915 915
     - ceilometer-compute
916
+    - ceilometer-ipmi
916 917
     - '&enable_ceilometer_True'
917 918
   serial: '{{ kolla_serial|default("0") }}'
918 919
   roles:

+ 1
- 0
etc/kolla/globals.yml View File

@@ -189,6 +189,7 @@ kolla_internal_vip_address: "10.10.10.254"
189 189
 #enable_barbican: "no"
190 190
 #enable_blazar: "no"
191 191
 #enable_ceilometer: "no"
192
+#enable_ceilometer_ipmi: "no"
192 193
 #enable_central_logging: "no"
193 194
 #enable_ceph: "no"
194 195
 #enable_ceph_mds: "no"

+ 4
- 0
releasenotes/notes/add-ceilometer-ipmi-b646f886666889a1.yaml View File

@@ -0,0 +1,4 @@
1
+---
2
+features:
3
+  - |
4
+    Add ceilometer_ipmi into ceilometer role.

+ 3
- 0
tests/templates/inventory.j2 View File

@@ -523,6 +523,9 @@ ceilometer
523 523
 [ceilometer-compute:children]
524 524
 compute
525 525
 
526
+[ceilometer-ipmi:children]
527
+compute
528
+
526 529
 # Congress
527 530
 [congress-api:children]
528 531
 congress

Loading…
Cancel
Save