summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/ceilometer_controller
diff options
context:
space:
mode:
authorliyuenan <liyuenan@huawei.com>2017-01-14 11:31:08 +0800
committerJustin chi <chigang@huawei.com>2017-01-14 05:48:28 +0000
commit2e33f30a1f0a17692d6d0348248df10b98cfb498 (patch)
tree1f8d3612a4667bf977db5ce5a0cbe0696f06e78b /deploy/adapters/ansible/roles/ceilometer_controller
parent1da2cee07a11d5dd7b83ab0437807fc239929f1c (diff)
Deploy OpenStack Newton on CentOS hosts
JIRA: COMPASS-518 Make Centos Newton ppa. Update host Centos version to 7.3. Support Centos Newton Deploy. Support Ceph Deploy. Change-Id: I6dd110cc10d425a9d590e1dcb5777ade5cce96aa Signed-off-by: liyuenan <liyuenan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/ceilometer_controller')
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml6
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/tasks/ceilometer_config.yml26
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/templates/wsgi-ceilometer.conf.j28
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml8
-rw-r--r--deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml31
5 files changed, 54 insertions, 25 deletions
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml b/deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml
index 1507c6e9..2d0e3159 100644
--- a/deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml
@@ -16,7 +16,9 @@
with_items: "{{ glance_cinder_services }}"
- name: reload apache server
- service: name=apache2 state=reloaded
+ service: name={{ item }} state=reloaded
+ with_items: "{{ services }}"
- name: restart apache server
- service: name=apache2 state=restarted enabled=yes
+ service: name={{ item }} state=restarted enabled=yes
+ with_items: "{{ services }}"
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/tasks/ceilometer_config.yml b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/ceilometer_config.yml
index 694cc0dd..b2d58d4b 100644
--- a/deploy/adapters/ansible/roles/ceilometer_controller/tasks/ceilometer_config.yml
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/ceilometer_config.yml
@@ -9,25 +9,35 @@
---
- include_vars: "{{ ansible_os_family }}.yml"
+- name: assure listen port exist
+ lineinfile:
+ dest: '{{ apache_config_dir }}/ports.conf'
+ regexp: "^Listen {{ internal_ip }}:8777"
+ line: "Listen {{ internal_ip }}:8777"
+ notify: restart apache server
+
+- name: update apache2 configs
+ template:
+ src: wsgi-ceilometer.conf.j2
+ dest: '{{ apache_config_dir }}/sites-available/ceilometer.conf'
+ when: ansible_os_family == 'Debian'
+ notify: reload apache server
+
- name: update apache2 configs
template:
src: wsgi-ceilometer.conf.j2
- dest: /etc/apache2/sites-available/ceilometer.conf
+ dest: '{{ apache_config_dir }}/ceilometer.conf'
+ when: ansible_os_family == 'RedHat'
notify: reload apache server
- name: enable ceilometer server
file:
- src: /etc/apache2/sites-available/ceilometer.conf
- dest: /etc/apache2/sites-enabled/ceilometer.conf
+ src: "{{ apache_config_dir }}/sites-available/ceilometer.conf"
+ dest: "{{ apache_config_dir }}/sites-enabled/ceilometer.conf"
state: "link"
when: ansible_os_family == 'Debian'
notify: reload apache server
-- name: assure listen port exist
- shell: echo "Listen {{ internal_ip }}:8777" >> /etc/apache2/ports.conf
- notify:
- - restart apache server
-
- name: copy glance & cinder configs
template:
src: "{{ item }}"
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/templates/wsgi-ceilometer.conf.j2 b/deploy/adapters/ansible/roles/ceilometer_controller/templates/wsgi-ceilometer.conf.j2
index 9909f800..c876efda 100644
--- a/deploy/adapters/ansible/roles/ceilometer_controller/templates/wsgi-ceilometer.conf.j2
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/templates/wsgi-ceilometer.conf.j2
@@ -6,10 +6,10 @@
<VirtualHost {{ internal_ip }}:8777>
WSGIDaemonProcess ceilometer-api processes=4 threads={{ work_threads }} user=ceilometer group=ceilometer display-name=%{GROUP}
WSGIProcessGroup ceilometer-api
- WSGIScriptAlias / /usr/lib/python2.7/dist-packages/ceilometer/api/app.wsgi
+ WSGIScriptAlias / {{ WSGIScriptAlias_path }}
WSGIApplicationGroup %{GLOBAL}
- ErrorLog /var/log/apache2/ceilometer_error.log
- CustomLog /var/log/apache2/ceilometer_access.log combined
+ ErrorLog /var/log/{{ http_service_name }}/ceilometer_error.log
+ CustomLog /var/log/{{ http_service_name }}/ceilometer_access.log combined
<Directory /usr/lib/python2.7/dist-packages/ceilometer/api/>
<IfVersion >= 2.4>
@@ -22,4 +22,4 @@
</Directory>
</VirtualHost>
-WSGISocketPrefix /var/run/apache2
+WSGISocketPrefix /var/run/{{ http_service_name }}
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml b/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml
index de860533..1456ee50 100644
--- a/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml
@@ -12,6 +12,7 @@ ceilometer_packages:
- ceilometer-collector
- ceilometer-agent-central
- ceilometer-agent-notification
+ - ceilometer-agent-compute
- python-ceilometerclient
ceilometer_services:
@@ -24,3 +25,10 @@ glance_cinder_services:
- glance-api
- cinder-api
- cinder-scheduler
+
+services:
+ - apache2
+
+apache_config_dir: /etc/apache2
+http_service_name: apache2
+WSGIScriptAlias_path: /usr/lib/python2.7/dist-packages/ceilometer/api/app.wsgi
diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml b/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml
index de860533..08d1a921 100644
--- a/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml
+++ b/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml
@@ -8,19 +8,28 @@
##############################################################################
---
ceilometer_packages:
- - ceilometer-api
- - ceilometer-collector
- - ceilometer-agent-central
- - ceilometer-agent-notification
+ - openstack-ceilometer-api
+ - openstack-ceilometer-collector
+ - openstack-ceilometer-central
+ - openstack-ceilometer-notification
+ - openstack-ceilometer-compute
- python-ceilometerclient
ceilometer_services:
- - ceilometer-agent-central
- - ceilometer-agent-notification
- - ceilometer-collector
+ - openstack-ceilometer-central
+ - openstack-ceilometer-notification
+ - openstack-ceilometer-api
+ - openstack-ceilometer-collector
glance_cinder_services:
- - glance-registry
- - glance-api
- - cinder-api
- - cinder-scheduler
+ - openstack-glance-registry
+ - openstack-glance-api
+ - openstack-cinder-api
+ - openstack-cinder-scheduler
+
+services:
+ - httpd
+
+apache_config_dir: /etc/httpd/conf.d
+http_service_name: httpd
+WSGIScriptAlias_path: /usr/lib/python2.7/site-packages/ceilometer/api/app.wsgi