Merge "If /var/log/lxc exists, move it to the log aggregation parent"

This commit is contained in:
Jenkins 2016-07-28 14:39:14 +00:00 committed by Gerrit Code Review
commit 3b58c5fb48

View File

@ -19,16 +19,24 @@
max_fail_percentage: 20
user: root
pre_tasks:
- name: Create log dir
- name: Check the state of the default LXC service log directory
stat:
path: "/var/log/lxc"
register: _lxc_log_dir
- name: Move the existing folder to the log aggregation parent
command: "mv /var/log/lxc /openstack/log/{{ inventory_hostname }}-lxc"
when:
- _lxc_log_dir.stat.isdir is defined
- _lxc_log_dir.stat.isdir | bool
- name: Create the new LXC service log directory
file:
path: "/openstack/log/{{ inventory_hostname }}-lxc"
state: directory
- name: Create log aggregation links
- name: Create the LXC service log aggregation link
file:
src: "/openstack/log/{{ inventory_hostname }}-lxc"
dest: "/var/log/lxc"
state: "link"
force: "yes"
roles:
- { role: "lxc_hosts", tags: [ "lxc-host", "host-setup" ] }
- role: "rsyslog_client"