-
Story
-
Resolution: Done-Errata
-
Normal
-
rhel-8.9.0
-
rhel-system-roles-1.84.1-0.1.el9
-
ZStream
-
2
-
rhel-sst-system-roles
-
1
-
QE ack, Dev ack
-
False
-
-
Yes
-
Red Hat Enterprise Linux
-
System Roles Sprint 3, System Roles Sprint 4
-
Approved Blocker
-
Enhancement
-
-
Done
-
None
What were you trying to do that didn't work?
Configure custom logging using a config file and playbook.
How reproducible:
Every time
Steps to reproduce
1. Provision rhel server
2. subscribe server and yum update
3. install ansible and rhel-system-roles
dnf install rhel-system-roles ansible-core
4. create playbook
$ cat playbook.yml --- - name: Call rhel_system_roles.logging hosts: localhost gather_facts: true tasks: - name: Include role vars: logging_outputs: - name: datadog type: custom custom_config_files: - files/rsyslog/datadog.conf ansible.builtin.include_role: name: redhat.rhel_system_roles.logging
5. create custom config file
$ cat files/rsyslog/datadog.conf *.=crit;kern.none /var/adm/critical
6. run playbook
$ ansible-playbook --become playbook.yml
7. receive error
Expected results
customer logging is created
Actual results
(...) TASK [redhat.rhel_system_roles.private_logging_subrole_rsyslog : Include output sub-vars] *********************************************************************************************************************** failed: [localhost] (item={'name': 'datadog', 'type': 'custom', 'custom_config_files': ['files/rsyslog/datadog.conf']}) => {"ansible_facts": {}, "ansible_included_var_files": [], "ansible_loop_var": "output_item", "changed": false, "message": "Could not find or access '/usr/share/ansible/collections/ansible_collections/redhat/rhel_system_roles/roles/private_logging_subrole_rsyslog/vars/outputs/custom/main.yml' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option", "output_item": {"custom_config_files": ["files/rsyslog/datadog.conf"], "name": "datadog", "type": "custom"}} PLAY RECAP ****************************************************************************************************************************************************************************************************** localhost : ok=27 changed=0 unreachable=0 failed=1 skipped=40 rescued=0 ignored=0
WORKAROUND
modifying the playbooks resolves the issue
$ cat playbook.yml ---- name: Call rhel_system_roles.logging hosts: localhost gather_facts: true tasks: - name: Include role vars: rsyslog_custom_config_files: #<---- HERE - files/rsyslog/datadog.conf #<---- HERE logging_outputs: - name: datadog #type: custom #<---- HERE custom_config_files: - files/rsyslog/datadog.conf ansible.builtin.include_role: name: redhat.rhel_system_roles.logging
- links to
-
RHEA-2024:130467 rhel-system-roles bug fix and enhancement update