[ansible-project] Re: win_package how can it know package has been installed when product_id is not specified

2022-12-22 Thread jbor...@gmail.com
If it's an msi, the module can scan the package itself to get the 
product_id. If it's an exe then it would need the product_id or one of the 
creates_* options to try and add some idempotency.

On Friday, December 23, 2022 at 12:24:04 PM UTC+10 pyyg...@gmail.com wrote:

> Hi everyone,
>
> About win_package, in the official document, it mentions: product_id value 
> is ignored if path is set to a local accesible file path and the package is 
> not an exe.
>
> So, if I want to install MSI package, and I specify the path to a local 
> accessible file path, then I don't need to set product_id, correct ? If I 
> don't set product_id, how it can know if the package has been installed?  
> by searching for the InstallSource in registry?
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3791a06f-d134-4cea-80e9-2835db1b237an%40googlegroups.com.


[ansible-project] Re: win_package

2019-09-10 Thread Manish Kumar
here is the playbook . Looks like silent feature is disabled  so is there 
any other option in ansible to install using argument just like how we do 
using gui.

---
- name: install  Server
  gather_facts: no
  hosts: win
  tasks:
- name: Install the  service
  win_package:
path: D:\Software_InstallationSets\Installset\SETUP.EXE
creates_path: D:\Product\SETUP.EXE
state: present
arguments: /S


On Monday, September 9, 2019 at 9:06:11 PM UTC+5:30, MKPhil wrote:
>
> Can you share your playbook so we can see the command you are running?
>
> On Monday, 9 September 2019 16:25:08 UTC+1, Manish Kumar wrote:
>>
>> Can Anyone help on this ?
>>
>> On Monday, September 9, 2019 at 4:59:02 PM UTC+5:30, Manish Kumar wrote:
>>>
>>> Dear All,
>>>
>>> I am getting a very weird result while using win_package,  It is 
>>> succeeding and no error is visible on ansible command prompt however the 
>>> package is not installed while checking manually .
>>>
>>> We are able to install notepad++ successfully  but other application 
>>> setup.exe  is having issue with no error .
>>>
>>> What could be the reason and how it can be resolved ?  Any help is much 
>>> appreciated .
>>>
>>> Thanks,
>>> Manish
>>>
>>>
>>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d54aa7f0-6d3b-469e-b527-85cbf8d9d870%40googlegroups.com.


[ansible-project] Re: win_package

2019-09-09 Thread MKPhil
Can you share your playbook so we can see the command you are running?

On Monday, 9 September 2019 16:25:08 UTC+1, Manish Kumar wrote:
>
> Can Anyone help on this ?
>
> On Monday, September 9, 2019 at 4:59:02 PM UTC+5:30, Manish Kumar wrote:
>>
>> Dear All,
>>
>> I am getting a very weird result while using win_package,  It is 
>> succeeding and no error is visible on ansible command prompt however the 
>> package is not installed while checking manually .
>>
>> We are able to install notepad++ successfully  but other application 
>> setup.exe  is having issue with no error .
>>
>> What could be the reason and how it can be resolved ?  Any help is much 
>> appreciated .
>>
>> Thanks,
>> Manish
>>
>>
>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/61439463-a4a8-4a82-9b16-6818168162cc%40googlegroups.com.


[ansible-project] Re: win_package

2019-09-09 Thread Manish Kumar
Can Anyone help on this ?

On Monday, September 9, 2019 at 4:59:02 PM UTC+5:30, Manish Kumar wrote:
>
> Dear All,
>
> I am getting a very weird result while using win_package,  It is 
> succeeding and no error is visible on ansible command prompt however the 
> package is not installed while checking manually .
>
> We are able to install notepad++ successfully  but other application 
> setup.exe  is having issue with no error .
>
> What could be the reason and how it can be resolved ?  Any help is much 
> appreciated .
>
> Thanks,
> Manish
>
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6a2f36ae-c54a-4795-9751-46bc38fea91d%40googlegroups.com.


[ansible-project] Re: win_package

2019-09-09 Thread Manish Kumar

>
> Dear All,
>
> I am getting a very weird result while using win_package,  It is 
> succeeding and no error is visible on ansible command prompt however the 
> package is not installed while checking manually .
>
> We are able to install notepad++ successfully  but other application 
> setup.exe  is having issue with no error .
>
> What could be the reason and how it can be resolved ?  Any help is much 
> appreciated .
>


Results:

TASK [Install the win service] 
***

task path: /U01/automation/playbooks/uninstal.yml:7

changed: [10.130.2.10] => {

"changed": true, 

"exit_code": 0, 

"failed": false, 

"rc": 0, 

"reboot_required": false, 

"restart_required": false

}

META: ran handlers

META: ran handlers

 

PLAY RECAP 
***

10.130.2.10   : ok=1changed=1unreachable=0failed=0  
 

>
> Thanks,
> Manish
>
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/04f3231b-2101-4d57-a5bf-2ed1f93f12e9%40googlegroups.com.


[ansible-project] Re: win_package

2018-09-16 Thread nippymodel
Hi Mate,

I am trying to install anti-virus software on bunch of windows machines 
using win_package module, and it works fine, however i am unable to supply 
license key, could you please help me with argument i should use?

  - name: Install Cylance from Network Share
hosts: all
gather_facts: true
tasks:
  - name: Install Cylance
win_package:
  path: \\ABC\Users\ruser\Desktop\script\CylanceProtect_x64.msi
  #state: present
  arguments: /install /passive /qn PIDKEY=*AGIFuIiQ98Kg0LWWbFJ2E* 
/quiet 
/norestart --?
  user_name: LAB.LOCAL\muser
  user_password: P@ssw0rd


