openstack-ansible-os_ceilom.../tasks/ceilometer_pre_install.yml

57 lines
2.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 }}"
when: swift_ceilometer_enabled | bool
- 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" }