Andy McCrae 3461588270 Adjust symlink for nova-compute logs on metal
Current symlink isn't mounted on the rsyslog container because its a symlink.
Reversing the symlink will work for rsyslog.

* Create the log directory in /openstack/log with appropriate permissions
* Link to this directory from /var/log/nova
* Adjust the directory to include the physical node name

Fixes #87
2014-09-08 15:58:56 +01:00

68 lines
1.9 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: Ensure container is running
lxc: >
name={{ container_name }}
command=start
delegate_to: "{{ physical_host }}"
when: is_metal != true
- name: Add nbd devices to the compute
shell: >
for i in /dev/nbd*; do lxc-device -n {{ container_name }} add $i $i; done;
delegate_to: "{{ physical_host }}"
when: is_metal != true
- name: Add net/tun device to the compute
shell: >
lxc-device -n {{ container_name }} add /dev/net/tun /dev/net/tun
delegate_to: "{{ physical_host }}"
when: is_metal != true
- name: Add kvm device to the compute
shell: >
lxc-device -n {{ container_name }} add /dev/kvm /dev/kvm
delegate_to: "{{ physical_host }}"
when: nova_virt_type == 'kvm' and is_metal != true
- name: Ensure kvm permissions
shell: >
udevadm trigger
when: nova_virt_type == 'kvm'
- name: Create log directory
file:
path: "/openstack/log/{{ physical_host}}"
state: directory
owner: nova
group: nova
mode: 0755
force: true
when: is_metal == true
- name: Remove old log dir on metal
shell: >
ls /openstack/log/{{ physical_host }}/nova-compute.log 2>/dev/null || rm -rf /var/log/nova/
when: is_metal == true
- name: Create log aggregation links
file:
src: "/openstack/log/{{ physical_host}}"
dest: "/var/log/nova"
state: "link"
when: is_metal == true