Add CentOS support for os_ceilometer role
Depends-On: Iaf51101bbaa5eba49f78e950152095913951430e Change-Id: If002cf8f8f5c04df0dee664640ab725cea8c1a3b
This commit is contained in:
parent
52a2bfe0d8
commit
4487698ad3
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
- name: Restart Apache
|
- name: Restart Apache
|
||||||
service:
|
service:
|
||||||
name: "apache2"
|
name: "{{ ceilometer_system_service_name }}"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
register: apache_restart
|
register: apache_restart
|
||||||
until: apache_restart | success
|
until: apache_restart | success
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- CentOS7/RHEL support has been added to the os_ceilometer role.
|
|
@ -18,37 +18,38 @@
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
group: "root"
|
group: "root"
|
||||||
with_items:
|
with_items: "{{ ceilometer_apache_config }}"
|
||||||
- { src: "ceilometer-ports.conf.j2", dest: "/etc/apache2/ports.conf" }
|
notify: Restart Apache
|
||||||
- { src: "ceilometer-httpd.conf.j2", dest: "/etc/apache2/sites-available/ceilometer-httpd.conf" }
|
|
||||||
notify:
|
|
||||||
- Restart Apache
|
|
||||||
|
|
||||||
- name: Disable default apache site
|
- name: Disable default apache site
|
||||||
file:
|
file:
|
||||||
path: "/etc/apache2/sites-enabled/000-default.conf"
|
path: "{{ item }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
|
with_items: "{{ ceilometer_apache_default_sites }}"
|
||||||
notify:
|
notify:
|
||||||
- Restart Apache
|
- Restart Apache
|
||||||
|
|
||||||
- name: Enabled ceilometer vhost
|
- name: Enabled ceilometer vhost
|
||||||
file:
|
file:
|
||||||
src: "/etc/apache2/sites-available/ceilometer-httpd.conf"
|
src: "{{ ceilometer_apache_site_available }}"
|
||||||
dest: "/etc/apache2/sites-enabled/ceilometer-httpd.conf"
|
dest: "{{ ceilometer_apache_site_enabled }}"
|
||||||
state: "link"
|
state: "link"
|
||||||
|
when:
|
||||||
|
- ceilometer_apache_site_available is defined
|
||||||
|
- ceilometer_apache_site_enabled is defined
|
||||||
notify:
|
notify:
|
||||||
- Restart Apache
|
- Restart Apache
|
||||||
|
|
||||||
- name: Ensure Apache ServerName
|
- name: Ensure Apache ServerName
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: "/etc/apache2/apache2.conf"
|
dest: "{{ ceilometer_apache_conf }}"
|
||||||
line: "ServerName {{ inventory_hostname }}"
|
line: "ServerName {{ inventory_hostname }}"
|
||||||
notify:
|
notify:
|
||||||
- Restart Apache
|
- Restart Apache
|
||||||
|
|
||||||
- name: Ensure Apache ServerTokens
|
- name: Ensure Apache ServerTokens
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: "/etc/apache2/conf-available/security.conf"
|
dest: "{{ ceilometer_apache_security_conf }}"
|
||||||
regexp: '^ServerTokens'
|
regexp: '^ServerTokens'
|
||||||
line: "ServerTokens {{ ceilometer_apache_servertokens }}"
|
line: "ServerTokens {{ ceilometer_apache_servertokens }}"
|
||||||
notify:
|
notify:
|
||||||
|
@ -56,8 +57,24 @@
|
||||||
|
|
||||||
- name: Ensure Apache ServerSignature
|
- name: Ensure Apache ServerSignature
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: "/etc/apache2/conf-available/security.conf"
|
dest: "{{ ceilometer_apache_security_conf }}"
|
||||||
regexp: '^ServerSignature'
|
regexp: '^ServerSignature'
|
||||||
line: "ServerSignature {{ ceilometer_apache_serversignature }}"
|
line: "ServerSignature {{ ceilometer_apache_serversignature }}"
|
||||||
notify:
|
notify:
|
||||||
- Restart Apache
|
- Restart Apache
|
||||||
|
|
||||||
|
- name: remove Listen from Apache config
|
||||||
|
lineinfile:
|
||||||
|
dest: "{{ ceilometer_apache_security_conf }}"
|
||||||
|
regexp: '^(Listen.*)'
|
||||||
|
backrefs: yes
|
||||||
|
line: '#\1'
|
||||||
|
notify:
|
||||||
|
- Restart Apache
|
||||||
|
|
||||||
|
- name: Load service
|
||||||
|
service:
|
||||||
|
name: "{{ ceilometer_system_service_name }}"
|
||||||
|
enabled: "yes"
|
||||||
|
state: "started"
|
||||||
|
|
||||||
|
|
|
@ -17,31 +17,58 @@
|
||||||
hosts: mongo_all
|
hosts: mongo_all
|
||||||
user: root
|
user: root
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- role: "pip_install"
|
||||||
|
tags:
|
||||||
|
- pip
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Install mongo packages
|
- name: Install mongo packages
|
||||||
apt:
|
package:
|
||||||
state: present
|
state: present
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
with_items: "{{ packages_mongodb }}"
|
with_items: "{{ packages_mongodb }}"
|
||||||
|
|
||||||
|
- name: Install client package (Ubuntu)
|
||||||
|
package:
|
||||||
|
state: present
|
||||||
|
name: "{{ item }}"
|
||||||
|
with_items:
|
||||||
|
- mongodb-clients
|
||||||
|
- python-pymongo
|
||||||
|
when: ansible_pkg_mgr == 'apt'
|
||||||
|
|
||||||
|
- name: Install client package (CentOS)
|
||||||
|
package:
|
||||||
|
state: present
|
||||||
|
name: mongodb
|
||||||
|
when: ansible_pkg_mgr == 'yum'
|
||||||
|
|
||||||
|
- name: Install pip package (CentOS)
|
||||||
|
pip:
|
||||||
|
state: latest
|
||||||
|
name: pymongo
|
||||||
|
when: ansible_pkg_mgr == 'yum'
|
||||||
|
|
||||||
- name: Configure the MongoDB bind address
|
- name: Configure the MongoDB bind address
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/mongodb.conf
|
dest: "{{ mongodb_config_file }}"
|
||||||
regexp: "^(#)?bind_ip"
|
regexp: "^(#)?bind_ip"
|
||||||
line: "bind_ip = {{ ansible_host }}"
|
line: "bind_ip = {{ ansible_host }}"
|
||||||
register: mongodb_bind
|
register: mongodb_bind
|
||||||
|
|
||||||
- name: Enable the MongoDB smallfiles option
|
- name: Enable the MongoDB smallfiles option
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/mongodb.conf
|
dest: "{{ mongodb_config_file }}"
|
||||||
regexp: "^(#)?smallfiles"
|
regexp: "^(#)?smallfiles"
|
||||||
line: "smallfiles = true"
|
line: "smallfiles = true"
|
||||||
register: mongodb_smallfiles
|
register: mongodb_smallfiles
|
||||||
|
|
||||||
- name: Restart mongodb
|
- name: Restart mongodb
|
||||||
service:
|
service:
|
||||||
name: mongodb
|
name: "{{ mongodb_service_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
when:
|
when:
|
||||||
- mongodb_bind | changed or mongodb_smallfiles | changed
|
- mongodb_bind | changed or mongodb_smallfiles | changed
|
||||||
register: mongodb_restart
|
register: mongodb_restart
|
||||||
|
@ -82,8 +109,8 @@
|
||||||
state: present
|
state: present
|
||||||
vars:
|
vars:
|
||||||
packages_mongodb:
|
packages_mongodb:
|
||||||
- mongodb-clients
|
|
||||||
- mongodb-server
|
- mongodb-server
|
||||||
- python-pymongo
|
mongodb_config_file: "{{ (ansible_pkg_mgr == 'apt') | ternary('/etc/mongodb.conf','/etc/mongod.conf') }}"
|
||||||
|
mongodb_service_name: "{{ (ansible_pkg_mgr == 'apt') | ternary('mongodb','mongod') }}"
|
||||||
ceilometer_database_name: ceilometer
|
ceilometer_database_name: ceilometer
|
||||||
ceilometer_database_user: ceilometer
|
ceilometer_database_user: ceilometer
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
---
|
||||||
|
# Copyright 2014, Rackspace US, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
ceilometer_distro_packages:
|
||||||
|
- git
|
||||||
|
- rpcbind
|
||||||
|
- rsync
|
||||||
|
|
||||||
|
# Packages required in developer mode, where packages are built locally
|
||||||
|
ceilometer_developer_mode_distro_packages:
|
||||||
|
- libvirt-devel
|
||||||
|
- libxml2-devel
|
||||||
|
- libxslt-devel
|
||||||
|
|
||||||
|
ceilometer_apache_distro_packages:
|
||||||
|
- httpd
|
||||||
|
- httpd-tools
|
||||||
|
- mod_wsgi
|
||||||
|
|
||||||
|
ceilometer_system_service_name: httpd
|
||||||
|
ceilometer_apache_conf: "/etc/httpd/conf/httpd.conf"
|
||||||
|
ceilometer_apache_security_conf: "{{ ceilometer_apache_conf }}"
|
||||||
|
|
||||||
|
ceilometer_apache_default_sites:
|
||||||
|
- "/etc/httpd/conf.d/userdir.conf"
|
||||||
|
- "/etc/httpd/conf.d/welcome.conf"
|
||||||
|
- "/etc/httpd/conf.d/ssl.conf"
|
||||||
|
|
||||||
|
ceilometer_apache_config:
|
||||||
|
- { src: "ceilometer-ports.conf.j2", dest: "/etc/httpd/conf.d/ports.conf" }
|
||||||
|
- { src: "ceilometer-httpd.conf.j2", dest: "/etc/httpd/conf.d/ceilometer-httpd.conf" }
|
||||||
|
|
||||||
|
|
|
@ -33,3 +33,18 @@ ceilometer_apache_distro_packages:
|
||||||
- apache2
|
- apache2
|
||||||
- apache2-utils
|
- apache2-utils
|
||||||
- libapache2-mod-wsgi
|
- libapache2-mod-wsgi
|
||||||
|
|
||||||
|
ceilometer_system_service_name: apache2
|
||||||
|
ceilometer_apache_conf: "/etc/apache2/apache2.conf"
|
||||||
|
ceilometer_apache_security_conf: "/etc/apache2/conf-available/security.conf"
|
||||||
|
|
||||||
|
ceilometer_apache_site_available: "/etc/apache2/sites-available/ceilometer-httpd.conf"
|
||||||
|
ceilometer_apache_site_enabled: "/etc/apache2/sites-enabled/ceilometer-httpd.conf"
|
||||||
|
|
||||||
|
ceilometer_apache_default_sites:
|
||||||
|
- "/etc/apache2/sites-enabled/000-default.conf"
|
||||||
|
|
||||||
|
ceilometer_apache_config:
|
||||||
|
- { src: "ceilometer-ports.conf.j2", dest: "/etc/apache2/ports.conf" }
|
||||||
|
- { src: "ceilometer-httpd.conf.j2", dest: "/etc/apache2/sites-available/ceilometer-httpd.conf" }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue