aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/ceilometer_controller
diff options
context:
space:
mode:
authorcarey.xu <carey.xuhan@huawei.com>2015-09-30 11:26:46 +0800
committercarey.xu <carey.xuhan@huawei.com>2015-10-09 15:03:51 +0800
commit00aaaac786bcec0d2de7c14c4f3c5a89ba2553f5 (patch)
tree05b45bee93c88f363cb78d79f9dac26cdf12afe6 /deploy/adapters/ansible/roles/ceilometer_controller
parent9a95593b0c8cdefb6ad4a3c836b699f42b1f7323 (diff)
compass4nfv support ceilometer
JIRA: COMPASS-53 Change-Id: Ie8fc0f3f03f1de3c9fcf37778e025175ed391bc5 Signed-off-by: carey.xu <carey.xuhan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/ceilometer_controller')
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml4
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml17
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/templates/ceilometer.j225
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/templates/cinder.j23
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/templates/glance.j25
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml27
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml3
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/vars/main.yml3
8 files changed, 87 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml b/deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml
new file mode 100644
index 00000000..ee30a5f6
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml
@@ -0,0 +1,4 @@
+---
+- name: restart ceilometer relation service
+ service: name={{ item }} state=restarted enabled=yes
+ with_items: ceilometer_services
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml
new file mode 100644
index 00000000..4fddd1e6
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml
@@ -0,0 +1,17 @@
+---
+- include_vars: "{{ ansible_os_family }}.yml"
+
+- name: install ceilometer packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: "{{ ceilometer_packages }}| union(packages_noarch)"
+
+- name: copy ceilometer configs
+ template: src={{ item.src}} dest=/opt/os_templates
+ with_items: "{{ ceilometer_configs_templates }}"
+
+- name: update ceilometer configs
+ shell: crudini --merge {{ item.1 }} < /opt/os_templates/{{ item.0.src }}
+ with_subelements:
+ - ceilometer_configs_templates
+ - dest
+ notify: restart ceilometer relation service
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/templates/ceilometer.j2 b/deploy/adapters/ansible/roles/ceilometer_controller/templates/ceilometer.j2
new file mode 100644
index 00000000..09ca5272
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/templates/ceilometer.j2
@@ -0,0 +1,25 @@
+[DEFAULT]
+rpc_backend = rabbit
+rabbit_host = {{ internal_vip.ip }}
+rabbit_password = {{ RABBIT_PASS }}
+auth_strategy = keystone
+verbose = True
+
+[database]
+connection = mongodb://ceilometer:{{ CEILOMETER_DBPASS }}@{{ internal_vip.ip }}:27017/ceilometer
+
+[keystone_authtoken]
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
+admin_tenant_name = service
+admin_user = ceilometer
+admin_password = {{ CEILOMETER_PASS }}
+
+[service_credentials]
+os_auth_url = http://{{ internal_vip.ip }}:5000/v2.0
+os_username = ceilometer
+os_tenant_name = service
+os_password = {{ CEILOMETER_PASS }}
+
+[publisher]
+metering_secret = {{ metering_secret }}
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/templates/cinder.j2 b/deploy/adapters/ansible/roles/ceilometer_controller/templates/cinder.j2
new file mode 100644
index 00000000..390bd870
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/templates/cinder.j2
@@ -0,0 +1,3 @@
+[DEFAULT]
+control_exchange = cinder
+notification_driver = messagingv2
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/templates/glance.j2 b/deploy/adapters/ansible/roles/ceilometer_controller/templates/glance.j2
new file mode 100644
index 00000000..c34f5d81
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/templates/glance.j2
@@ -0,0 +1,5 @@
+[DEFAULT]
+notification_driver = messagingv2
+rpc_backend = rabbit
+rabbit_host = {{ internal_vip.ip }}
+rabbit_password = {{ RABBIT_PASS }}
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml b/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml
new file mode 100644
index 00000000..8317a3eb
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml
@@ -0,0 +1,27 @@
+---
+ceilometer_packages:
+ - ceilometer-api
+ - ceilometer-collector
+ - ceilometer-agent-central
+ - ceilometer-agent-notification
+ - ceilometer-alarm-evaluator
+ - ceilometer-alarm-notifier
+ - python-ceilometerclient
+
+ceilometer_services:
+ - ceilometer-agent-central
+ - ceilometer-agent-notification
+ - ceilometer-api
+ - ceilometer-collector
+ - ceilometer-alarm-evaluator
+ - ceilometer-alarm-notifier
+
+ceilometer_configs_templates:
+ - src: ceilometer.j2
+ dest: /etc/ceilometer/ceilometer.conf
+ - src: cinder.j2
+ dest: /etc/cinder/cinder.conf
+ - src: glance.j2
+ dest:
+ - /etc/glance/glance-api.conf
+ - /etc/glance/glance-registry.conf
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml b/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml
new file mode 100644
index 00000000..041cf477
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml
@@ -0,0 +1,3 @@
+---
+services: []
+packages: []
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/vars/main.yml b/deploy/adapters/ansible/roles/ceilometer_controller/vars/main.yml
new file mode 100644
index 00000000..bb87da65
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/vars/main.yml
@@ -0,0 +1,3 @@
+---
+packages_noarch: []
+metering_secret: 1c5df72079b31fb47747