Fix module loading on centos hosts.

Introducing a new var: {{ openstask_host_module_file }} that contain
the path to the file containing module list.

Centos will use systemd-modules-load.service:
- http://www.unix.com/man-page/centos/8/systemd-modules-load.service/
- http://www.unix.com/man-page/centos/5/modules-load.d/

Change-Id: I9ce294045259752e48c47ed036a9550565f05bc5
This commit is contained in:
Marc Gariepy 2016-08-30 09:37:42 -04:00 committed by Kevin Carter
parent 85ecc37e11
commit a440f167ba
5 changed files with 7 additions and 3 deletions

View File

@ -23,8 +23,9 @@
- name: "Ensure kernel module(s) loaded at boot"
lineinfile:
dest: /etc/modules
dest: "{{ openstask_host_module_file }}"
line: "{{ item }}"
create: yes
with_items: "{{ openstack_host_kernel_modules }}"
when:
- openstack_host_kernel_modules | length > 0
@ -71,7 +72,7 @@
- name: "Ensure dynamic specific kernel module(s) loaded at boot"
lineinfile:
dest: /etc/modules
dest: "{{ openstask_host_module_file }}"
line: "{{ item['item']['name'] }}"
with_items: "{{ modules['results'] | default([]) }}"
when:

View File

@ -30,7 +30,7 @@
post_tasks:
- name: Open modules file
slurp:
src: /etc/modules
src: "{{ openstask_host_module_file }}"
register: modules_file
- name: Open sysctl file
slurp:

View File

@ -17,6 +17,7 @@
openstack_host_required_kernel: 3.10.0-327.13.1.el7.x86_64
openstack_host_sysstat_file: /etc/sysconfig/sysstat
openstack_host_cron_template: sysstat.cron.redhat.j2
openstask_host_module_file: /etc/modules-load.d/openstack-ansible.conf
## Kernel modules loaded on hosts
openstack_host_kernel_modules:

View File

@ -20,6 +20,7 @@ cache_timeout: 600
openstack_host_required_kernel: 3.13.0-34-generic
openstack_host_sysstat_file: /etc/default/systat
openstack_host_cron_template: sysstat.cron.debian.j2
openstask_host_module_file: /etc/modules
## Kernel modules loaded on hosts
openstack_host_kernel_modules:

View File

@ -20,6 +20,7 @@ cache_timeout: 600
openstack_host_required_kernel: 4.2.0-18-generic
openstack_host_sysstat_file: /etc/default/systat
openstack_host_cron_template: sysstat.cron.debian.j2
openstask_host_module_file: /etc/modules
## Kernel modules loaded on hosts
openstack_host_kernel_modules: