openstack-ansible-lxc_hosts/tasks/lxc_post_install.yml
Markos Chandras bdab4ef8b5 tasks: lxc_post_install: Fix system.conf DefaultTasksMax setting
systemd does not allow inline comments so the default value was never
applied to unit files as systemd printed the following warning in the
journal

Jul 03 16:39:19 vagrant-openSUSE-Leap systemd[1]: [/etc/systemd/system.conf:44] Maximum tasks value '8192 # Managed by Ansible' invalid. Ignoring.

As such, drop the comment.

Fixes: I8b4143aac84d4c795cab9c0d978c9a97ebea1793
Depends-On: I55a06c1903c4435db6d820e6919daa5f10362031
Change-Id: I6bca2b5d8ac875d8f81eb4ce61a59b97fb9d3b1e
2017-07-03 22:57:42 +01:00

73 lines
2.1 KiB
YAML

---
# Copyright 2016, 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 the lxc dnsmasq user exists
user:
name: "{{ lxc_net_dnsmasq_user }}"
comment: "LXC dnsmasq"
system: "yes"
shell: "/bin/false"
home: "/var/lib/lxc"
tags:
- lxc-dnsmasq-user
- name: Drop base config file(s)
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ item.owner|default('root') }}"
group: "{{ item.group|default('root') }}"
mode: "{{ item.mode|default('0644') }}"
with_items:
- { src: lxc-openstack.conf.j2, dest: "/etc/lxc/lxc-openstack.conf" }
- { src: default.conf.j2, dest: "/etc/lxc/default.conf" }
- { src: lxc.default.j2, dest: "{{ system_config_dir}}/lxc-net", mode: "0644" }
- { src: lxc-system-manage.j2, dest: "/usr/local/bin/lxc-system-manage", mode: "0755" }
tags:
- lxc-files
- lxc-config
- name: Drop lxc veth check script
copy:
src: "lxc-veth-check.sh"
dest: "/usr/local/bin/lxc-veth-check"
owner: "root"
group: "root"
mode: "0755"
tags:
- lxc-files
- lxc-config
- name: Set systemd DefaultTasksMax value
lineinfile:
dest: /etc/systemd/system.conf
state: present
regexp: "^.*DefaultTasksMax.*$"
line: "DefaultTasksMax={{ lxc_default_tasks_max }}"
when:
- ansible_service_mgr == 'systemd'
notify:
- Reload systemd units
tags:
- lxc-config
# Ensure apparmor reindex runs before other things that may fail
- meta: flush_handlers
- include: lxc_selinux.yml
when:
- ansible_selinux.status is defined
- ansible_selinux.status == "enabled"