From 33621ca937a96cbd027240a1620bc891c08a02b4 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 25 May 2019 02:53:21 +0200 Subject: loop vs. with - the beginnings... --- roles/base/tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'roles/base/tasks') diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 3c480213..de180a15 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -40,7 +40,7 @@ - screen - name: install htop config (1/2) - with_items: + loop: - /root - /etc/skel file: @@ -49,7 +49,7 @@ mode: 0700 - name: install htop config (2/2) - with_items: + loop: - /root - /etc/skel copy: @@ -65,6 +65,7 @@ state: directory - name: disable net/fs/misc kernel modules + loop: "{{ modules_blacklist.net | union(modules_blacklist.fs) | union(modules_blacklist.misc) }}" lineinfile: dest: /etc/modprobe.d/disablemod.conf line: "install {{ item }} /bin/true" @@ -72,9 +73,11 @@ owner: root group: root mode: 0644 - with_items: "{{ modules_blacklist.net | union(modules_blacklist.fs) | union(modules_blacklist.misc) }}" - name: Change various sysctl-settings, look at the sysctl-vars file for documentation + loop: "{{ sysctl_config | combine(sysctl_config_user) | dict2items }}" + loop_control: + label: "{{ item.key }} = {{ item.value }}" sysctl: name: "{{ item.key }}" value: "{{ item.value }}" @@ -82,9 +85,6 @@ state: present reload: yes ignoreerrors: yes - with_dict: "{{ sysctl_config | combine(sysctl_config_user) }}" - loop_control: - label: "{{ item.key }} = {{ item.value }}" - name: install extra packages apt: -- cgit v1.2.3