cookbook 'ad-join', '= 4.8.0'
ad-join
(25) Versions
4.8.0
-
Follow36
Joins windows computers to Active Directory (LDAP) Domain
cookbook 'ad-join', '= 4.8.0', :supermarket
knife supermarket install ad-join
knife supermarket download ad-join
ad-join Cookbook
This is a library cookbook that will join a windows computer to a windows AD domain
Requirements
Chef >= 12.5.1
This leverages custom resources so it will not work on chef versions older than 12.5.1
Tested on:
Windows 2012R2
Attributes
default['ad-join']['windows']['update_hostname'] = true
Set to false if you want the domain name/hostname to be different from the chef node name. (see #5).
default['ad-join']['windows']['double_reboot'] = true
Will continue to reboot windows until joined to domain and breadcrumb c:\\Windows\\chef-ad-join.txt
exists.
default['ad-join']['windows']['visual_warning'] = false
If visual_warning = true
, windows will display a login warning to anyone who connects via RDP to the machine before chef has finished the reboots and the converge. This will override any group policy your company might have in place for displaying custom login messages.
Usage
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 5 properties
- domain
- domain_user
- domain_password
- ou
- server (optional)
example:
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' server 'DC01' #Optional 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
Authors:
Volodymyr Babchynskyy vbabch@softserveinc.com
Spencer Owen sowen@netdocuments.com
Dependent cookbooks
windows >= 1.36.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
4.8.0
Fix: No longer gives deprecation warnings if 'server' is nil. (#9)
4.7.0
Improvement: Adds name to scheduled task, removing need for workaround http://bit.ly/1WDZ1kn
Change: Changes c:\windows\chef-ad-join.txt to windows friendly path c:/windows/chef-ad-join.txt
4.6.1
Fix: Warning registry key not cleaned up
4.6.0
Add: 'server' parameter to allow for specifying a specific domain controller
Fix: Warning message wouldn't be displayed (#4)
4.5.0
Fix: Passwords with special characters now work properly (#7 Thanks opsline-radek)
Fix: OU Parameter is now truly optional (#6 Thanks opsline-radek)
4.4.0
Adds new attribute default['ad-join']['windows']['update_hostname']
4.3.0
Adds warning attribute
4.2.0
Fixes incorrect CWD in sched task (issue #3)
Fixes incorrect ohai fact "node['os']"
4.1.0
Fixes powershell error when vm name is same as bootstrap name. issue #2
4.0.2
Updates metadata for supermarket
4.0.1
Fixes attribute name for double reboot
4.0.0
Created new git repo for public release on github
3.0.2
Create breadcrumb only if missing
3.0.1
Fixes OU not having quotes
3.0.0
Complete rewrite to make it a library cookbook
2.0.2
More verbose logging in scheduled task
2.0.1
Reduces timeout to 30 seconds
1.0.0
general cleanup, removed private domain name and so on, prepared for public release
0.9.0
removed private usernames and passwords
0.8.1
rubocop convention alerts accepted
0.8.0
changed databag name
0.6.1
rubocop check for line length now is 120 symbols
0.6.0
rubocop and foodcritic inspections added
0.5.1
icon added
0.5.0
tests added
0.4.0
Added possibility to run it on teamcity CI
0.3.0
Fixed, directory server is unavailable issue, code commented for future use
0.2.0
Passwords moved into databag
0.1.1
added ohai reload for new fqdn resolution in chef
0.1.0
Initial release of ad-join
Foodcritic Metric
4.8.0 passed this metric
4.8.0 passed this metric