From 052bc86e34ee7d5e30ed4eaccf6c7f98a63d1119 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Sat, 16 Nov 2019 23:19:24 +0800 Subject: [PATCH] Adjust the order of src and dest for template module 1. Adjust the order of src and dest for template module 2. Remove the double quotes from task's name to keep consistence with the others. 3. Add a space after "|" Change-Id: I580517d5b95dcaa34841def70ec6f57a5cbe0229 --- ansible/roles/module-load/tasks/main.yaml | 10 +++++----- .../roles/module-load/templates/module-load.conf.j2 | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/roles/module-load/tasks/main.yaml b/ansible/roles/module-load/tasks/main.yaml index a09c1aaec8..a5604bf15f 100644 --- a/ansible/roles/module-load/tasks/main.yaml +++ b/ansible/roles/module-load/tasks/main.yaml @@ -10,7 +10,7 @@ path: /etc/modules-load.d register: modules_load_stat - - name: "Load modules" + - name: Load modules become: true modprobe: name: "{{ item.name }}" @@ -20,11 +20,11 @@ loop_control: label: "{{ item.name }}" - - name: "Persist modules via modules-load.d" + - name: Persist modules via modules-load.d become: true template: - dest: "/etc/modules-load.d/{{ item.name }}.conf" src: module-load.conf.j2 + dest: "/etc/modules-load.d/{{ item.name }}.conf" loop: "{{ modules }}" loop_control: label: "{{ item.name }}" @@ -32,7 +32,7 @@ - modules_load_stat.stat.exists - (item.state | default('present')) == 'present' - - name: "Drop module persistence" + - name: Drop module persistence become: true file: path: "/etc/modules-load.d/{{ item.name }}.conf" @@ -44,7 +44,7 @@ - modules_load_stat.stat.exists - (item.state | default('present')) == 'absent' - - name: "Persist modules via /etc/modules" + - name: Persist modules via /etc/modules become: true lineinfile: dest: /etc/modules diff --git a/ansible/roles/module-load/templates/module-load.conf.j2 b/ansible/roles/module-load/templates/module-load.conf.j2 index 21808b95ff..34ad1b0152 100644 --- a/ansible/roles/module-load/templates/module-load.conf.j2 +++ b/ansible/roles/module-load/templates/module-load.conf.j2 @@ -1,2 +1,2 @@ # {{ ansible_managed }} -{{ item.name }} {{ item.params |default('') }} +{{ item.name }} {{ item.params | default('') }}