On Wednesday, 11 April 2018 12:43:12 UTC-4, lpesc...@google.com wrote:
>
> Hi Bill, 
> Try this:
>
>   become: yes
>
>   become_method: runas
>
>   become_user: SYSTEM
>
> On Wednesday, April 11, 2018 at 9:24:28 AM UTC-7, William Dossett wrote:
>>
>> Hi,
>>
>> Fairly new to Ansible, but  I am just finishing a fairly extensive course 
>> on Linux Academy.  I have some good use cases... the first one is 
>> configuring windows VMs to have a number of packages installed 
>> automatically.  Currently I can uninstall old versions of java and install 
>> the most current version of java on a number of VMs.
>>
>> I have a problem with the install thought that I can't seem to put my 
>> finger on, but have reproduced several times now specifically on windows 
>> 2016 servers and possibly on windows 2012.
>>
>> These VMs are automatically put on the domain when they are provisioned.  
>> We are an engineering shop and we add all domain users to the local 
>> administrator group as any engineer can logon to any VM as administrator.  
>> These are engineering clusters only.
>>
>> I have configured Kerberos and it works fine in general, however when I 
>> try to use win_package to install from a network share I have problems.
>>
>>
>>  - name: Install Java from network share
>> win_package:
>>  path: \\fileserver.mycorp.local\share\java\JavaSetup8u161.exe
>>  product_id: '{26A24AE4-039D-4CA4-87B4-2F32180161F0}'
>>  state: present
>>  arguments: /s
>>  user_name: MYCORP\myuser
>>  user_password: secretpassword
>>
>> it fails with permissions
>>
>> "failed to connect network drive with credentials: Access is denied"
>>
>> I am a member of domain admins, and administrators... I can logon to 
>> these systems and execute the package from PS console and it works fine, 
>> but not using win_package
>>
>> If I change the user from myuser to administrator, then it works.  It 
>> seems like this is to do with ansible as I can execute it from console as 
>> me fine, but if anyone has any advice on what the problem might be, I would 
>> sure appreciate it as this is kind of stumbling block to move on to a full 
>> configuration that I am trying to achieve.
>>
>> Thanks
>> Bill
>>
>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dc9ee988-eaa7-42e2-8614-e6594b6263b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package

2018-04-11 Thread lpescatore via Ansible Project
Hi Bill, 
Try this:

  become: yes

  become_method: runas

  become_user: SYSTEM

On Wednesday, April 11, 2018 at 9:24:28 AM UTC-7, William Dossett wrote:
>
> Hi,
>
> Fairly new to Ansible, but  I am just finishing a fairly extensive course 
> on Linux Academy.  I have some good use cases... the first one is 
> configuring windows VMs to have a number of packages installed 
> automatically.  Currently I can uninstall old versions of java and install 
> the most current version of java on a number of VMs.
>
> I have a problem with the install thought that I can't seem to put my 
> finger on, but have reproduced several times now specifically on windows 
> 2016 servers and possibly on windows 2012.
>
> These VMs are automatically put on the domain when they are provisioned.  
> We are an engineering shop and we add all domain users to the local 
> administrator group as any engineer can logon to any VM as administrator.  
> These are engineering clusters only.
>
> I have configured Kerberos and it works fine in general, however when I 
> try to use win_package to install from a network share I have problems.
>
>
>  - name: Install Java from network share
> win_package:
>  path: \\fileserver.mycorp.local\share\java\JavaSetup8u161.exe
>  product_id: '{26A24AE4-039D-4CA4-87B4-2F32180161F0}'
>  state: present
>  arguments: /s
>  user_name: MYCORP\myuser
>  user_password: secretpassword
>
> it fails with permissions
>
> "failed to connect network drive with credentials: Access is denied"
>
> I am a member of domain admins, and administrators... I can logon to these 
> systems and execute the package from PS console and it works fine, but not 
> using win_package
>
> If I change the user from myuser to administrator, then it works.  It 
> seems like this is to do with ansible as I can execute it from console as 
> me fine, but if anyone has any advice on what the problem might be, I would 
> sure appreciate it as this is kind of stumbling block to move on to a full 
> configuration that I am trying to achieve.
>
> Thanks
> Bill
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8d4fdc38-b6c7-4060-8429-031c7a32fbe4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package with no path in 2.3.2

2017-09-10 Thread Jordan Borean
Hi

The win_package module was overhauled in 2.4 and it now allows you to 
uninstall a package when you just specify the product id. In the end you 
should be able to run just

- win_package:
> product_id: '{7D7C80AF-58D6-4C3F-912B-8B5B4D50A71B}'
> state: absent


This works the way you describe, when you don't specify a path it tries to 
find the UninstallString in that key. If it exists it should just run 
msiexec.exe /x {7D7C80AF-58D6-4C3F-912B-8B5B4D50A71B} /qn /norestart. You 
can always add the newer version of the module but putting it in your 
ANSIBLE_LIBRARY path. The URL for the newest version 
is 
https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/windows/win_package.ps1,
 
otherwise you can just check out the latest devel version and try it from 
there.

Thanks

Jordan

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cfbc33fb-1bfc-4843-a54f-2fe47d256bcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package - missing product id error

2017-08-25 Thread don_rumata
https://gist.github.com/don-rumata/f42134fd59e7c7630cbef31b05306552

вторник, 23 августа 2016 г., 19:11:55 UTC+3 пользователь Anfield написал:
>
> Any ideas anyone?
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c2b1afe1-2196-4f4c-ab91-9e2893a81199%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package unable to install .exe Chart Director

2017-08-14 Thread 'J Hawkesworth' via Ansible Project
If they used nsis to package try /sd

I think it is reasonable to ask the vendor to provide a silent installation 
option too.  Point out that it is in their interest too - if you can 
automate installation, then doing automated testing against all supported 
versions of an operating system is easier.

Hope this helps,

Jon

On Thursday, August 10, 2017 at 4:44:49 PM UTC+1, daniya...@arctiq.ca wrote:
>
> Turns out the application I am trying to install does not have any silent 
> options. Returns nothing when executed with .\setup-4.0.exe /? or 
> .\setup-4.0.exe /h /help
>
> On Thursday, August 3, 2017 at 9:37:35 PM UTC-4, Jordan Borean wrote:
>>
>> You would need to find out what the install arguments for a silent 
>> install are. I believe InstallShield uses '-s' but you would need to 
>> determine if that is the case with this particular ex. Once you have found 
>> out what the silent argument is add it to your task like so
>>
>> - name: install
>>   win_package:
>> name: install chartdir
>> path: C:\Windows\setup_4.0.exe
>> product_id: '{00065AC0-1AEC-4AB2-B5C3-79FBB228A9A1}'
>> arguments: '-s'
>> state: present
>>
>>
>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e99b94b6-36ea-4519-8d0c-133c0cbf0e45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package unable to install .exe Chart Director

2017-08-13 Thread Trond Hindenes
In that case you'd have to repackage it using a msi tool or something.

On Thursday, August 10, 2017 at 5:44:49 PM UTC+2, daniya...@arctiq.ca wrote:
>
> Turns out the application I am trying to install does not have any silent 
> options. Returns nothing when executed with .\setup-4.0.exe /? or 
> .\setup-4.0.exe /h /help
>
> On Thursday, August 3, 2017 at 9:37:35 PM UTC-4, Jordan Borean wrote:
>>
>> You would need to find out what the install arguments for a silent 
>> install are. I believe InstallShield uses '-s' but you would need to 
>> determine if that is the case with this particular ex. Once you have found 
>> out what the silent argument is add it to your task like so
>>
>> - name: install
>>   win_package:
>> name: install chartdir
>> path: C:\Windows\setup_4.0.exe
>> product_id: '{00065AC0-1AEC-4AB2-B5C3-79FBB228A9A1}'
>> arguments: '-s'
>> state: present
>>
>>
>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4ef4489d-2e6f-415c-a6e4-1a98cb4500f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package unable to install .exe Chart Director

