# win\_package - missing product id error

**URL:** <https://forum.ansible.com/t/win-package-missing-product-id-error/22329>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [August 19, 2016, 7:12pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329 "2016-08-19T19:12:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anfield](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anfield](https://forum.ansible.com/u/Anfield)\
**Post date:** [August 19, 2016, 7:12pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329/1 "2016-08-19T19:12:32Z")

</div>

Trying to install notepad onto a windows 2012 server and getting an error “Missing required arguement: product\_id”

- Do I have to go lookup a product id for every .exe I want to install? Where do I get this?

-notepad.yml

> #install Notepad 6.9.2 from executable in shared drive
> 
> - hosts: all
> 
> gather\_facts: false
> 
> tasks:
> 
> - name: Install Notepad 6.9.2 Package
> 
> win\_package:
> 
> path: “[https://10.10.128.0/mnt/ansible/npp.6.9.2.Installer.exe](https://10.10.128.0/mnt/ansible/npp.6.9.2.Installer.exe)”
> 
> arguements: “/install /passive /norestart”

Log below -

[root@localhost group\_vars]# ansible-playbook notepad.yml -vvvv  
Using /etc/ansible/ansible.cfg as config file  
Loaded callback default of type stdout, v2.0

PLAYBOOK: notepad.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
1 plays in notepad.yml

PLAY [all] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Install Notepad 6.9.2 Package] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /etc/ansible/group\_vars/notepad.yml:5  
\<10.10.128.0\> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 10.10.128.0  
\<10.10.128.0\> EXEC Set-StrictMode -Version Latest  
(New-Item -Type Directory -Path $env:temp -Name “ansible-tmp-1471633257.79-18742 9094883462”).FullName | Write-Host -Separator ‘’;  
\<10.10.128.0\> PUT “/tmp/tmpFMnfbg” TO “C:\Users\Administrator\AppData\Local\Temp \ansible-tmp-1471633257.79-187429094883462\win\_package.ps1”  
\<10.10.128.0\> EXEC Set-StrictMode -Version Latest  
Try  
{  
& ‘C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1471633257.79-187429094 883462\win\_package.ps1’  
}  
Catch  
{  
$_obj = @{ failed = $true }  
If ($_.Exception.GetType)  
{  
$_obj.Add(‘msg’, $_.Exception.Message)  
}  
Else  
{  
$_obj.Add(‘msg’, $_.ToString())  
}  
If ($_.InvocationInfo.PositionMessage)  
{  
$obj.Add(‘exception’, $.InvocationInfo.PositionMessage)  
}  
ElseIf ($_.ScriptStackTrace)  
{  
$_obj.Add(‘exception’, $_.ScriptStackTrace)  
}  
Try  
{  
$_obj.Add(‘error\_record’, ($_ | ConvertTo-Json | ConvertFrom-Json))  
}  
Catch  
{  
}  
Echo $\_obj | ConvertTo-Json -Compress -Depth 99  
Exit 1  
}  
Finally { Remove-Item “C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-147 1633257.79-187429094883462” -Force -Recurse -ErrorAction SilentlyContinue }  
fatal: [10.10.128.0]: FAILED! =\> {“changed”: false, “failed”: true, “invocation” : {“module\_name”: “win\_package”}, “msg”: “Missing required argument: product\_id” }

NO MORE HOSTS LEFT \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
to retry, use: --limit @notepad.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
10.10.128.0 : ok=0 changed=0 unreachable=0 failed=1

---

<div class="post-metadata">

