Solution: put ansible_shell_type='powershell' in the inventory file.

On Friday, January 29, 2021 at 4:17:27 PM UTC+1 Amedee Van Gasse wrote:

> I have created a Windows Server 2019 Vagrant box using 
> https://github.com/rgl/windows-vagrant. I did not make any changes.
>
> Steps to reproduce:
> git clone g...@github.com:rgl/windows-vagrant.git
> cd windows-vagrant
> make build-windows-2019-virtualbox
>
> Then I added the new box with
> vagrant box add -f windows-2019-amd64 windows-2019-amd64-virtualbox.box
>
> Vagrantfile:
> Vagrant.configure("2") do |config|
>   config.vm.box = "windows-2019-amd64"
>   config.vm.provision :ansible do |ansible|
>     ansible.playbook = "./provisioners/ansible/ansible_playbook.yml"
>     ansible.config_file = "./provisioners/ansible/ansible.cfg"
>     ansible.inventory_path = "vagrant_ansible_inventory"
>     config.vm.network "forwarded_port", guest: 22, host: 2222
>   end
> end
>
> vagrant_ansible_inventory:
>
> default ansible_connection=ssh ansible_host=127.0.0.1 ansible_port=2222 
> ansible_user='vagrant' ansible_password='vagrant' ansible_ssh_pass='vagrant'
>
> I can start the box:
> vagrant up --no-provision
>
> I can connect to the box over ssh:
> vagrant ssh
>
> (drops me into a DOS shell on the Windows Server 2019, where I can execute 
> DOS shell commands like dir)
>
> I *cannot* provision:
> vagrant provision
>
> results in error
> ==> default: Running provisioner: ansible...
>     default: Running ansible-playbook...
>
> PLAY [Jenkins node playbook] 
> ***************************************************
>
> TASK [Gathering Facts] 
> *********************************************************
> Friday 29 January 2021  14:38:19 +0100 (0:00:00.015)       0:00:00.015 
> ******** 
> fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "Failed to 
> create temporary directory.In some cases, you may have been able to 
> authenticate and did not have permissions on the target directory. Consider 
> changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", 
> for more error information use -vvv. Failed command was: ( umask 77 && 
> mkdir -p \"` echo ~/.ansible/tmp `\"&& mkdir 
> ~/.ansible/tmp/ansible-tmp-1611927499.9836688-402851-78433964159130 && echo 
> ansible-tmp-1611927499.9836688-402851-78433964159130=\"` echo 
> ~/.ansible/tmp/ansible-tmp-1611927499.9836688-402851-78433964159130 `\" ), 
> exited with result 1", "unreachable": true}
>
> PLAY RECAP 
> *********************************************************************
> default                    : ok=0    changed=0    unreachable=1    
> failed=0    skipped=0    rescued=0    ignored=0   
>
> Friday 29 January 2021  14:38:20 +0100 (0:00:00.312)       0:00:00.327 
> ******** 
>
> ===============================================================================
>  
> Gathering Facts --------------------------------------------------------- 
> 0.31s
> Playbook run took 0 days, 0 hours, 0 minutes, 0 seconds
> Ansible failed to complete successfully. Any error output should be
> visible above. Please fix these errors and try again.
>
> How do I fix this?
>

-- 
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/hashicorp/vagrant/issues
Discuss: https://discuss.hashicorp.com/c/vagrant/24
--- 
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 vagrant-up+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/55554c33-1b76-46d4-abfd-f1b59cfe6aacn%40googlegroups.com.

Reply via email to