Bug 1989034

Summary: A playbook with include_vars definition wipes out all facts for a system
Product: Red Hat Satellite Reporter: Stefan Meyer <smeyer>
Component: Ansible - Configuration ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Danny Synk <dsynk>
Severity: medium Docs Contact:
Priority: high    
Version: 6.9.0CC: aruzicka, ktordeur, oezr
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-12 18:58:43 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 Stefan Meyer 2021-08-02 09:31:36 UTC
Description of problem:
If a playbook uses include_vars in the playbook all facts that have been sent to Satellite before are cleared out

Version-Release number of selected component (if applicable):
- Satellite 6.9.4

How reproducible:
Whenever a playbook uses include_vars in the main.yml playbook file

Steps to Reproduce:
1. Use chrony playbook from [1] or create an example playbook manually
2. Manual reproducer:

file tasks/main.yml:
---
- name: Add some vars
  include_vars: "custom_vars.yml"

file vars/custom_vars.yml:
---
custom_var: "Hello again!"


3.Run Ansible roles on the client without any playbooks assigned
4. All facts are now shown
5. Assign the new role to the client and run Ansible roles again

Actual results:
- After running the role the facts for the clients are getting deleted
- What is left is just an entry for "custom_var"

Expected results:
- The facts should not get removed
- Old facts should only get removed when it is triggered by Satellite

Additional info:
[1] https://galaxy.ansible.com/ericsysmin/system