2017-08-10 Thread daniyal . javed
Turns out the application I am trying to install does not have any silent 
options. Returns nothing when executed with .\setup-4.0.exe /? or 
.\setup-4.0.exe /h /help

On Thursday, August 3, 2017 at 9:37:35 PM UTC-4, Jordan Borean wrote:
>
> You would need to find out what the install arguments for a silent install 
> are. I believe InstallShield uses '-s' but you would need to determine if 
> that is the case with this particular ex. Once you have found out what the 
> silent argument is add it to your task like so
>
> - name: install
>   win_package:
> name: install chartdir
> path: C:\Windows\setup_4.0.exe
> product_id: '{00065AC0-1AEC-4AB2-B5C3-79FBB228A9A1}'
> arguments: '-s'
> state: present
>
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c9e809bd-c4c2-47b0-bc70-7a174a25489e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package unable to install .exe Chart Director

2017-08-03 Thread Jordan Borean
You would need to find out what the install arguments for a silent install 
are. I believe InstallShield uses '-s' but you would need to determine if 
that is the case with this particular ex. Once you have found out what the 
silent argument is add it to your task like so

- name: install
  win_package:
name: install chartdir
path: C:\Windows\setup_4.0.exe
product_id: '{00065AC0-1AEC-4AB2-B5C3-79FBB228A9A1}'
arguments: '-s'
state: present


-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7e19b43e-3040-4e1e-b733-a70c54123c78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package - missing product id error

2016-08-23 Thread 'J Hawkesworth' via Ansible Project
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 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d971b35f-e6b2-40d7-aa92-96d6e8d2a130%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package - missing product id error

2016-08-23 Thread Anfield
Any ideas anyone?

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9644240f-40f2-4480-94bc-df817d42be30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package - missing product id error

2016-08-23 Thread Anfield
Also took the product id from the registry of my machine and tried that in 
the playbook also, same result

>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4e21a78f-e368-436f-8d78-934f9b93d43e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package - missing product id error

2016-08-23 Thread Anfield
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: 
\\IT1352\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 }

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/97c52412-39f8-48c3-94c7-af96cb0a0134%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package - missing product id error

2016-08-23 Thread Anfield
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?

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/51cffab3-6bba-4928-8551-40e8c195cfa0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package - missing product id error

2016-08-19 Thread Trond Hindenes
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.

On Friday, August 19, 2016 at 9:41:17 PM UTC+2, Anfield wrote:
>
> Nevermind - I just added product_id="notepad" to get past this error
>
>
>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/76133ef5-96e6-45cb-aa8e-f64e173f621b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package - missing product id error

2016-08-19 Thread Anfield
Nevermind - I just added product_id="notepad" to get past this error


>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d9d3bf5b-de06-43f5-8c0a-ad227669a070%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package uninstall example?

2016-06-14 Thread Matt Davis
Ansible's a pretty thin wrapper around the platform capabilities- 
installing/uninstalling software on Windows is tricky, as every installer 
is a special snowflake, and many assume that there's a user sitting there 
to answer dialogs.

That said, I know Sliverlight fully supports unattended install/uninstall- 
have a look at 
http://download.microsoft.com/download/7/8/d/78da8ec9-8801-42e5-89e5-3809386f1316/Silverlight%20Deployment%20Guide.doc

I suspect the switch you're looking for is "/qu" (silent uninstall).


