Also, i apparently didn't read it all...derp. I do not have an issue running my similar playbooks with packer and the normal admin account w autogenerated password. Are you elevating or changing user contexts somewhere else in ansible.cfg, etc? i dont see become or become_method in your playbooks attached. If you are using an account with admin priv on the windows box, then there shouldn't be a need to elevate/runas.
On Monday, September 9, 2019 at 4:03:21 PM UTC-4, Stephen Bennett wrote: > > Hi, > > I have ansible doing application installs and everything else (Ie must be > running in admin) i want from a packer build, but when it comes to running > a ansible windows-update it errors out with: > > TASK [Install all security, critical, and rollup updates] > ********************** > amazon-ebs: An exception occurred during task execution. To see the full > traceback, use -vvv. The error was: KeyError: 'runas' > amazon-ebs: fatal: [default]: FAILED! => {"msg": "Unexpected failure > during module execution.", "stdout": ""} > amazon-ebs: to retry, use: --limit > @/home/vsts/work/1/s/packer/hardening-win/ansible/hardening.retry > > > Ansible file: > > --- > - hosts: all > tasks: > - name: Install all security, critical, and rollup updates > win_updates: > category_names: > - SecurityUpdates > - CriticalUpdates > - UpdateRollups > > - hosts: all > tasks: > - name: Reboot, if needed > win_reboot: > when: update_result.reboot_required > > > Packer provisioner: > > { > "type": "ansible", > "playbook_file": "{{ template_dir }}/ansible/hardening.yml", > "extra_arguments": [ > "--connection", "packer", > "--extra-vars", "ansible_shell_type=powershell > ansible_shell_executable=None" > ] > } > > > Any ideas on a fix or a better way to do windows patching? > > Thanks > S > > > > > > > > > > > -- 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/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/222e1e5e-6df8-444f-9f7f-cccbc61d6b3c%40googlegroups.com.