Hi,

This is my Vagrantfile. Your example works, however with this I get Error 

#$chef_server_url = "https://api.chef.io/organizations/test-lab-athreya";
#$chef.validation_client_name = "test-lab-athreya-validator"
#$chef.client_key_path = "/etc/chef/client.pem"
#$chef.validation_key_path = "/home/learn/Downloads/validation.pem"
$env_domain                  = 'homelab.com'

guests = {
 :ubuntu => {
   :singleton => true,
   :box => 'hashicorp/precise64',
   :public_network => { :bridge => 'wlp3s0', :ip => '192.168.1.12', 
:netmask => '255.255.255.0', :gw => '192.168.1.254' },
   :chef_recipes => ["motd"],
   :vb_memory => 1024
    },
 :win => {
   :singleton => true,
   :box => 'kensykora/windows_2012_r2_standard',
   :public_network => { :bridge => 'wlp3s0', :ip => '192.168.1.14', 
:netmask => '255.255.255.0', :gw => '192.168.1.254' },
   :chef_recipes => ["chocolatey"],
   :vb_memory => 4096
   }
}

Vagrant.configure("2") do |global_config|
  guests.each_pair do | name, options |
    names = [name]
    names.each do |name|
     global_config.vm.define name do |config|
      guest_is_windows = options[:box].include? 'windows'
    config.vm.hostname = "#{name}.homelab.com"
        config.vm.box = options[:box]
    config.butcher.enabled = true
    config.butcher.verify_ssl = false
        config.omnibus.chef_version = :latest
        pub=options [:public_network]
        config.vm.network 'public_network', :bridge => pub[:bridge], :ip => 
pub[:ip], :netmask => pub[:netmask], :gw => pub[:gw]
        if guest_is_windows
         config.winrm.username = "vagrant"
       config.winrm.password = "vagrant"
       config.vm.communicator = "winrm"
       config.vm.guest = :windows
       config.vm.network :forwarded_port, guest: 3389, host: 3389, id: 
"rdp", auto_correct: true
       config.vm.network :forwarded_port, guest: 5985, host: 5985, id: 
"winrm", auto_correct: true
     config.vm.hostname = "#{name}"
     $hostname = "#{name}.homelab.com"
     config.vm.provision "shell", inline: "(Get-WmiObject 
Win32_ComputerSystem).Rename($hostname)"
        else
         config.ssh.username = "vagrant"
         config.vm.hostname = "#{name}.homelab.com"
        end

    config.vm.provision :chef_client do |chef|
      chef.node_name = "#{name}"
         if guest_is_windows
        chef.provisioning_path = 'c:\\chef'
         else
             chef.provisioning_path = "/etc/chef"
         end
      chef.chef_server_url = 
"https://api.chef.io/organizations/test-lab-athreya";
      chef.validation_client_name = "test-lab-athreya-validator"
     chef.validation_key_path = "/home/learn/Downloads/validation.pem"
         options[:chef_recipes].each do | recipe |
        chef.add_recipe recipe
     end
    end
     end
  end
 end
end

 INFO interface: error: Chef never successfully completed! Any errors 
should be visible in the
output above. Please fix your recipes so that they properly complete.
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
 INFO interface: Machine: error-exit 
