From b98a7da443f27130aea57fd11c650facb740ff76 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 10 Sep 2014 08:21:27 -0500 Subject: [PATCH] added host kernel modules as well as packages which should be on all hosts. added \n ensures that the kernel modules required on all hosts are loaded added modules that compute will need --- rpc_deployment/inventory/group_vars/all.yml | 10 +++++++ .../inventory/group_vars/cinder_all.yml | 1 - .../host_common/tasks/kernel_modules.yml | 27 +++++++++++++++++++ .../roles/host_common/tasks/main.yml | 1 + .../container_config_nova_compute.yml | 3 +++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 rpc_deployment/roles/host_common/tasks/kernel_modules.yml diff --git a/rpc_deployment/inventory/group_vars/all.yml b/rpc_deployment/inventory/group_vars/all.yml index 5a74a8edab..de292e2ca2 100644 --- a/rpc_deployment/inventory/group_vars/all.yml +++ b/rpc_deployment/inventory/group_vars/all.yml @@ -64,6 +64,13 @@ excluded_user_create: - rabbitmq +## Kernel modules loaded on all hosts +host_kernel_modules: + - scsi_dh + - dm_multipath + - dm_snapshot + + ## Base Packages apt_common_packages: - vlan @@ -73,6 +80,9 @@ apt_common_packages: - git-core - rsyslog - lvm2 + - dmeventd + - libkmod-dev + - libkmod2 - libssl-dev - bridge-utils - cgroup-lite diff --git a/rpc_deployment/inventory/group_vars/cinder_all.yml b/rpc_deployment/inventory/group_vars/cinder_all.yml index 6acc2b94ad..85b5bacc44 100644 --- a/rpc_deployment/inventory/group_vars/cinder_all.yml +++ b/rpc_deployment/inventory/group_vars/cinder_all.yml @@ -89,4 +89,3 @@ container_packages: - libkmod-dev - libkmod2 - dmeventd - diff --git a/rpc_deployment/roles/host_common/tasks/kernel_modules.yml b/rpc_deployment/roles/host_common/tasks/kernel_modules.yml new file mode 100644 index 0000000000..a1a2a5ad04 --- /dev/null +++ b/rpc_deployment/roles/host_common/tasks/kernel_modules.yml @@ -0,0 +1,27 @@ +--- +# 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 kernel module(s)" + modprobe: + name: "{{ item }}" + with_items: host_kernel_modules + when: host_kernel_modules is defined + +- name: "Ensure kernel module(s) loaded at boot" + lineinfile: + dest: /etc/modules + line: "{{ item }}" + with_items: host_kernel_modules + when: host_kernel_modules is defined diff --git a/rpc_deployment/roles/host_common/tasks/main.yml b/rpc_deployment/roles/host_common/tasks/main.yml index de2ff3afb9..dd54bff88d 100644 --- a/rpc_deployment/roles/host_common/tasks/main.yml +++ b/rpc_deployment/roles/host_common/tasks/main.yml @@ -16,3 +16,4 @@ - include: sysstat.yml - include: updatehostsfile.yml - include: authorized_keys.yml +- include: kernel_modules.yml diff --git a/rpc_deployment/vars/config_vars/container_config_nova_compute.yml b/rpc_deployment/vars/config_vars/container_config_nova_compute.yml index 0ff3f8606e..5b55695f29 100644 --- a/rpc_deployment/vars/config_vars/container_config_nova_compute.yml +++ b/rpc_deployment/vars/config_vars/container_config_nova_compute.yml @@ -50,6 +50,9 @@ kernel_modules: - nf_conntrack - x_tables - iscsi_tcp + - scsi_dh + - dm_multipath + - dm_snapshot sysctl_options: - { key: 'net.ipv4.conf.all.rp_filter', value: 0 }