Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails when sensible option inject_facts_as_vars = False #892

Open
GregWhiteyBialas opened this issue Feb 10, 2023 · 1 comment
Assignees

Comments

@GregWhiteyBialas
Copy link

Hi.

By default, Ansible injects a variable for every fact, prefixed with ansible_. This can result in a large number of variables for each host, which at scale can incur a performance penalty. Ansible provides a configuration option link that can be set to False to prevent this injection of facts. In this case, facts should be referenced via ansible_facts..

When this option is set to "False" deploying Wazuh using roles fails with:
`fatal: [wazuh-master]: FAILED! =>
msg: |-
The conditional check 'ansible_os_family == 'RedHat'' failed. The error was: error while evaluating conditional (ansible_os_family == 'RedHat'): 'ansible_os_family' is undefined

The error appears to be in '/home/ubuntu/src/kayobe-config/etc/kayobe/ansible/roles/wazuh-ansible/wazuh-ansible/roles/wazuh/wazuh-indexer/tasks/RedHat.yml': line 4, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


  - name: RedHat/CentOS/Fedora | Add Wazuh indexer repo
    ^ here

`

This issue can Sheed some light and give context why to use inject_facts_as_vars = False in the first place.

I have created PR to solve this. If something needs more clarification don't hesitate to ask.

I am not sure if this approach to creating issue and creating PR is correct (in terms of interacting with community), so if anything should be done differently let me know :)

@teddytpc1 teddytpc1 linked a pull request Mar 7, 2023 that will close this issue
@teddytpc1
Copy link
Member

Hi @GregWhiteyBialas.
Thanks for the contribution. Can you change the base branch of the PR from master to 4.4, please?
I will test the changes and review the PR next week.

@teddytpc1 teddytpc1 self-assigned this Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants