diff --git a/roles/logger/tasks/main.yml b/roles/logger/tasks/main.yml index 2ddf64df..f78374b3 100644 --- a/roles/logger/tasks/main.yml +++ b/roles/logger/tasks/main.yml @@ -22,44 +22,44 @@ - include_tasks: dotnet_logger_win.yaml when: > (ansible_os_family == 'Windows') and - (agents_to_set_loggers_for | select('match', 'dotnet' ) or + (agents_to_set_loggers_for | select('match', 'dotnet' | list ) or ( agent_type is defined and agent_type == "dotnet" )) # --------------[ DB ]------------------ - include_tasks: db_logger_linux.yaml when: > (ansible_os_family == 'RedHat' or ansible_os_family == 'Debian') and - (agents_to_set_loggers_for | select('match', 'db' ) or + (agents_to_set_loggers_for | select('match', 'db' | list ) or ( agent_type is defined and agent_type == "db" )) - include_tasks: db_logger_win.yaml when: > (ansible_os_family == 'Windows') and - (agents_to_set_loggers_for | select('match', 'db' ) or + (agents_to_set_loggers_for | select('match', 'db' | list ) or ( agent_type is defined and agent_type == "db" )) # -------------[ Java ]----------------- - include_tasks: java_logger_linux.yaml when: > (ansible_os_family == 'RedHat' or ansible_os_family == 'Debian') and - (agents_to_set_loggers_for | select('match', '.*java.*' ) or + (agents_to_set_loggers_for | select('match', '.*java.*' | list ) or ( agent_type is defined and agent_type is regex('.*java.*'))) - include_tasks: java_logger_win.yaml when: > (ansible_os_family == 'Windows') and - (agents_to_set_loggers_for | select('match', '.*java.*' ) or + (agents_to_set_loggers_for | select('match', '.*java.*' | list ) or ( agent_type is defined and agent_type is regex('.*java.*'))) # -----------[ Machine ]---------------- - include_tasks: machine_logger_linux.yaml when: > (ansible_os_family == 'RedHat' or ansible_os_family == 'Debian') and - ( agents_to_set_loggers_for | select('match', 'machine' ) or + ( agents_to_set_loggers_for | select('match', 'machine' | list ) or ( agent_type is defined and agent_type == "machine" )) - include_tasks: machine_logger_win.yaml when: > (ansible_os_family == 'Windows') and - ( agents_to_set_loggers_for | select('match', 'machine' ) or + ( agents_to_set_loggers_for | select('match', 'machine' | list ) or ( agent_type is defined and agent_type == "machine" ))