diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..b38f892 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,8 @@ +--- +remove_win_apps__product_id: + - 'Microsoft.SkypeApp' + - 'Microsoft.MicrosoftOfficeHub' + - 'Microsoft.Office.OneNote' + - 'Microsoft.Office' + +remove_win_apps__users: [] diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..90a49d4 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: remove windows apps + ansible.builtin.include_tasks: remove_apps.yml + +- name: remove windows apps for other users + ansible.builtin.include_tasks: remove_apps_as_user.yml diff --git a/tasks/remove_apps.yml b/tasks/remove_apps.yml new file mode 100644 index 0000000..af1c2d3 --- /dev/null +++ b/tasks/remove_apps.yml @@ -0,0 +1,5 @@ +--- +- name: remove windows apps + ansible.windows.win_package: + product_id: "{{ remove_win_apps__product_id }}" + state: absent diff --git a/tasks/remove_apps_as_user.yml b/tasks/remove_apps_as_user.yml new file mode 100644 index 0000000..f84757a --- /dev/null +++ b/tasks/remove_apps_as_user.yml @@ -0,0 +1,8 @@ +--- +- name: remove windows apps as user + ansible.windows.win_package: + product_id: "{{ remove_win_apps__product_id }}" + state: absent + become_method: runas + become_user: "{{ item }}" + with_items: "{{ remove_win_apps__users }}"