Windows golden images UserPreferencesMask

41 views
Skip to first unread message

Andre Leblanc

unread,
Nov 25, 2022, 2:05:49 PM11/25/22
to Packer
Building a windows image with packer and ansible.

I try to customize the border window without sucess...

- name: Apply WindowBorders property
  ansible.windows.win_regedit:
    hive: C:\Users\Default\ntuser.dat
    path: HKCU:\Control Panel\Desktop
    name: "{{ item.name }}"
    data: "{{ item.data }}"
    type: "{{ item.type }}"
    state: present
  with_items:
    - name: UserPreferencesMask
      data: hex:9e,3e,03,80,12,00,00,00
      type: binary

Beside a login script or GPO how do you customize your golden images when it concern users settings. 

Thanks!

Luis Mayorga

unread,
Nov 25, 2022, 4:05:22 PM11/25/22
to packe...@googlegroups.com
Most likely u need to elevate

Sent from my iPhone


On Nov 25, 2022, at 2:05 PM, Andre Leblanc <alebl...@gmail.com> wrote:


--
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/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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/ed27cce6-d3d5-411d-939a-4c1a6d26ccbdn%40googlegroups.com.

Andre Leblanc

unread,
Nov 29, 2022, 1:44:51 PM11/29/22
to Packer
>Most likely u need to elevate

Not sure I understand properly. My packer account, that built the image is already administrator. (Have full rights that I know...)
Thanks!

Jordan Borean

unread,
Dec 13, 2022, 3:06:27 PM12/13/22
to Packer
You are loading the default user hive but are still editing a path inside the current user. As per the last example in the win_regedit docs you need to use the 'HKLM:\ANSIBLE' path to edit the loaded hive https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_regedit_module.html. So here it would be 'path: HKLM:\ANSIBLE\Control Panel\Desktop.
Reply all
Reply to author
Forward
0 new messages