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

[windows] Add README instructions for Windows hosts #233

Merged
merged 3 commits into from
Dec 9, 2019

Conversation

KSerrania
Copy link
Contributor

What does this PR do?

Add instructions on how to make the role work with Windows hosts (become: yes does not work by itself on Windows).

Motivation

Windows support.

Additional Notes

For now, I put the section next to the playbook examples. Is there a better place?

Copy link
Member

@hush-hush hush-hush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comment. WDYT ?

README.md Outdated
[servers]
linux1 ansible_host=127.0.0.1
linux2 ansible_host=127.0.0.2
windows1 ansible_host=127.0.0.3 ansible_become_method=runas ansible_become_user=System
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ansible_become_user is optional I think. By default it will use the Winrm user, no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When setting ansible_become_method to runas, you have to set the ansible_become_user. Otherwise you get this error:
fatal: [windows1]: FAILED! => {"msg": "No setting was provided for required configuration plugin_type: become plugin: runas setting: become_user "}.

But actually, there's a simpler way to make the role work, without relying on a user: by setting ansible_become=no for Windows hosts.

README.md Outdated
```yml
- hosts: servers
roles:
- { role: Datadog.datadog, become: yes, become_method: runas, become_user: System }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here I think, setting only { role: Datadog.datadog} and letting ansible use the right default works. I don't think we should advice people to use System by default and let them use the default value in there version of ansible.

@KSerrania KSerrania merged commit 6db0522 into master Dec 9, 2019
@KSerrania KSerrania deleted the kserrania/ansible-windows-readme branch December 9, 2019 08:04
KSerrania added a commit that referenced this pull request Dec 18, 2019
[windows] Add README instructions for Windows hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants