marcinbojko / hv-packer

Hyper-V Generation 2 Packer Templates for Windows 2019/2022, AlmaLinux 8.x/AlmaLinux 9.x/RockyLinux 8.x/9.x/OracleLinux 8.x/9.x Ubuntu 20.04/Ubuntu 22.04/Ubuntu 24.04
188 stars 74 forks source link

Confirmation on the use of Ansible Provisioner #11

Closed amitchettri closed 3 years ago

amitchettri commented 3 years ago

Hi @marcinbojko ,

I wanted to confirm from your end on the use of ansible remote or local provisioner with Packer when we run packer in hyper-v and the image which is getting build is also Windows.

I believe this can't be done as both the source(Hyper-V) and image getting build are windows machine and ansible can't be install on it. But can u confirm if their is any alternative to get this done?

marcinbojko commented 3 years ago

Running ansible on pure "Windows Server 2019' or 'Windows 10" is not possible and breaks 'simple' packer usage presented by this repo. On the other hand, you can start using WSL2 on WIndows 10 Pro/Enterprise and expand your packer possibilities (supported) or Windows Server 2019 (haven't tried yet). It simply complicates stuff a lot.

My guess is, it's also possible to run script allowing to run ansible-playbook from external machine, however I was not eager to try it yet.