Adding windows nodes to Active Directory Domain using Chef


#1

Hello!!

I have this simple recipe to add my Windows nodes to my domain:

join_domain.rb

join_command = “netdom join “+Chef::Config[:node_name]+”
/domain:test.local /userd:usertest /passwordd:.asdfasdf.! /reboot:5”

batch ‘join_domain’ do
code join_command
action :run
end

Now, when nodes restarts, the FQDN of the nodes will change to
nodename.test.local and the chef client fails as the FQDN has changed
from nodename to nodename.test.local

Is there a nice way to handle this behavior?

Thanks!!!


#2

We do the same and we keep the node name different from the hostname/fqdn.
You simply need to set the node_name config option in the client.rb. this
can be done with the chef-client cookbook.
On Jul 18, 2014 8:20 AM, “Carlos Camacho” carlos.camacho@frontiersin.org
wrote:

Hello!!

I have this simple recipe to add my Windows nodes to my domain:

join_domain.rb


join_command = “netdom join “+Chef::Config[:node_name]+”
/domain:test.local /userd:usertest /passwordd:.asdfasdf.! /reboot:5”

batch ‘join_domain’ do
code join_command
action :run
end


Now, when nodes restarts, the FQDN of the nodes will change to
nodename.test.local and the chef client fails as the FQDN has changed
from nodename to nodename.test.local

Is there a nice way to handle this behavior?

Thanks!!!


#3

Thanks!

I managed by doing exactly that, but using the -N parameter when chef
its being bootstrapped!

Cheers

On Fri, Jul 18, 2014 at 8:33 AM, Maxime Brugidou
maxime.brugidou@gmail.com wrote:

We do the same and we keep the node name different from the hostname/fqdn.
You simply need to set the node_name config option in the client.rb. this
can be done with the chef-client cookbook.

On Jul 18, 2014 8:20 AM, “Carlos Camacho” carlos.camacho@frontiersin.org
wrote:

Hello!!

I have this simple recipe to add my Windows nodes to my domain:

join_domain.rb


join_command = “netdom join “+Chef::Config[:node_name]+”
/domain:test.local /userd:usertest /passwordd:.asdfasdf.! /reboot:5”

batch ‘join_domain’ do
code join_command
action :run
end


Now, when nodes restarts, the FQDN of the nodes will change to
nodename.test.local and the chef client fails as the FQDN has changed
from nodename to nodename.test.local

Is there a nice way to handle this behavior?

Thanks!!!