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

win_domain_computer - add offline domain join support #93

Merged

Conversation

briantist
Copy link
Contributor

@briantist briantist commented Jun 2, 2020

SUMMARY

Looking to add support for offline domain join, similar to the ADComputer DSC resource.

Offline Domain Join is usually done with djoin.exe and lets you pre-create a computer and get back an opaque BLOB, which you can use on a target machine or machine image to join the machine to the domain, without having to contact a domain controller.

A bug I recently found in the DSC resource led me to look at adding the support directly to Ansible instead of continuing to use the DSC resource.

Main changes:

  • Add support for doing an offline domain join provision
  • Added tests for ODJ
  • Optionally return the BLOB from the module

Other changes:

  • Leaving off the $ from sam_account_name is no longer an error; it will be added for you
  • fixed up tests which were completely broken and unusable, updated their comments to better inform how they could be used locally (they don't run in CI)
  • fixed up some syntax and PowerShell calls
  • touched up documentation, added examples and notes
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

win_domain_computer

ADDITIONAL INFORMATION

@briantist briantist changed the title WIP win_domain_computer - add offline domain join support win_domain_computer - add offline domain join support Jun 3, 2020
Copy link
Collaborator

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

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

Have added a few comments.

Just for my general understanding the offline stuff is still creating the domain object in AD, it just handles all the logic to generate the offline join blob right?

plugins/modules/win_domain_computer.ps1 Show resolved Hide resolved
plugins/modules/win_domain_computer.py Outdated Show resolved Hide resolved
plugins/modules/win_domain_computer.py Outdated Show resolved Hide resolved
plugins/modules/win_domain_computer.py Outdated Show resolved Hide resolved
plugins/modules/win_domain_computer.py Show resolved Hide resolved
plugins/modules/win_domain_computer.ps1 Show resolved Hide resolved
plugins/modules/win_domain_computer.ps1 Outdated Show resolved Hide resolved
plugins/modules/win_domain_computer.ps1 Outdated Show resolved Hide resolved
plugins/modules/win_domain_computer.ps1 Outdated Show resolved Hide resolved
plugins/modules/win_domain_computer.ps1 Outdated Show resolved Hide resolved
@briantist
Copy link
Contributor Author

briantist commented Jun 5, 2020

Just for my general understanding the offline stuff is still creating the domain object in AD, it just handles all the logic to generate the offline join blob right?

Yes that's correct.

@briantist briantist requested a review from jborean93 June 7, 2020 00:36
Copy link
Collaborator

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

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

Looks good, just a question around the temp file deletion handling and if parent dirs are missing. Apart from that I'm happy with the changes.

plugins/modules/win_domain_computer.ps1 Show resolved Hide resolved
@briantist briantist requested a review from jborean93 June 8, 2020 22:11
@jborean93 jborean93 merged commit 6e8b122 into ansible-collections:master Jun 9, 2020
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