**Author:** ![Anfield](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anfield](https://forum.ansible.com/u/Anfield)\
**Post date:** [August 19, 2016, 7:41pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329/2 "2016-08-19T19:41:16Z")

</div>

Nevermind - I just added product\_id=“notepad” to get past this error

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [August 19, 2016, 9:16pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329/3 "2016-08-19T21:16:53Z")

</div>

You basically need the id, as that’s what gets checked for idempodency. So if you put in something wrong it will attempt to install on every run. You’ll find the correct key in the uninstall node in the registry.

---

<div class="post-metadata">

**Author:** ![Anfield](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anfield](https://forum.ansible.com/u/Anfield)\
**Post date:** [August 23, 2016, 2:09pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329/4 "2016-08-23T14:09:48Z")

</div>

so is there no way I can use a dummy id? Id have to install on another machine first and then find the product\_id?

---

<div class="post-metadata">

**Author:** ![Anfield](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anfield](https://forum.ansible.com/u/Anfield)\
**Post date:** [August 23, 2016, 2:34pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329/5 "2016-08-23T14:34:49Z")

</div>

Changed my playbook to the following but it seems like it stalls and doesnt provide an final error

#install Notepad 6.9.2 from specified repository

- hosts: all  
gather\_facts: false  
tasks:
- name: Install Notepad 6.9.2 Package  
win\_package:  
path: \IT00001352\Users\user\Documents\ANSIBLE\npp.6.9.2.Installer.exe  
product\_id: “Notepad 6.9.2”  
user\_name: “user”  
user\_password: “pass”  
arguements: “/install /passive /norestart”

It seems to stick at the following output for a long time. I can see from the target box that powershell.exe is running as is the notepad installer itself.

Is there something else I am missing in the above playbook?

Log output -

10.10.128.0\> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 10.10.128.0  
\<10.10.128.0\> EXEC Set-StrictMode -Version Latest  
(New-Item -Type Directory -Path $env:temp -Name “ansible-tmp-1471961958.88-29561 933562114”).FullName | Write-Host -Separator ‘’;  
\<10.10.128.0\> PUT “/tmp/tmpW4L0nP” TO “C:\Users\Administrator\AppData\Local\Temp \ansible-tmp-1471961958.88-29561933562114\win\_package.ps1”  
\<10.10.128.0\> EXEC Set-StrictMode -Version Latest  
Try  
{  
& ‘C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1471961958.88-295619335 62114\win\_package.ps1’  
}  
Catch  
{  
$_obj = @{ failed = $true }  
If ($_.Exception.GetType)  
{  
$_obj.Add(‘msg’, $_.Exception.Message)  
}  
Else  
{  
$_obj.Add(‘msg’, $_.ToString())  
}  
If ($_.InvocationInfo.PositionMessage)  
{  
$obj.Add(‘exception’, $.InvocationInfo.PositionMessage)  
}  
ElseIf ($_.ScriptStackTrace)  
{  
$_obj.Add(‘exception’, $_.ScriptStackTrace)  
}  
Try  
{  
$_obj.Add(‘error\_record’, ($_ | ConvertTo-Json | ConvertFrom-Json))  
}  
Catch  
{  
}  
Echo $\_obj | ConvertTo-Json -Compress -Depth 99  
Exit 1  
}  
Finally { Remove-Item “C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-147 1961958.88-29561933562114” -Force -Recurse -ErrorAction SilentlyContinue }

---

<div class="post-metadata">

**Author:** ![Anfield](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anfield](https://forum.ansible.com/u/Anfield)\
**Post date:** [August 23, 2016, 3:24pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329/6 "2016-08-23T15:24:45Z")

</div>

Also took the product id from the registry of my machine and tried that in the playbook also, same result

---

<div class="post-metadata">

**Author:** ![Anfield](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anfield](https://forum.ansible.com/u/Anfield)\
**Post date:** [August 23, 2016, 4:11pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329/7 "2016-08-23T16:11:55Z")

</div>

Any ideas anyone?

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [August 23, 2016, 7:04pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329/8 "2016-08-23T19:04:04Z")

</div>

Yes, I have hit this with notepad++. I think it hangs because a dialog is prompting the user for some input.

I think there's a chocolatey package for it, so probably the easiest way to get round it is to use chocolatey.

I think there's a zip file version as well if you don't mind scripting a bit more of the installation.

Otherwise I would suggest raising an issue with the notepad++ developers. Having a fully unattended installer is not an unreasonable thing to ask for and likely the devs could make use of such a thing in their testing.

Let us know how you get on.

Jon

---

<div class="post-metadata">

**Author:** ![don\_rumata](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@don\_rumata](https://forum.ansible.com/u/don_rumata)\
**Post date:** [August 25, 2017, 10:37pm UTC](https://forum.ansible.com/t/win-package-missing-product-id-error/22329/9 "2017-08-25T22:37:51Z")

</div>

[https://gist.github.com/don-rumata/f42134fd59e7c7630cbef31b05306552](https://gist.github.com/don-rumata/f42134fd59e7c7630cbef31b05306552)
