---
- name: Install/Update newoutput output packages and generate configuration newoutput in /etc/rsyslog.d
  vars:
    __rsyslog_packages: "{{ __rsyslog_newoutput_output_packages }}"
    __rsyslog_rules: "{{ __rsyslog_newoutput_output_rules }}"
  include_tasks:
    file: "{{ role_path }}/tasks/deploy.yml"

- name: Create newoutput output configuration files in /etc/rsyslog.d
  vars:
    __rsyslog_packages: []
    __rsyslog_rules:
      - name: "output-newoutput-{{ item.name }}"
        type: "output"
        state: "{{ item.state | d('present') }}"
        sections:
          - options: "{{ lookup('template', 'output_newoutput.j2') }}"
  include_tasks:
    file: "{{ role_path }}/tasks/deploy.yml"
  loop: '{{ rsyslog_output_newoutput }}'
