Hi were you ever able to figure this out? I am looking to do something similar but struggling with it as well. Can you share your updated code on how you actually went about getting just the DisplayName. Thank you
On Wednesday, April 18, 2018 at 6:51:04 PM UTC-4 [email protected] wrote: > I'd like to remove all the "Slack Machine-Wide Installer" packages. My > approach is listed below. I'm wondering if there's an easier way to do this? > > My approach. > > Trying to use Ansible to uninstall packages; with a twist. > > Control Panel shows this > > > <https://lh3.googleusercontent.com/-spATVpnfJng/WteyxCMQJzI/AAAAAAAAADs/lP2nEPG-9O0FFnsptEYsYWE3nexo8UP6wCLcBGAs/s1600/altium17_int_celadonsystems_com.png> > > Multiple versions of the Slack Machine-Wide Installer. Looking in the > registry I find this key (as well as the other guids for the Slack > Machine-Wide Installer): > > > HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{81805212-8267-41AE-8F1E-979055EC5DF2} > > > <https://lh3.googleusercontent.com/-5h3IGbqpdgQ/WtezOAkG4gI/AAAAAAAAADw/GJmw58FGVqYfJHd8HDX7SjlhJsiKRDMQQCLcBGAs/s1600/altium17_int_celadonsystems_com-2.png> > I'd like to walk the Uninstall registry key, searching the DisplayName for > "Slack Machine-Wide Installer" and remove that package. > > I can get the Uninstall registry using this task. > > - name: get uninstall registry key > win_reg_stat: > path: > HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall > register: uninstall_registry > > The uninstall_registry.sub_keys contains the list I would like to query > for the DisplayName, the below task lets me get the DisplayName of each key > > - name: get properties of uninstall registry key > win_reg_stat: > path: > HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{ > item }} > name: DisplayName > register: display_name > with_items: > - "{{ uninstall_registry.sub_keys }}" > > After this I kind of stuck. How do I get just the DisplayName? > > - debug: > msg: "{{ item }}" > with_items: > - "{{ display_name.results }}" > > Displays a lot more information then I need. How do I get just the > DisplayName? > > > > > > > > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f9d9de98-f4ce-4434-9a85-24e75d5bb3e8n%40googlegroups.com.
