openstack-ansible/playbooks/common-tasks/remove_container_journal.yml
Kevin Carter af63bc0c28 On container destroy remove container journal
When a container is destroyed ensure that the journal, which is likley
being written to the host is also removed.

Change-Id: I9f7493b80c0b8c9d064fb8ce16fb305a7c944a94
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-07-10 14:21:47 +00:00

24 lines
843 B
YAML

---
# Copyright 2018, 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: Destroy container journal directories
file:
path: "/var/log/journal/{{ container_machine_id }}"
state: "absent"
delegate_to: "{{ physical_host }}"
when:
- not _container_machine_id is failed
- force_containers_destroy | bool