Reputation: 21
I tried to create a task in ansible playbook using win_powershell module but everytime I run the playbook, the task is hanging. Does anyone have a solution ? I`m pretty new to ansible.
Here is the yml file:
---
- name: notification
hosts: windows
become: false
gather_facts: false
tasks:
- name: message
ansible.windows.win_powershell:
script: |
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show('message')
Upvotes: 2
Views: 288
Reputation: 11
Perhaps one of the following modules might be more suitable than running a powershell command. You'd need to install the community modules for either of these.
The community.windows.win_msg module. Usage:
- name: Display message.
community.windows.win_msg:
msg: 'message'
Ansible also supports toast notifications via community.windows.win_toast module
Upvotes: 1