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

ansible_windows_domain_role' is undefined #64

Closed
dimi4ik opened this issue Feb 26, 2023 · 4 comments
Closed

ansible_windows_domain_role' is undefined #64

dimi4ik opened this issue Feb 26, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@dimi4ik
Copy link

dimi4ik commented Feb 26, 2023

Describe the Issue

When I run the role, I receive the following message:

`TASK [Windows-2019-CIS : Include the preliminary tasks] ***********************************************************************************************************************************************************************************************************************
included: /home/azureuser/github/projekt_AnsibleLernen/azurelab/roles/Windows-2019-CIS/tasks/prelim.yml for apc000060002

TASK [Windows-2019-CIS : Set fact is system is standalone] ********************************************************************************************************************************************************************************************************************
fatal: [apc000060002]: FAILED! =>
msg: |-
The conditional check 'ansible_windows_domain_role == 'Stand-alone server'' failed. The error was: error while evaluating conditional (ansible_windows_domain_role == 'Stand-alone server'): 'ansible_windows_domain_role' is undefined

The error appears to be in '/home/azureuser/github/projekt_AnsibleLernen/azurelab/roles/Windows-2019-CIS/tasks/prelim.yml': line 5, column 9, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  block:
      - name: Set fact is system is standalone
        ^ here`

The offending line appears to be:

  block:
      - name: Set fact is system is standalone
        ^ here`

Expected Behavior
The task should process correctly for a domain joined machine

Actual Behavior
A clear and concise description of what's happening.

Control(s) Affected
What controls are being affected by the issue

Environment (please complete the following information):

  • git branch: [e.g devel]
  • Ansible Version: [e.g. 2.10]
  • Host Python Version: [e.g. Python 3.7.6]
  • Ansible Server Python Version: [e.g. Python 3.7.6]
  • Additional Details:

Additional Notes
am I doing something wrong ? thanks for the ti

Possible Solution
Enter a suggested fix here

@dimi4ik dimi4ik added the bug Something isn't working label Feb 26, 2023
@dimi4ik
Copy link
Author

dimi4ik commented Feb 26, 2023

can be fixed, the playbook must contain:

gather_facts: true

@uk-bolly uk-bolly added enhancement New feature or request and removed bug Something isn't working labels Mar 7, 2023
@uk-bolly uk-bolly self-assigned this Mar 7, 2023
@uk-bolly
Copy link
Member

uk-bolly commented Mar 7, 2023

hi @dimi4ik

Thank you for the feedback, i believe gather_facts: true is the default value. So should be run unless explicitly turned to false or defaults overridden in the loaded ansible.cfg

I will however leave this issue open to ensure we add that to the playbook, in the next release.

Thank you again for the feedback

uk-bolly

@MrSteve81 MrSteve81 assigned MrSteve81 and unassigned uk-bolly Mar 7, 2023
@MrSteve81
Copy link
Contributor

Will be added to the upcoming release in the playbook. I have assigned this to myself to add in my next release.

@MrSteve81
Copy link
Contributor

Complete and merged to devel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants