Skip to content

Commit

Permalink
Merge pull request #419 from rebtoor/module_load_production_profile
Browse files Browse the repository at this point in the history
Make `edpm_modules_load` compliant with ansible-lint `production` profile
  • Loading branch information
openshift-ci[bot] authored Oct 9, 2023
2 parents 7e6c7b2 + dab53cd commit a56864c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions roles/edpm_module_load/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
state: directory
setype: etc_t
selevel: s0
mode: 0755
mode: "0755"

- name: "Load modules"
- name: Load modules
community.general.modprobe:
name: "{{ item.name }}"
params: "{{ item.params | default(omit) }}"
Expand All @@ -37,19 +37,19 @@
loop_control:
label: "{{ item.name }}"

- name: "Persist modules via modules-load.d"
- name: Persist modules via modules-load.d
ansible.builtin.template:
dest: "/etc/modules-load.d/{{ item.name }}.conf"
src: module-load.conf.j2
mode: 0644
mode: "0644"
loop: "{{ edpm_modules }}"
loop_control:
label: "{{ item.name }}"
register: _edpm_modules_add
when:
- (item.state | default('present')) == 'present'

- name: "Drop module persistence"
- name: Drop module persistence
ansible.builtin.file:
path: "/etc/modules-load.d/{{ item.name }}.conf"
state: absent
Expand All @@ -60,13 +60,13 @@
when:
- (item.state | default('present')) == 'absent'

- name: "Set modules persistence via /etc/modules"
- name: Set modules persistence via /etc/modules
ansible.builtin.lineinfile:
dest: /etc/modules
line: "{{ item.name }} {{ item.params | default('') }}"
state: "{{ item.state | default('present') }}"
create: true
mode: 0644
mode: "0644"
loop: "{{ edpm_modules }}"
loop_control:
label: "{{ item.name }}"
Expand Down

0 comments on commit a56864c

Please sign in to comment.