On Tuesday, June 14, 2016 at 3:58:07 AM UTC-7, Trond Hindenes wrote:
>
> Disabling UAC will have no effect. Any session coming in thru WinRM is by 
> default elevated.
>
> As Jon writes, some packages are simply difficult/super-hard/impossible to 
> uninstall in an unattended way. 
>
> On Saturday, June 11, 2016 at 9:21:21 PM UTC+2, Bob Tanner wrote:
>>
>> Uninstalling Windows packages via Ansible is hard.  Is this normal? I 
>> feeling like I'm missing something fundamental using Ansible to manage 
>> Windows.
>>
>> Here's my playbook.
>>
>> - name: disable UAC pop up for Administrators
>>win_regedit:
>> key: HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System
>> value: ConsentPromptBehaviorAdmin
>> data: 
>> datatype: dword
>>
>> - name: remove packages (win_package)
>>   win_package: >
>> name="Microsoft Silverlight"
>> path="C:\\Program Files\\Microsoft Silverlight\\sllauncher.exe"
>> product_id="{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}"
>> state="absent"
>>
>> The task hangs and eventually timeout.  Started to get desperate and 
>> added these plays:
>>
>>   - name: disallow interactive services
>> win_regedit:
>> key: HKLM:\SYSTEM\CurrentControlSet\Control\Windows
>> value: NoInteractiveServices
>> data: 0001
>> datatype: dword
>>
>>   - name: stop Interactive Services Detection
>> win_service:
>> name: 'UI0Detect'
>> start_mode: manual
>> state: stopped
>>
>> Still the uninstall hangs and times out.
>>
>> When I try uninstalling Silverlight via:
>>
>> msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l 
>> C:\logs\zzz.log
>>
>> I get the "Windows Installer" dialog prompting to confirm the uninstall. 
>> Click "Yes" and Silverlight is uninstalled. Nothing of much value in the 
>> C:\logs\zzz.log file.
>>
>> msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l 
>> C:\logs\zzz.log \quiet
>>
>> Uninstalls without any dialog. Nothing of much value in the logs.
>>
>> How do I duplicate this uninstall with win_package?
>>
>> I cannot seem to get win_msi to work either. 
>>
>> I am brute forcing things with script :-(
>>
>> - name: remove packages (powershell script)
>>   script: files/remove-package.ps1
>>
>> remote-package.ps1
>>
>> $app = Get-WmiObject -Class Win32_Product -Filter "IdentifyingNumber = 
>> '{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}'"
>> $app.Uninstall()
>>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0c213394-1d1d-4a89-86c3-d06a5706f5e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package uninstall example?

2016-06-14 Thread Trond Hindenes
Disabling UAC will have no effect. Any session coming in thru WinRM is by 
default elevated.

As Jon writes, some packages are simply difficult/super-hard/impossible to 
uninstall in an unattended way. 

On Saturday, June 11, 2016 at 9:21:21 PM UTC+2, Bob Tanner wrote:
>
> Uninstalling Windows packages via Ansible is hard.  Is this normal? I 
> feeling like I'm missing something fundamental using Ansible to manage 
> Windows.
>
> Here's my playbook.
>
> - name: disable UAC pop up for Administrators
>win_regedit:
> key: HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System
> value: ConsentPromptBehaviorAdmin
> data: 
> datatype: dword
>
> - name: remove packages (win_package)
>   win_package: >
> name="Microsoft Silverlight"
> path="C:\\Program Files\\Microsoft Silverlight\\sllauncher.exe"
> product_id="{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}"
> state="absent"
>
> The task hangs and eventually timeout.  Started to get desperate and added 
> these plays:
>
>   - name: disallow interactive services
> win_regedit:
> key: HKLM:\SYSTEM\CurrentControlSet\Control\Windows
> value: NoInteractiveServices
> data: 0001
> datatype: dword
>
>   - name: stop Interactive Services Detection
> win_service:
> name: 'UI0Detect'
> start_mode: manual
> state: stopped
>
> Still the uninstall hangs and times out.
>
> When I try uninstalling Silverlight via:
>
> msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l 
> C:\logs\zzz.log
>
> I get the "Windows Installer" dialog prompting to confirm the uninstall. 
> Click "Yes" and Silverlight is uninstalled. Nothing of much value in the 
> C:\logs\zzz.log file.
>
> msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l 
> C:\logs\zzz.log \quiet
>
> Uninstalls without any dialog. Nothing of much value in the logs.
>
> How do I duplicate this uninstall with win_package?
>
> I cannot seem to get win_msi to work either. 
>
> I am brute forcing things with script :-(
>
> - name: remove packages (powershell script)
>   script: files/remove-package.ps1
>
> remote-package.ps1
>
> $app = Get-WmiObject -Class Win32_Product -Filter "IdentifyingNumber = 
> '{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}'"
> $app.Uninstall()
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5305be3f-804f-4d0c-b0e5-92e1bce7a2b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package uninstall example?

2016-06-13 Thread 'J Hawkesworth' via Ansible Project
Hi,

Although I've not tried uninstalling silverlight, I've certainly found some 
other things to be as difficult to uninstall as you seem to be above.
A lot of installers seem to have the assumption that there will be someone 
sitting there at a GUI answering questions.
I wound up using a brute force script to remove a particular version of 
java a little while back - the uninstallation just refused to work in a 
fully unattended manner (something that seems to have been fixed with the 
java 8 versions I've hit so far).

Generally though, unless its something very simple, newer stuff seems to be 
better at being installed and uninstalled in a fully unattended manner.  
Its definitely worth poking suppliers about this too - fully automated 
install and uninstall is good for them to as they can automate their 
testing better after all.

You asked about interactive services.  I may have explained better during 
my talk - the audio is available here - 
https://www.ansible.com/ansible-2-windows - however the short version is 
long ago it was perfectly possible to write windows services which also 
interacted with the user via the system tray and by display forms.  Such 
interactive services ran on the first gui session that was started, known 
as the console session but this caused security vulnerabilities.  Its 
probably much better explained here: 
https://en.wikipedia.org/wiki/Shatter_attack - but more recent versions of 
windows have isolated the session which services run in from the sessions 
that ordinary interactive users log into, hence the need for Interactive 
Service Detection and the need to switch between the console session and 
user session so you can see the GUI of interactive services.  The most 
recent versions of windows default to not allowing Interactive Services 
(presumably the thinking is that enough time has passed now for apps to 
have been re-written so that the GUI components exist in a separate user 
space program which communicates with the service via the service message 
api).

Jon




On Saturday, June 11, 2016 at 8:21:21 PM UTC+1, Bob Tanner wrote:
>
> Uninstalling Windows packages via Ansible is hard.  Is this normal? I 
> feeling like I'm missing something fundamental using Ansible to manage 
> Windows.
>
> Here's my playbook.
>
> - name: disable UAC pop up for Administrators
>win_regedit:
> key: HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System
> value: ConsentPromptBehaviorAdmin
> data: 
> datatype: dword
>
> - name: remove packages (win_package)
>   win_package: >
> name="Microsoft Silverlight"
> path="C:\\Program Files\\Microsoft Silverlight\\sllauncher.exe"
> product_id="{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}"
> state="absent"
>
> The task hangs and eventually timeout.  Started to get desperate and added 
> these plays:
>
>   - name: disallow interactive services
> win_regedit:
> key: HKLM:\SYSTEM\CurrentControlSet\Control\Windows
> value: NoInteractiveServices
> data: 0001
> datatype: dword
>
>   - name: stop Interactive Services Detection
> win_service:
> name: 'UI0Detect'
> start_mode: manual
> state: stopped
>
> Still the uninstall hangs and times out.
>
> When I try uninstalling Silverlight via:
>
> msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l 
> C:\logs\zzz.log
>
> I get the "Windows Installer" dialog prompting to confirm the uninstall. 
> Click "Yes" and Silverlight is uninstalled. Nothing of much value in the 
> C:\logs\zzz.log file.
>
> msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l 
> C:\logs\zzz.log \quiet
>
> Uninstalls without any dialog. Nothing of much value in the logs.
>
> How do I duplicate this uninstall with win_package?
>
> I cannot seem to get win_msi to work either. 
>
> I am brute forcing things with script :-(
>
> - name: remove packages (powershell script)
>   script: files/remove-package.ps1
>
> remote-package.ps1
>
> $app = Get-WmiObject -Class Win32_Product -Filter "IdentifyingNumber = 
> '{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}'"
> $app.Uninstall()
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cf554a88-b970-4d9d-b322-eb828f1d9a0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package uninstall example?

2016-06-11 Thread Bob Tanner
Uninstalling Windows packages via Ansible is hard.  Is this normal? I 
feeling like I'm missing something fundamental using Ansible to manage 
Windows.

Here's my playbook.

- name: disable UAC pop up for Administrators
   win_regedit:
key: HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System
value: ConsentPromptBehaviorAdmin
data: 
datatype: dword

- name: remove packages (win_package)
  win_package: >
name="Microsoft Silverlight"
path="C:\\Program Files\\Microsoft Silverlight\\sllauncher.exe"
product_id="{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}"
state="absent"

The task hangs and eventually timeout.  Started to get desperate and added 
these plays:

  - name: disallow interactive services
win_regedit:
key: HKLM:\SYSTEM\CurrentControlSet\Control\Windows
value: NoInteractiveServices
data: 0001
datatype: dword

  - name: stop Interactive Services Detection
win_service:
name: 'UI0Detect'
start_mode: manual
state: stopped

Still the uninstall hangs and times out.

When I try uninstalling Silverlight via:

msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l 
C:\logs\zzz.log

I get the "Windows Installer" dialog prompting to confirm the uninstall. 
Click "Yes" and Silverlight is uninstalled. Nothing of much value in the 
C:\logs\zzz.log file.

msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l 
C:\logs\zzz.log \quiet

Uninstalls without any dialog. Nothing of much value in the logs.

How do I duplicate this uninstall with win_package?

I cannot seem to get win_msi to work either. 

I am brute forcing things with script :-(

- name: remove packages (powershell script)
  script: files/remove-package.ps1

remote-package.ps1

$app = Get-WmiObject -Class Win32_Product -Filter "IdentifyingNumber = 
'{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}'"
$app.Uninstall()

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/088cbe8e-4d00-4958-8663-cfe4f67bf19d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package uninstall example?

2016-06-10 Thread 'J Hawkesworth' via Ansible Project
My guess would be the (un)installer is hanging as its asking the user for 
info, which won't ever get supplied because there's no gui and eventually 
you hit a timeout or one of the winrm quota limits

You could try using raw to run msiexec with switches to write to a log file 
and see what info there is in the logs.

Also depending on the user you are running as, you may not have permissions 
to make changes to C:\Program Files\ - its more locked down in later 
versions of windows that it used to be long ago.  This may not apply if you 
are running as administrator, but you might need to turn off UAC prompting 
for Administrators, which you can do by tweaking the registry:

HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System 
set 
ConsentPromptBehaviorAdmin 
to 0 to turn off and 5 to turn back on again (at least on s2012 R2)

Don't know if you have seen this but I put some tips for installing stuff 
on windows in my AnsibleFest London presentation which is available here: 
http://www.slideshare.net/jhawkesworth/ansible-20-windows-and-no-powershell-this-year-i-promise-ansiblefest-london-2016

Hope this helps,

Jon

On Friday, June 10, 2016 at 2:36:18 AM UTC+1, Bob Tanner wrote:
>
> And finally after 281m
>
>
> Finally { Remove-Item 
> "C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1465501508.58-107879928529086"
>  
> -Force -Recurse -ErrorAction SilentlyContinue }
>
>
>
> Traceback (most recent call last):
>   File 
> "/Users/tanner/projects/ansible.git/ansible/lib/ansible/plugins/connection/winrm.py",
>  
> line 271, in exec_command
> result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True)
>   File 
> "/Users/tanner/projects/ansible.git/ansible/lib/ansible/plugins/connection/winrm.py",
>  
> line 217, in _winrm_exec
> response = Response(self.protocol.get_command_output(self.shell_id, 
> command_id))
>   File 
> "/Users/tanner/projects/ansible.git/lib/python2.7/site-packages/winrm/protocol.py",
>  
> line 333, in get_command_output
> self._raw_get_command_output(shell_id, command_id)
>   File 
> "/Users/tanner/projects/ansible.git/lib/python2.7/site-packages/winrm/protocol.py",
>  
> line 352, in _raw_get_command_output
> res = self.send_message(xmltodict.unparse(req))
>   File 
> "/Users/tanner/projects/ansible.git/lib/python2.7/site-packages/winrm/protocol.py",
>  
> line 207, in send_message
> return self.transport.send_message(message)
>   File 
> "/Users/tanner/projects/ansible.git/lib/python2.7/site-packages/winrm/transport.py",
>  
> line 173, in send_message
> response = self.session.send(prepared_request, 
> timeout=self.read_timeout_sec)
>   File 
> "/Users/tanner/projects/ansible.git/lib/python2.7/site-packages/requests/sessions.py",
>  
> line 585, in send
> r = adapter.send(request, **kwargs)
>   File 
> "/Users/tanner/projects/ansible.git/lib/python2.7/site-packages/requests/adapters.py",
>  
> line 479, in send
> raise ReadTimeout(e, request=request)
> ReadTimeout: HTTPSConnectionPool(host='10.77.86.83', port=5986): Read 
> timed out. (read timeout=30)
> fatal: [win7-90day]: UNREACHABLE! => {"changed": false, "msg": "failed to 
> exec cmd PowerShell -NoProfile -NonInteractive -ExecutionPolicy 
> Unrestricted -EncodedCommand 
> 

[ansible-project] Re: win_package uninstall example?

2016-06-09 Thread Bob Tanner
Thank you for the example. 

I'm testing win_package to remove Silverlight and after 15 minutes of 
waiting Ansible has not returned.

Here is the task I'm using.

- name: remove packages (win_package)
  win_package: >
name="Microsoft Silverlight"
path="C:\\Program Files\\Microsoft Silverlight\\sllauncher.exe"
product_id="{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}"
state="absent"

Here is the relevant (-) output

TASK [windows-workstations : remove packages (win_package)] 

task path: 
/Users/tanner/projects/ansible.git/playbooks.git/roles/windows-workstations/tasks/main.yml:86
Using module file 
/Users/tanner/projects/ansible.git/ansible/lib/ansible/modules/extras/windows/win_package.ps1
<10.X.X.X> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 
TO 10.X.X.X
<10.X.X.X> EXEC Set-StrictMode -Version Latest
(New-Item -Type Directory -Path $env:temp -Name 
"ansible-tmp-1465501508.58-107879928529086").FullName | Write-Host 
-Separator '';
<10.X.X.X> PUT "/var/folders/y_/w_pbl7355vg3gv5xkmsld49mgn/T/tmpHf7TfN" 
TO 
"C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1465501508.58-107879928529086\win_package.ps1"
<10.X.X.X> EXEC Set-StrictMode -Version Latest
Try
{
& 
'C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1465501508.58-107879928529086\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-1465501508.58-107879928529086"
 
-Force -Recurse -ErrorAction SilentlyContinue }

What can I do to troubleshoot this further?

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c1d098ab-9066-4c12-9319-3eb8bf4c7b4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package uninstall example?

2016-06-09 Thread 'J Hawkesworth' via Ansible Project
Yes adding

state: absent 

will uninstall the package.  Something like this:

- name: remove java 8 if present
  win_package:
name: "Java SE Development Kit 8 Update 73 (64-bit)"
path: "c:\\packages\\jdk-8u73-windows-x64.exe"
product_id: '{64A3A4F4-B792-11D6-A78A-00B0D0180730}'
state: absent
arguments: /s /L C:\logs\java8jdk-removal.log


On Wednesday, June 8, 2016 at 10:58:24 PM UTC+1, Bob Tanner wrote:
>
> I'm trying to figure out how to use win_package to uninstall software. The 
> state="absent" would do an uninstall?
>
> It would seem this module can be used only for package installation?
>
>
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/bc994fad-2f34-49b6-9430-f7dfb09469f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package product_id

2016-02-23 Thread Gerald Spencer
It is: 

Python 3.5 64bit
https://www.continuum.io/downloads

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b4f2f197-e1a5-4859-bca8-211e053506ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package product_id

2016-02-23 Thread Trond Hindenes
Is this a package which is publicly available? I'd like to have a closer 
look.

On Friday, February 19, 2016 at 10:10:05 AM UTC+1, Gerald Spencer wrote:
>
> Interesting. So following your advice, the value in 
> HKLM:\Software\microsoft\windows\currentversion\uninstall is Python 3.5*.1 
> (Anaconda3 2.5.0 64-bit)  *and lets say we run:
>
> - name: install conda
>   win_package:
> path: '.\\Desktop\\CondaInstall.exe'
> product_id: 'Python 3.5.1 (Anaconda3 2.5.0 64-bit)'
> arguments: "/S /D=..\\Anaconda3"
>
> When the package is already installed, the task executes as expected and 
> reports no change in state.
> When the package is *not* installed, one would expect for the package to 
> be installed. Instead, the module fails and reports the 
> $LocalizedData.PostValidationError 
>
>- Package from {0} was installed, but the specified ProductId and/or 
>Name does not match package details
>
> It seems to be failing somewhere around Line 925 
> in
>  
> win_package with the Get-ProductEntry in the Set-TargetResource function. 
> The odd thing is, when I pull out Validate-StandardArguments and 
> Get-ProductEntry functions, they act as expected. i.e.
>
>- Validate-StandardArguments ensures that the path exists, reports 
>that the product_id is not a guid 
>
> 
>  
>and sets the $identifyingNumber to the product_id.
>- Get-ProductEntry then takes the parsed $identifyingNumber form 
>Validate-StandardArguments and returns the $keyLocation for the product_id 
>(either 32bit or 64bit uninstall registry keys)
>- Set-TargetResource then tests the resource, notices that the installer 
>is an exe 
>
> 
>  
>and starts the process as requested by the supplied arguments. After 
>install the function should then check if the $Ensure state is set to 
>'Present' (default condition), then it checks to see if the value returned 
>from Get-ProductEntry exists (program was installed.
>
> Unfortunately, it fails to install the exe. I did notice that the process 
> briefly appears in the task manager, then immediately following the failure 
> notice from ansible, drops away. Perhaps the process fails 
> 
>  
> to correctly start with the correct arguments?
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6c00962c-2e84-41b4-a64f-69e72bbdb919%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package product_id

2016-02-19 Thread Gerald Spencer
Interesting. So following your advice, the value in 
HKLM:\Software\microsoft\windows\currentversion\uninstall is Python 3.5*.1 
(Anaconda3 2.5.0 64-bit)  *and lets say we run:

- name: install conda
  win_package:
path: '.\\Desktop\\CondaInstall.exe'
product_id: 'Python 3.5.1 (Anaconda3 2.5.0 64-bit)'
arguments: "/S /D=..\\Anaconda3"

When the package is already installed, the task executes as expected and 
reports no change in state.
When the package is *not* installed, one would expect for the package to be 
installed. Instead, the module fails and reports the 
$LocalizedData.PostValidationError 

   - Package from {0} was installed, but the specified ProductId and/or 
   Name does not match package details
   
It seems to be failing somewhere around Line 925 
in
 
win_package with the Get-ProductEntry in the Set-TargetResource function. 
The odd thing is, when I pull out Validate-StandardArguments and 
Get-ProductEntry functions, they act as expected. i.e.

   - Validate-StandardArguments ensures that the path exists, reports that 
   the product_id is not a guid 
   

 
   and sets the $identifyingNumber to the product_id.
   - Get-ProductEntry then takes the parsed $identifyingNumber form 
   Validate-StandardArguments and returns the $keyLocation for the product_id 
   (either 32bit or 64bit uninstall registry keys)
   - Set-TargetResource then tests the resource, notices that the installer 
   is an exe 
   

 
   and starts the process as requested by the supplied arguments. After 
   install the function should then check if the $Ensure state is set to 
   'Present' (default condition), then it checks to see if the value returned 
   from Get-ProductEntry exists (program was installed.

Unfortunately, it fails to install the exe. I did notice that the process 
briefly appears in the task manager, then immediately following the failure 
notice from ansible, drops away. Perhaps the process fails 

 
to correctly start with the correct arguments?

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8da45749-34f8-4bc3-8db8-6b574d66772b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package arguments format

2016-02-18 Thread Trond Hindenes
I probably misunderstood. You run the installer manually once to generate 
the iss file right? And then on subsequent installs you can reference the 
iss to have a unattended installation?

In any case, the following should probably also work:
 arguments: "-s -f1 setup.iss"

My point is simply that although you tell PowerShell about files in the 
current dir by using dot-slash notation (.\file.iss) that's not meaning you 
should use the same format when telling setup.exe about the same file's 
direction. PowerShell will just send whatever arguments you supply to the 
installer, which is why dot-slash won't work.

Glad you got it working.

On Thursday, February 18, 2016 at 12:42:16 AM UTC+1, Gerald Spencer wrote:
>
> Interestingly enough, the absolute path with forward slashes did the 
> trick. The normal setup isn't created, but everything appears to be working 
> as it should. Thanks!
>
> On Wednesday, February 17, 2016 at 9:51:50 AM UTC-8, Gerald Spencer wrote:
>>
>> When the appropriate command line format for the reference file is 
>> supplied, the installer creates a setup.txt in the installers directory 
>> with various other information. Unfortunately, using the an absolute path 
>> with forward or back slashes does not appear to work for the ansible 
>> arguments as no setup.txt is created.
>>
>>  
>> On Wednesday, February 17, 2016 at 9:40:58 AM UTC-8, Trond Hindenes wrote:
>>>
>>> Your pathing for "setup.iss" is probably wrong. PowerShell takes a 
>>> "dot-backslash" approach when using the shell interactively, but that 
>>> doesn't mean you should do the same when supplying absolute/relative paths 
>>> to the ansible module. Also, PowerShell supports forward slashes, so feel 
>>> free to use them instead, so you don't have to escape them.
>>>
>>> I would assume you would use something like:
>>>
>>> - name: install software
>>>   win_package:
>>> path: "C:/Users/UserName/Desktop/Software/setup.exe"
>>> product_id: {guid}
>>> arguments: '-s -f1 "C:/Users/UserName/Desktop/Software/setup.iss" ' 
>>> (i added a space between the last double-quote and single-quote just for 
>>> clarification. Should probably be removed in prod)
>>>
>>>
>>> On Wednesday, February 17, 2016 at 6:35:17 PM UTC+1, Gerald Spencer 
>>> wrote:

 After further poking around after the win_package is parsed out to the 
 windows machine. Every backslash that is entered into the arguments is 
 doubled for the $complex_args variable in the powershell script that is 
 ran 
 on the windows machine. 

 So 

- "-s -f1".\setup.iss" becomes "-s -f1".\\setup.iss" 
- "-s -f1".\\setup.iss" becomes "-s -f1".setup.iss" 
- "-s -f1"C:\\Users\\UserName\\Desktop\\Software\\setup.iss" 
becomes "-s 
-f1"C:UsersUserNameDesktopSoftwaresetup.iss"" 

 I even set an enviroment variable for the full path of setup.iss and 
 tried to invoke it with 

- "-s -f1\'$env:referenceFilePath\' " ( \' in order to escape the 
single quote required to evaluate a variable in a double quote of a 
 .ps1)

 Unfortunately, this did not work with win_package. Though it did work 
 when I created a quick script on the local machine for testing. It seems 
 to 
 me that the win_package parses the argument string in an odd way. 

>>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/194c0db4-b227-4784-9a84-016d5ae74dda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package arguments format

2016-02-17 Thread Gerald Spencer
Interestingly enough, the absolute path with forward slashes did the trick. 
The normal setup isn't created, but everything appears to be working as it 
should. Thanks!

On Wednesday, February 17, 2016 at 9:51:50 AM UTC-8, Gerald Spencer wrote:
>
> When the appropriate command line format for the reference file is 
> supplied, the installer creates a setup.txt in the installers directory 
> with various other information. Unfortunately, using the an absolute path 
> with forward or back slashes does not appear to work for the ansible 
> arguments as no setup.txt is created.
>
>  
> On Wednesday, February 17, 2016 at 9:40:58 AM UTC-8, Trond Hindenes wrote:
>>
>> Your pathing for "setup.iss" is probably wrong. PowerShell takes a 
>> "dot-backslash" approach when using the shell interactively, but that 
>> doesn't mean you should do the same when supplying absolute/relative paths 
>> to the ansible module. Also, PowerShell supports forward slashes, so feel 
>> free to use them instead, so you don't have to escape them.
>>
>> I would assume you would use something like:
>>
>> - name: install software
>>   win_package:
>> path: "C:/Users/UserName/Desktop/Software/setup.exe"
>> product_id: {guid}
>> arguments: '-s -f1 "C:/Users/UserName/Desktop/Software/setup.iss" ' 
>> (i added a space between the last double-quote and single-quote just for 
>> clarification. Should probably be removed in prod)
>>
>>
>> On Wednesday, February 17, 2016 at 6:35:17 PM UTC+1, Gerald Spencer wrote:
>>>
>>> After further poking around after the win_package is parsed out to the 
>>> windows machine. Every backslash that is entered into the arguments is 
>>> doubled for the $complex_args variable in the powershell script that is ran 
>>> on the windows machine. 
>>>
>>> So 
>>>
>>>- "-s -f1".\setup.iss" becomes "-s -f1".\\setup.iss" 
>>>- "-s -f1".\\setup.iss" becomes "-s -f1".setup.iss" 
>>>- "-s -f1"C:\\Users\\UserName\\Desktop\\Software\\setup.iss" becomes 
>>>"-s -f1"C:UsersUserNameDesktopSoftwaresetup.iss"" 
>>>
>>> I even set an enviroment variable for the full path of setup.iss and 
>>> tried to invoke it with 
>>>
>>>- "-s -f1\'$env:referenceFilePath\' " ( \' in order to escape the 
>>>single quote required to evaluate a variable in a double quote of a .ps1)
>>>
>>> Unfortunately, this did not work with win_package. Though it did work 
>>> when I created a quick script on the local machine for testing. It seems to 
>>> me that the win_package parses the argument string in an odd way. 
>>>
>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/74b4ab93-38c7-4686-b745-43002364eacb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package arguments format

2016-02-17 Thread Gerald Spencer
When the appropriate command line format for the reference file is 
supplied, the installer creates a setup.txt in the installers directory 
with various other information. Unfortunately, using the an absolute path 
with forward or back slashes does not appear to work for the ansible 
arguments as no setup.txt is created.

 
On Wednesday, February 17, 2016 at 9:40:58 AM UTC-8, Trond Hindenes wrote:
>
> Your pathing for "setup.iss" is probably wrong. PowerShell takes a 
> "dot-backslash" approach when using the shell interactively, but that 
> doesn't mean you should do the same when supplying absolute/relative paths 
> to the ansible module. Also, PowerShell supports forward slashes, so feel 
> free to use them instead, so you don't have to escape them.
>
> I would assume you would use something like:
>
> - name: install software
>   win_package:
> path: "C:/Users/UserName/Desktop/Software/setup.exe"
> product_id: {guid}
> arguments: '-s -f1 "C:/Users/UserName/Desktop/Software/setup.iss" ' 
> (i added a space between the last double-quote and single-quote just for 
> clarification. Should probably be removed in prod)
>
>
> On Wednesday, February 17, 2016 at 6:35:17 PM UTC+1, Gerald Spencer wrote:
>>
>> After further poking around after the win_package is parsed out to the 
>> windows machine. Every backslash that is entered into the arguments is 
>> doubled for the $complex_args variable in the powershell script that is ran 
>> on the windows machine. 
>>
>> So 
>>
>>- "-s -f1".\setup.iss" becomes "-s -f1".\\setup.iss" 
>>- "-s -f1".\\setup.iss" becomes "-s -f1".setup.iss" 
>>- "-s -f1"C:\\Users\\UserName\\Desktop\\Software\\setup.iss" becomes 
>>"-s -f1"C:UsersUserNameDesktopSoftwaresetup.iss"" 
>>
>> I even set an enviroment variable for the full path of setup.iss and 
>> tried to invoke it with 
>>
>>- "-s -f1\'$env:referenceFilePath\' " ( \' in order to escape the 
>>single quote required to evaluate a variable in a double quote of a .ps1)
>>
>> Unfortunately, this did not work with win_package. Though it did work 
>> when I created a quick script on the local machine for testing. It seems to 
>> me that the win_package parses the argument string in an odd way. 
>>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2d40008e-cf1b-4abf-b539-2509e6f1ebc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package arguments format

2016-02-17 Thread Trond Hindenes
Your pathing for "setup.iss" is probably wrong. PowerShell takes a 
"dot-backslash" approach when using the shell interactively, but that 
doesn't mean you should do the same when supplying absolute/relative paths 
to the ansible module. Also, PowerShell supports forward slashes, so feel 
free to use them instead, so you don't have to escape them.

I would assume you would use something like:

- name: install software
  win_package:
path: "C:/Users/UserName/Desktop/Software/setup.exe"
product_id: {guid}
arguments: '-s -f1 "C:/Users/UserName/Desktop/Software/setup.iss" ' (i 
added a space between the last double-quote and single-quote just for 
clarification. Should probably be removed in prod)


On Wednesday, February 17, 2016 at 6:35:17 PM UTC+1, Gerald Spencer wrote:
>
> After further poking around after the win_package is parsed out to the 
> windows machine. Every backslash that is entered into the arguments is 
> doubled for the $complex_args variable in the powershell script that is ran 
> on the windows machine. 
>
> So 
>
>- "-s -f1".\setup.iss" becomes "-s -f1".\\setup.iss" 
>- "-s -f1".\\setup.iss" becomes "-s -f1".setup.iss" 
>- "-s -f1"C:\\Users\\UserName\\Desktop\\Software\\setup.iss" becomes 
>"-s -f1"C:UsersUserNameDesktopSoftwaresetup.iss"" 
>
> I even set an enviroment variable for the full path of setup.iss and tried 
> to invoke it with 
>
>- "-s -f1\'$env:referenceFilePath\' " ( \' in order to escape the 
>single quote required to evaluate a variable in a double quote of a .ps1)
>
> Unfortunately, this did not work with win_package. Though it did work when 
> I created a quick script on the local machine for testing. It seems to me 
> that the win_package parses the argument string in an odd way. 
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/493d29f5-a9cd-4e5c-928d-2c1d6174b585%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package arguments format

2016-02-17 Thread Gerald Spencer
After further poking around after the win_package is parsed out to the 
windows machine. Every backslash that is entered into the arguments is 
doubled for the $complex_args variable in the powershell script that is ran 
on the windows machine. 

So 

   - "-s -f1".\setup.iss" becomes "-s -f1".\\setup.iss" 
   - "-s -f1".\\setup.iss" becomes "-s -f1".setup.iss" 
   - "-s -f1"C:\\Users\\UserName\\Desktop\\Software\\setup.iss" becomes "-s 
   -f1"C:UsersUserNameDesktopSoftwaresetup.iss"" 
   
I even set an enviroment variable for the full path of setup.iss and tried 
to invoke it with 

   - "-s -f1\'$env:referenceFilePath\' " ( \' in order to escape the single 
   quote required to evaluate a variable in a double quote of a .ps1)
   
Unfortunately, this did not work with win_package. Though it did work when 
I created a quick script on the local machine for testing. It seems to me 
that the win_package parses the argument string in an odd way. 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9b1cad32-c52a-48be-8810-7fd8fae498d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package arguments format

2016-02-17 Thread Gerald Spencer
And yes on ansible 2.0.0.2

On Wednesday, February 17, 2016 at 9:15:34 AM UTC-8, Gerald Spencer wrote:
>
> Unfortunately, the installshield requires the quotes around the 
> referencefile path following the -f1 switch. 
>
> On Wednesday, February 17, 2016 at 8:17:49 AM UTC-8, J Hawkesworth wrote:
>>
>> Are you using Ansible 2.0.0.2?  
>>
>> I suggest trying to do away with the quotes if at all possible, even if 
>> you wind up with a full path to the setup.iss
>>
>> arguments: "-s -f1 C:\\Users\\UserName\\Desktop\\Software\\setup.exe"
>>
>> Jon
>> On Wednesday, 17 February 2016 11:29:02 UTC, Gerald Spencer wrote:
>>>
>>> Attempting to silently install a package using a response file and the 
>>> appropriate command line. 
>>>
>>> The command I need to run is:
>>>
>>>- .\setup.exe -s f1".\setup.iss"
>>>
>>>
>>> What I need to enter into arguments is:
>>>
>>> - name: install software
>>>   win_package:
>>> path: "C:\\Users\\UserName\\Desktop\\Software\\setup.exe"
>>> product_id: {guid}
>>> arguments: "-s -f1".\setup.iss""
>>> 
>>> I am unable to get the double quotes to pass through it seems. I've 
>>> tried various formats such as:
>>>
>>>- ' "-s -f1".\setup.iss"" '
>>>- ' -s -f1".\setup.iss" '
>>>- "-s -f1'.\setup.iss' " 
>>>
>>>
>>> Help?
>>>
>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4600aa49-0559-44e6-b46d-0c627c4e7066%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package arguments format

2016-02-17 Thread 'J Hawkesworth' via Ansible Project
Are you using Ansible 2.0.0.2?  

I suggest trying to do away with the quotes if at all possible, even if you 
wind up with a full path to the setup.iss

arguments: "-s -f1 C:\\Users\\UserName\\Desktop\\Software\\setup.exe"

Jon
On Wednesday, 17 February 2016 11:29:02 UTC, Gerald Spencer wrote:
>
> Attempting to silently install a package using a response file and the 
> appropriate command line. 
>
> The command I need to run is:
>
>- .\setup.exe -s f1".\setup.iss"
>
>
> What I need to enter into arguments is:
>
> - name: install software
>   win_package:
> path: "C:\\Users\\UserName\\Desktop\\Software\\setup.exe"
> product_id: {guid}
> arguments: "-s -f1".\setup.iss""
> 
> I am unable to get the double quotes to pass through it seems. I've tried 
> various formats such as:
>
>- ' "-s -f1".\setup.iss"" '
>- ' -s -f1".\setup.iss" '
>- "-s -f1'.\setup.iss' " 
>
>
> Help?
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/130896bb-b1d3-4502-b32d-8ef83f98ff70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package module

2015-01-20 Thread Paul Tötterman


 I'm looking for the win_package module.
 Could you tell me where is it possible to get or download it ??


It seems abandoned, but 
https://github.com/ansible/ansible/commit/961ab95b452cb3cd28c071e357a4afa8ead11f79

Cheers,
Paul 

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/adf882ad-a00d-408d-8640-e6f4dd6546d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.