mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
8f9b885113
* replace duff commit version of win_toast * change expire_mins to expire_secs and add example showing use of async * fix metadata version to keep sanity --test validate-modules happy * code review fixes and change expire_secs to expire_seconds * add first pass integration tests for win_toast * win_toast no longer fails if there are no logged in users to notify (it sets a toast_sent false if this happens) * yaml lint clean up of setup.yml in win_toast integration tests * improve exception and stack trace if the notifier cannot be created, following feedback from dag * removed unwanted 'echo' input parameters from return vals; added to CHANGELOG.md, removed _seconds units from module params; updated tests to match
27 lines
619 B
YAML
27 lines
619 B
YAML
- name: Get OS version
|
|
win_shell: '[Environment]::OSVersion.Version.Major'
|
|
register: os_version
|
|
|
|
- name: Get logged in user count (using explorer exe as a proxy)
|
|
win_shell: (get-process -name explorer -EA silentlyContinue).Count
|
|
register: user_count
|
|
|
|
- name: debug os_version
|
|
debug:
|
|
var: os_version
|
|
verbosity: 2
|
|
|
|
- name: debug user_count
|
|
debug:
|
|
var: user_count
|
|
verbosity: 2
|
|
|
|
- name: Set fact if toast cannot be made
|
|
set_fact:
|
|
can_toast: False
|
|
when: os_version.stdout|int < 10
|
|
|
|
- name: Set fact if toast can be made
|
|
set_fact:
|
|
can_toast: True
|
|
when: os_version.stdout|int >= 10
|