Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1861318

Summary: [logging role] cannot setup machine with tls
Product: Red Hat Enterprise Linux 8 Reporter: Dalibor Pospíšil <dapospis>
Component: rhel-system-rolesAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.3CC: djez, nhosoi, rmeggins
Target Milestone: rcKeywords: Rebase
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:logging
Fixed In Version: rhel-system-roles-1.0-18.el8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 04:03:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dalibor Pospíšil 2020-07-28 09:51:35 UTC
Description of problem:
Following playbook works. After uncommenting logging_pki* variables it stops to work. According to https://github.com/linux-system-roles/logging#security-options the rest have reasonable default so I think it should work.

Ansible says:
TASK [/usr/share/ansible/roles/rhel-system-roles.logging/roles/rsyslog : Generate global rule to add to __rsyslog_common_rules] **************************************************************************************************************
task path: /usr/share/ansible/roles/rhel-system-roles.logging/roles/rsyslog/tasks/main.yml:99
File lookup using /usr/share/ansible/roles/rhel-system-roles.logging/roles/rsyslog/templates/global.j2 as file
fatal: [server]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'type'\n\nThe error appears to be in '/usr/share/ansible/roles/rhel-system-roles.logging/roles/rsyslog/tasks/main.yml': line
 99, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: Generate global rule to add to __rsyslog_common_rules\n      ^ here\n"
}


# cat > inventory.ini <<EOF
[servers]
server ansible_host=$syncSERVER_HOSTNAME
[clients]
client ansible_host=$syncCLIENT_HOSTNAME
EOF
# cat > playbook.yaml << EOF
- name: server tcp
  hosts: servers
  roles:
    - linux-system-roles.logging
  vars:
    #logging_pki: tls
    #logging_pki_authmode: x509/name
    #logging_pki_files:
    #    - ca_cert_src: $PWD/ca.pem
    #      cert_src: $PWD/server-cert.pem
    #      private_key_src: $PWD/server-key.pem
    logging_permitted_peers:
        - $syncCLIENT_HOSTNAME
    logging_inputs:
      - name: system_input
        type: basics
      - name: remote_input
        type: remote
        tcp_port: 514
    logging_outputs:
      - name: files_output
        type: files
    logging_flows:
      - name: flows
        inputs: [system_input, remote_input]
        outputs: [files_output]
- name: client tcp
  hosts: clients
  roles:
    - linux-system-roles.logging
  vars:
    #logging_pki: tls
    #logging_pki_authmode: x509/name
    #logging_pki_files:
    #    - ca_cert_src: $PWD/ca.pem
    #      cert_src: $PWD/client-cert.pem
    #      private_key_src: $PWD/client-key.pem
    logging_permitted_peers:
        - $syncSERVER_HOSTNAME
    logging_inputs:
        - name: system_input
          type: basics
    logging_outputs:
        - name: files_output
          type: files
        - name: forward_output
          type: forwards
          facility: local2
          protocol: tcp
          target: $syncSERVER_IP
          port: 514
    logging_flows:
        - name: flows
          inputs: [system_input]
          outputs: [files_output, forward_output]
EOF

Version-Release number of selected component (if applicable):
rhel-system-roles-1.0-14.el8.noarch

How reproducible:
100%

Comment 1 Noriko Hosoi 2020-07-28 15:14:14 UTC
Dalibor, could you please attach your test script? The indentation (number of whitespaces) is very important in the ansible code. I'd like to see the exact script (or its snippet) instead of the copy in the comment.

Comment 18 errata-xmlrpc 2020-11-04 04:03:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rhel-system-roles bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:4809