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

Add a force_replace_host flag to win_domain_membership #53542

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@smaslennikov
Copy link

smaslennikov commented Mar 8, 2019

SUMMARY

Currently, win_domain_membership will join current computer to the given domain, replacing any machine with the same name that is already in the domain. If one is unaware of this expected behaviour, this is a dangerous proposition.

Satisfies #53539

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

win_domain_membership

ADDITIONAL INFORMATION
@smaslennikov

This comment has been minimized.

Copy link
Author

smaslennikov commented Mar 8, 2019

Apologies if anything is missing from this PR, as this is my first one against Ansible modules.

Additionally, I have not tested this locally yet - I'll be sure to update back when that has happened.

@ansibot

This comment has been minimized.

if(Get-ADObject $new_hostname -eq $null -or (Get-ADObject $new_hostname -ne $null -and $force_replace_host)) {
$add_result = Add-Computer @add_args
} else {
Fail-Json -obj $result -message "failed to join domain: hostname already exists in AD and `force_replace_host` isn't `true`"

This comment has been minimized.

@adam-acevedo

adam-acevedo Mar 12, 2019

Looks like last ` backtick is an escape character and didn't allow the close out of your message string.

This comment has been minimized.

@smaslennikov

smaslennikov Mar 12, 2019

Author

Weird, the failure is on a completely different part of file, but this seems like a valid change nontheless.

@ansibot ansibot removed the ci_verified label Mar 12, 2019

@ansibot ansibot added core_review and removed needs_revision labels Mar 12, 2019

@smaslennikov

This comment has been minimized.

Copy link
Author

smaslennikov commented Mar 12, 2019

@mattclay Apologies if you're not the right person to ask, but what is left to be done to get this merged in for Ansible 2.8?

@mattclay

This comment has been minimized.

Copy link
Member

mattclay commented Mar 19, 2019

@smaslennikov I recommending bringing it up for discussion in the Windows Working Group or the #ansible-windows IRC channel on Freenode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.