cookbook 'ad-join', '= 4.1.0', :supermarket
Joins windows computers to Active Directory (LDAP) Domain
cookbook 'ad-join', '= 4.1.0'
knife supermarket install ad-join
knife supermarket download ad-join
This is a library cookbook that will join a windows computer to a windows AD domain
Chef >= 12.5.1
This leverages custom resources so it will not work on chef versions older than 12.5.1
This cookbook is a library cookbook and is intended to be used by your own wrapper cookbook. See the [recipes directory](./recipes) for examples.
It contains a custom resource named
domain_join that takes 4 properties
domain_join 'foobar' do domain 'example.com' domain_user 'binduser' domain_password 'correct-horse-battery-staple' ou 'OU=US,OU=West,OU=Web,DC=example,DC=com' end
The ou must be formatted with
OU= before each organizational unit and
DC= before each domain component. see [recipes/example_complex.rb](./recipes/example_complex.rb) for an example of how to derive the OU from attributes.
Behind the scenes
If you bootstrapped the node with the name option; e.g.
knife bootstrap -N us-web01
Then that is the name that will be used to join the domain (not the hostname since windows randomly generates it on first boot)
The name cannot include control characters, leading or trailing spaces, or any of the following characters: / \ [ ].
In most cases, Windows hostnames must be 15 characters or less.
The cookbook creates a windows scheduled task that runs chef as soon as the VM is started. The scheduled task is deleted after all the reboots.
The cookbook will restart windows twice since some group policy objects (like the time zone) are not applied on first boot. You can change this behavior by changing the following attribute to false.
default['ad-join']['windows']['double_reboot'] = true
License and Authors
|windows >= 1.36.0|
There are no cookbooks that are contingent upon this one.
Fixes powershell error when vm name is same as bootstrap name. issue #2
Updates metadata for supermarket
Fixes attribute name for double reboot
Created new git repo for public release on github
Create breadcrumb only if missing
Fixes OU not having quotes
Complete rewrite to make it a library cookbook
More verbose logging in scheduled task
Reduces timeout to 30 seconds
general cleanup, removed private domain name and so on, prepared for public release
removed private usernames and passwords
rubocop convention alerts accepted
changed databag name
rubocop check for line length now is 120 symbols
rubocop and foodcritic inspections added
Added possibility to run it on teamcity CI
Fixed, directory server is unavailable issue, code commented for future use
Passwords moved into databag
added ohai reload for new fqdn resolution in chef
Initial release of ad-join
4.1.0 passed this metric
4.1.0 passed this metric