ansible/test/integration/targets/win_shortcut/tasks/main.yml
Dag Wieers 3dbce15ccb win_shortcut: Add missing $check_mode definition + bugfix + tests (#20911)
* win_shortcut: Add missing $check_mode definition

For some reason this entry was missing, possible a merge-conflict gone
wrong :-(

* Added integration tests and bugfix

Add missing changes.
2017-02-02 10:29:56 +01:00

157 lines
No EOL
3.9 KiB
YAML

- name: Clean up Ansible website link
win_file:
path: '%UserProfile%\Desktop\Ansible website.url'
state: absent
- name: Add Ansible website link on the desktop
win_shortcut:
src: 'https://ansible.com/'
dest: '%UserProfile%\Desktop\Ansible website.url'
state: present
register: ansible_website_link_add
- name: Check there was a change
assert:
that:
- ansible_website_link_add.changed == true
- name: Add Ansible website link on the desktop again
win_shortcut:
src: 'https://ansible.com/'
dest: '%UserProfile%\Desktop\Ansible website.url'
state: present
register: ansible_website_link_add_again
- name: Check there was no change
assert:
that:
- ansible_website_link_add_again.changed == false
- name: Remove link
win_shortcut:
dest: '%UserProfile%\Desktop\Ansible website.url'
state: absent
register: ansible_website_link_remove
- name: Check there was a change
assert:
that:
- ansible_website_link_remove.changed == true
- name: Remove link again
win_shortcut:
dest: '%UserProfile%\Desktop\Ansible website.url'
state: absent
register: ansible_website_link_remove_again
- name: Check there was no change
assert:
that:
- ansible_website_link_remove_again.changed == false
- name: Clean up Registry Editor shortcut
win_file:
path: '%Public%\Desktop\Registry Editor.lnk'
state: absent
- name: Add a regedit shortcut on the desktop
win_shortcut:
description: "Registry Editor"
src: regedit.exe
dest: '%Public%\Desktop\Registry Editor.lnk'
state: present
register: regedit_shortcut_add
- name: Check there was a change
assert:
that:
- regedit_shortcut_add.changed == true
- name: Add a regedit shortcut on the desktop again
win_shortcut:
description: "Registry Editor"
src: regedit.exe
dest: '%Public%\Desktop\Registry Editor.lnk'
state: present
register: regedit_shortcut_add_again
- name: Check there was no change
assert:
that:
- regedit_shortcut_add_again.changed == false
- name: Update a regedit shortcut on the desktop
win_shortcut:
description: "Registry Editor"
src: C:\BogusPath\regedit.exe
dest: '%Public%\Desktop\Registry Editor.lnk'
state: present
register: regedit_shortcut_update
- name: Check there was a change
assert:
that:
- regedit_shortcut_update.changed == true
- name: Update a regedit shortcut on the desktop again
win_shortcut:
description: "Registry Editor"
src: C:\BogusPath\regedit.exe
dest: '%Public%\Desktop\Registry Editor.lnk'
state: present
register: regedit_shortcut_update_again
- name: Check there was no change
assert:
that:
- regedit_shortcut_update_again.changed == false
- name: Add an (explicit) icon
win_shortcut:
description: "Registry Editor"
src: C:\Windows\regedit.exe
dest: '%Public%\Desktop\Registry Editor.lnk'
icon: 'C:\Windows\regedit.exe,0'
state: present
register: regedit_shortcut_add_icon
- name: Check there was a change
assert:
that:
- regedit_shortcut_add_icon.changed == true
- name: Add an (explicit) icon again
win_shortcut:
description: "Registry Editor"
src: C:\Windows\regedit.exe
dest: '%Public%\Desktop\Registry Editor.lnk'
icon: 'C:\Windows\regedit.exe,0'
state: present
register: regedit_shortcut_add_icon_again
- name: Check there was no change
assert:
that:
- regedit_shortcut_add_icon_again.changed == false
- name: Remove shortcut
win_shortcut:
dest: '%Public%\Desktop\Registry Editor.lnk'
state: absent
register: regedit_shortcut_remove
- name: Check there was a change
assert:
that:
- regedit_shortcut_remove.changed == true
- name: Remove shortcut again
win_shortcut:
dest: '%Public%\Desktop\Registry Editor.lnk'
state: absent
register: regedit_shortcut_remove_again
- name: Check there was no change
assert:
that:
- regedit_shortcut_remove_again.changed == false