["VagrantPlugins::Chef::Provisioner::Base::ChefError", "Chef never 
successfully completed! Any errors should be visible in the\noutput above. 
Please fix your recipes so that they properly complete."]


On Saturday, 15 April 2017 21:18:53 UTC+1, Alvaro Miranda Aguilera wrote:
>
> try disabling the firewall and try again
>
>
> https://social.technet.microsoft.com/Forums/windowsserver/en-US/78054d35-d3fc-4872-ba46-f1c1c59383b5/how-to-fix-winrm-and-fqdn-issue?forum=winserverpowershell
>
>
> On Sat, Apr 15, 2017 at 9:28 PM, athreya vc <[email protected] 
> <javascript:>> wrote:
>
>> Thanks for helping me out here. 
>>
>> Yes I did and it did work with this.  "win001" works. If I have to make 
>> it "win001.homelab.com" it fails. 
>>
>> Vagrant.configure("2") do |config|
>>
>>   config.vm.box = "livedrive-vagrantlab-win2012r2-v6"
>>
>>   config.winrm.username = "Administrator"
>>
>>   config.vm.hostname = "win001" # If I put win001.homelab.com it will 
>> fail
>>
>>   config.winrm.password = "Liverp00l"
>>
>>   config.vm.communicator = "winrm"
>>
>>   config.vm.guest = :windows
>>
>>   config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", 
>> auto_correct: true
>>
>>   config.vm.network :forwarded_port, guest: 5985, host: 5985, id: 
>> "winrm", auto_correct: true
>>
>>   config.vm.provision "shell", inline: "Write-Host Hello World"
>>
>>   config.vm.provision "shell", inline: "(Get-UICulture).Calendar | 
>> ConvertTo-Json"
>>
>> end
>>
>> Now I am confused :(.  My setup is, there is a PowerShell script which 
>> renames the VM. AFter renaming Chef Provisioning takes place, and I see 
>> client.pem is also not getting copied. 
>>
>>
>>
>> On Saturday, 15 April 2017 17:37:49 UTC+1, Alvaro Miranda Aguilera wrote:
>>>
>>> did you try my example?
>>>
>>>
>>>
>>> On Sat, Apr 15, 2017 at 5:35 PM, athreya vc <[email protected]> wrote:
>>>
>>>> Hi, 
>>>>
>>>> For me I keep getting this 
>>>>
>>>> ==> win001: Starting Chef Client, version 12.10.24
>>>>  INFO interface: info: [2017-04-15T16:33:21+01:00] INFO: *** Chef 
>>>> 12.10.24 ***
>>>>  INFO interface: info: ==> win001: [2017-04-15T16:33:21+01:00] INFO: 
>>>> *** Chef 12.10.24 ***
>>>> ==> win001: [2017-04-15T16:33:21+01:00] INFO: *** Chef 12.10.24 ***
>>>>  INFO interface: info: [2017-04-15T16:33:21+01:00] INFO: Platform: 
>>>> i386-mingw32
>>>>  INFO interface: info: ==> win001: [2017-04-15T16:33:21+01:00] INFO: 
>>>> Platform: i386-mingw32
>>>> ==> win001: [2017-04-15T16:33:21+01:00] INFO: Platform: i386-mingw32
>>>>  INFO interface: info: [2017-04-15T16:33:21+01:00] INFO: Chef-client 
>>>> pid: 2240
>>>>  INFO interface: info: ==> win001: [2017-04-15T16:33:21+01:00] INFO: 
>>>> Chef-client pid: 2240
>>>> ==> win001: [2017-04-15T16:33:21+01:00] INFO: Chef-client pid: 2240
>>>> DEBUG winrmshell: [WinRM] Waiting for output...
>>>>
>>>> It seems to me winrm is not working at all. I am trying some more.
>>>>
>>>> Regards,
>>>>
>>>>
>>>>
>>>> On Saturday, 15 April 2017 10:56:14 UTC+1, Alvaro Miranda Aguilera 
>>>> wrote:
>>>>>
>>>>> Hello
>>>>>
>>>>> When I wrote my previous mail i dd a typo, sorry
>>>>>
>>>>> winrm is NOW part of vagrant core, that changed
>>>>>
>>>>> so in old version and some plugins the wayt you setup stuff may be 
>>>>> different
>>>>>
>>>>> this works for me
>>>>>
>>>>>
>>>>> Vagrant.configure("2") do |config|
>>>>>
>>>>>   config.vm.box = "ferventcoder/win2008r2-x64-nocm"
>>>>>
>>>>>   config.winrm.username = "vagrant"
>>>>>
>>>>>   config.winrm.password = "vagrant"
>>>>>
>>>>>   config.vm.communicator = "winrm"
>>>>>
>>>>>   config.vm.guest = :windows
>>>>>
>>>>>   config.vm.network :forwarded_port, guest: 3389, host: 3389, id: 
>>>>> "rdp", auto_correct: true
>>>>>
>>>>>   config.vm.network :forwarded_port, guest: 5985, host: 5985, id: 
>>>>> "winrm", auto_correct: true
>>>>>
>>>>>   config.vm.provision "shell", inline: "Write-Host Hello World"
>>>>>
>>>>>   config.vm.provision "shell", inline: "(Get-UICulture).Calendar | 
>>>>> ConvertTo-Json"
>>>>>
>>>>> end
>>>>>
>>>>>
>>>>> -- 
>>>> This mailing list is governed under the HashiCorp Community Guidelines 
>>>> - https://www.hashicorp.com/community-guidelines.html. Behavior in 
>>>> violation of those guidelines may result in your removal from this mailing 
>>>> list.
>>>>  
>>>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>>>> IRC: #vagrant on Freenode
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Vagrant" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/vagrant-up/05821761-03b1-40c2-8597-e06b44723fbb%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/vagrant-up/05821761-03b1-40c2-8597-e06b44723fbb%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Alvaro
>>>
>>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>> IRC: #vagrant on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Vagrant" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vagrant-up/aa880bca-c99f-401b-b5a0-f2dc26594be5%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/vagrant-up/aa880bca-c99f-401b-b5a0-f2dc26594be5%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Alvaro
>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/6783003f-b1a7-4634-aa42-27026957a60e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to