2014-08-26 23:08:15 +00:00
|
|
|
---
|
|
|
|
# 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.
|
|
|
|
|
2015-02-14 16:06:50 +00:00
|
|
|
- name: Basic lxc host setup
|
2016-09-13 17:10:49 +00:00
|
|
|
hosts: "{{ lxc_host_group | default('lxc_hosts')}}"
|
2016-06-10 12:47:01 +00:00
|
|
|
gather_facts: "{{ gather_facts | default(True) }}"
|
2015-02-14 16:06:50 +00:00
|
|
|
max_fail_percentage: 20
|
2014-08-26 23:08:15 +00:00
|
|
|
user: root
|
2016-07-20 10:37:37 +00:00
|
|
|
pre_tasks:
|
2016-10-20 10:36:30 +00:00
|
|
|
- include: common-tasks/set-upper-constraints.yml
|
2016-11-22 08:05:23 +00:00
|
|
|
- include: common-tasks/set-pip-upstream-url.yml
|
2016-07-25 16:26:35 +00:00
|
|
|
- name: Check the state of the default LXC service log directory
|
|
|
|
stat:
|
|
|
|
path: "/var/log/lxc"
|
|
|
|
register: _lxc_log_dir
|
2016-10-16 09:07:57 +00:00
|
|
|
- name: Create the log aggregation parent directory
|
|
|
|
file:
|
|
|
|
path: "/openstack/log"
|
|
|
|
state: directory
|
2016-07-25 16:26:35 +00:00
|
|
|
- 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
|
2016-07-20 10:37:37 +00:00
|
|
|
file:
|
|
|
|
path: "/openstack/log/{{ inventory_hostname }}-lxc"
|
|
|
|
state: directory
|
2016-07-25 16:26:35 +00:00
|
|
|
- name: Create the LXC service log aggregation link
|
2016-07-20 10:37:37 +00:00
|
|
|
file:
|
|
|
|
src: "/openstack/log/{{ inventory_hostname }}-lxc"
|
|
|
|
dest: "/var/log/lxc"
|
|
|
|
state: "link"
|
2014-08-26 23:08:15 +00:00
|
|
|
roles:
|
2016-07-19 19:00:35 +00:00
|
|
|
- role: "lxc_hosts"
|
2015-03-14 22:53:32 +00:00
|
|
|
- role: "rsyslog_client"
|
2015-09-25 16:56:32 +00:00
|
|
|
rsyslog_client_log_rotate_file: lxc_log_rotate
|
2015-03-14 22:53:32 +00:00
|
|
|
rsyslog_client_log_dir: "/var/log/lxc"
|
|
|
|
rsyslog_client_config_name: "99-lxc-rsyslog-client.conf"
|
|
|
|
tags:
|
2016-07-19 19:00:35 +00:00
|
|
|
- rsyslog
|
2016-10-20 10:36:30 +00:00
|
|
|
vars_files:
|
|
|
|
- defaults/repo_packages/openstack_services.yml
|
2016-07-19 17:50:53 +00:00
|
|
|
vars:
|
|
|
|
pip_lock_to_internal_repo: False
|
2016-07-19 19:00:35 +00:00
|
|
|
tags:
|
|
|
|
- lxc-hosts
|