From 6f2ff3f1b8aa899d2a01d73e7de081ce5f9cffcd Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Wed, 20 Jan 2021 11:23:07 +0100 Subject: [PATCH] bindep: remove set_fact usage when converting string to list This can cause problems where set_fact isn't able to override the variable when bindep is used with include_role and bindep_file is set as a variable in the include_role task. Change-Id: I3099f1802f2d30df1265a9abc11a53c923ed4832 --- roles/bindep/tasks/main.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/roles/bindep/tasks/main.yaml b/roles/bindep/tasks/main.yaml index b4d1472fa..0d7cbffc2 100644 --- a/roles/bindep/tasks/main.yaml +++ b/roles/bindep/tasks/main.yaml @@ -10,13 +10,8 @@ - bindep_file is defined - bindep_command is not defined -- name: Convert bindep_file to list - set_fact: - bindep_file: "{{ [bindep_file] }}" - when: bindep_file is defined and bindep_file is string - - include_tasks: packages.yaml - loop: "{{ bindep_file }}" + loop: "{{ bindep_file is string | ternary([bindep_file], bindep_file) }}" loop_control: loop_var: zj_bindep_file when: bindep_file is defined