31cddcd762
With the dependent change merged Ceilometer API will no longer run without a stand-alone wsgi engine. It is too late in the cycle right now to bring over changes for nginx and/or uwsgi for this project so only this deployment option is being supported at this time. Change-Id: I3cff6b183feae3c346cd56602d7b733a6dd9a01b Depends-On: I8812ea1a92d6dc7f41a490e971bb7a09dee9b304
90 lines
3.0 KiB
YAML
90 lines
3.0 KiB
YAML
---
|
|
# 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.
|
|
|
|
- name: Create the system group
|
|
group:
|
|
name: "{{ ceilometer_system_group_name }}"
|
|
state: "present"
|
|
system: "yes"
|
|
|
|
- name: Create the ceilometer system user
|
|
user:
|
|
name: "{{ ceilometer_system_user_name }}"
|
|
group: "{{ ceilometer_system_group_name }}"
|
|
comment: "{{ ceilometer_system_comment }}"
|
|
shell: "{{ ceilometer_system_shell }}"
|
|
system: "yes"
|
|
createhome: "yes"
|
|
home: "{{ ceilometer_system_user_home }}"
|
|
|
|
- name: Create the swift system user and add to ceilometer group
|
|
user:
|
|
name: "{{ swift_system_user_name }}"
|
|
group: "{{ ceilometer_system_group_name }}"
|
|
comment: "{{ swift_system_comment }}"
|
|
shell: "{{ swift_system_shell }}"
|
|
system: "yes"
|
|
createhome: "yes"
|
|
home: "{{ swift_system_home_folder }}"
|
|
|
|
- name: Create ceilometer dir
|
|
file:
|
|
path: "{{ item.path }}"
|
|
state: directory
|
|
owner: "{{ item.owner|default(ceilometer_system_user_name) }}"
|
|
group: "{{ item.group|default(ceilometer_system_group_name) }}"
|
|
mode: "{{ item.mode|default('0755') }}"
|
|
with_items:
|
|
- { path: "/openstack", owner: "root", group: "root" }
|
|
- { path: "/etc/ceilometer" }
|
|
- { path: "/etc/ceilometer/rootwrap.d", owner: "root", group: "root" }
|
|
- { path: "{{ ceilometer_system_user_home }}" }
|
|
- { path: "{{ ceilometer_system_user_home }}/.ssh", mode: "0700" }
|
|
- { path: "/var/cache/ceilometer", mode: "0700" }
|
|
|
|
- name: Create Apache mod_wsgi dirs
|
|
file:
|
|
path: "{{ item.path }}"
|
|
state: directory
|
|
owner: "{{ item.owner|default(ceilometer_system_user_name) }}"
|
|
group: "{{ item.group|default(ceilometer_system_group_name) }}"
|
|
mode: "0755"
|
|
with_items:
|
|
- { path: "/var/www/cgi-bin", owner: root, group: root }
|
|
- { path: "/var/www/cgi-bin/ceilometer" }
|
|
|
|
- name: Test for log directory or link
|
|
shell: |
|
|
if [ -h "/var/log/ceilometer" ]; then
|
|
chown -h {{ ceilometer_system_user_name }}:{{ ceilometer_system_group_name }} "/var/log/ceilometer"
|
|
chown -R {{ ceilometer_system_user_name }}:{{ ceilometer_system_group_name }} "$(readlink /var/log/ceilometer)"
|
|
else
|
|
exit 1
|
|
fi
|
|
register: log_dir
|
|
failed_when: false
|
|
changed_when: log_dir.rc != 0
|
|
|
|
- name: Create ceilometer log dir
|
|
file:
|
|
path: "{{ item.path }}"
|
|
state: directory
|
|
owner: "{{ item.owner|default(ceilometer_system_user_name) }}"
|
|
group: "{{ item.group|default(ceilometer_system_group_name) }}"
|
|
mode: "{{ item.mode|default('0755') }}"
|
|
with_items:
|
|
- { path: "/var/log/ceilometer" }
|
|
when: log_dir.rc != 0
|