ansible-collections / community.windows

Windows community collection for Ansible
https://galaxy.ansible.com/community/windows
GNU General Public License v3.0
193 stars 152 forks source link

win_user_profile module does not create the users AppData Folders #537

Open krapgras opened 9 months ago

krapgras commented 9 months ago
SUMMARY

win_user_profile module does not create the users AppData Folders

ISSUE TYPE
COMPONENT NAME

win_user_profile

ANSIBLE VERSION
ansible [core 2.15.3]
  config file = None
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/ansible/lib/python3.9/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/ansible/bin/ansible
  python version = 3.9.14 (main, Sep 24 2023, 01:49:33) [GCC 11.2.0] (/opt/ansible/bin/python)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection        Version
----------------- -------
community.general 5.8.0  

# /opt/ansible/lib/python3.9/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 7.3.0
OS / ENVIRONMENT

Windows Machines (ALL)

STEPS TO REPRODUCE
    - name: Make sure user profile exists
      community.windows.win_user_profile:
        username: robb.stark
        state: present

    - name: Create File
      become: true
      ansible.windows.win_copy:
        src: file.txt
        dest: C:\Users\robb.stark\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\file.txt
EXPECTED RESULTS

Expected that the folder was create by win_user_profile module as this is one of the folders that should get created on user login. Probably other folders in AppData are also missing.

ACTUAL RESULTS
msg: 'failed to copy file "file.txt": Destination directory ''C:\Users\robb.stark\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup'' does not exist'
  operation: file_copy
  original_basename: file.txt
  size: 34
  src: file.txt