Skip to content

Commit 9ff3c3f

Browse files
Merge pull request #28 from ccdc-opensource/fix-onedrive
Temp fix for onedrive requiring admin NO_JIRA
2 parents 8a06eb7 + a01dde3 commit 9ff3c3f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tasks/remove_onedrive.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
loop_control:
2323
loop_var: installer
2424

25+
# this step requires elevated privileges
2526
- name: Remove leftover directories
26-
when: remove_onedrive
27+
when: remove_onedrive and use_become | bool
2728
ansible.windows.win_file:
2829
path: "{{ directory }}"
2930
state: absent
@@ -34,6 +35,7 @@
3435
- "{{ ansible_env.USERPROFILE }}\\OneDrive"
3536
loop_control:
3637
loop_var: directory
38+
become: true
3739

3840
- name: Disable OneDrive via group policies
3941
when: remove_onedrive

0 commit comments

Comments
 (0)