Deploying and managing Windows servers using Chef Provisioning AWS


#1

I am new to Chef and trying to deploy Windows machines on AWS using Chef Provisioning AWS resources and so far I am able to deploy the instances but it fails after creating certs on node with this error: “Socket Error getaddrinfo: the specified class was not found” error.

I am not putting any specific recipe in machine_options and running it from my workstation using chef-client in local mode. I read on this issue on Github that it is because there is no pointer to Chef-Server anywhere and it makes sense to me because I had not defined my Chef Server URL anywhere.
So now I am stuck at a point where I am not able fine where to define Chef-Server URL and how to get this deployment to successfully bootstrap my windows node with chef client installed and registered to my chef server.

Also I am planning to use private ip addresses in general and I am not sure if I am using correct options for that.

My basic machine code is:

  machine_batch do
  instances.each do |instance|
    machine node['server_stack'][instance]['instance_name'] do
      machine_options bootstrap_options: {
        image_id: node['server_stack'][instance]['image_id'],
        # disable_api_termination: true,
        instance_type: node['server_stack'][instance]['instance_type'],
        availability_zone: availability_zone,
        security_group_ids: node['server_stack'][instance]['security_group_id'],
        subnet_id: node['server_stack'][instance]['subnet_id'],
        private_ip_address: node['server_stack'][instance]['private_ip'],
        iam_instance_profile: {
          name: iam_role_name
        },
        # user_data: user_data,
        key_name: node['server_stack'][instance]['key_name']
      },
      is_windows: true,
      chef_server: {
        chef_server_url => "https://myChefServerAddress"
        },
      winrm_username: 'Administrator',
    #  transport_address_location: :private_ip,
      aws_tags: {
        Name: node['server_stack'][instance]['instance_name'],
        EnvironmentName: environment_name,
        TenantID: tenant_id,
        CustomerName: customer_name
      }
    end
  end
end

Any help would be appreciated!