Re: [ansible-project] Re: Vm mount iso and install vmware tools

2020-05-26 Thread Tony Wong
ok I got it working now with win_command but still having some errors


TASK [Install Vmware tools Silent]
**
task path: /home/tony/windows/download2.yml:15
Using module file
/usr/lib/python2.7/dist-packages/ansible/modules/windows/win_command.ps1
Pipelining is enabled.
 ESTABLISH WINRM CONNECTION FOR USER: adm-...@wsgr.com on PORT
5986 TO w10-adm-tkw
EXEC (via pipeline wrapper)
fatal: [w10-adm-tkw]: FAILED! => {
"changed": true,
"cmd": "c:\\temp\\VMware-tools-11.0.5-15389592-x86_64.exe /S /v \"/qn
REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs\"",
"delta": "0:01:07.028344",
"end": "2020-05-26 10:31:06.576186",
"msg": "non-zero return code",
"rc": 3010,
"start": "2020-05-26 10:29:59.547842",
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}

PLAY RECAP
**
w10-adm-tkw: ok=3changed=0unreachable=0failed=1
   skipped=0rescued=0ignored=0




what is wrong?



---
- name: testing win_get_url
  hosts: all
  tasks:
- name: Create Directory if not exist
  win_file:
path: c:\temp
state: directory

- name: Download exe to winbox
  win_get_url:
url:
https://packages.vmware.com/tools/esx/latest/windows/x64/VMware-tools-11.0.5-15389592-x86_64.exe
dest: c:\temp\VMware-tools-11.0.5-15389592-x86_64.exe

- name: Install Vmware tools Silent
  win_command: c:\temp\VMware-tools-11.0.5-15389592-x86_64.exe /S /v
"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs"

On Tue, May 26, 2020 at 3:07 PM Tony Wong  wrote:

> now no errors but its not getting installed as it would manually,
>
>
>
> PLAY [testing win_get_url]
> **
>
> TASK [Gathering Facts]
> **
> task path: /home/tony/windows/download.yml:2
> Using module file
> /usr/lib/python2.7/dist-packages/ansible/modules/windows/setup.ps1
> Pipelining is enabled.
>  ESTABLISH WINRM CONNECTION FOR USER: adm-...@wsgr.com on
> PORT 5986 TO w10-adm-tkw
> EXEC (via pipeline wrapper)
> ok: [w10-adm-tkw]
> META: ran handlers
>
> TASK [Create Directory if not exist]
> 
> task path: /home/tony/windows/download.yml:5
> Using module file
> /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_file.ps1
> Pipelining is enabled.
>  ESTABLISH WINRM CONNECTION FOR USER: adm-...@wsgr.com on
> PORT 5986 TO w10-adm-tkw
> EXEC (via pipeline wrapper)
> ok: [w10-adm-tkw] => {
> "changed": false
> }
>
> TASK [Download exe to winbox]
> ***
> task path: /home/tony/windows/download.yml:10
> Using module file
> /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_get_url.ps1
> Pipelining is enabled.
>  ESTABLISH WINRM CONNECTION FOR USER: adm-...@wsgr.com on
> PORT 5986 TO w10-adm-tkw
> EXEC (via pipeline wrapper)
> ok: [w10-adm-tkw] => {
> "changed": false,
> "checksum_dest": "a6a1ffd84082aa327c40c17171c98027124418f7",
> "checksum_src": "a6a1ffd84082aa327c40c17171c98027124418f7",
> "dest": "c:\\temp\\VMware-tools-11.0.5-15389592-x86_64.exe",
> "elapsed": 2.04831927,
> "invocation": {
> "module_args": {
> "checksum": null,
> "checksum_algorithm": "sha1",
> "checksum_url": null,
> "client_cert": null,
> "client_cert_password": null,
> "dest": "c:\\temp\\VMware-tools-11.0.5-15389592-x86_64.exe",
> "follow_redirects": "safe",
> "force": true,
> "force_basic_auth": false,
> "headers": null,
> "http_agent": "ansible-httpget",
> "maximum_redirection": 50,
> "method": null,
> "proxy_password": null,
> "proxy_url": null,
> "proxy_use_default_credential": false,
> "proxy_username": null,
> "timeout": 30,
> "url": "
> https://packages.vmware.com/tools/esx/latest/windows/x64/VMware-tools-11.0.5-15389592-x86_64.exe
> ",
> "url_password": null,
> "url_username": null,
> "use_default_credential": false,
> "use_proxy": true,
> "validate_certs": true
> }
> },
> "msg": "OK",
> "size": 96612272,
> "status_code": 200,
> "url": "
> 

Re: [ansible-project] Re: Vm mount iso and install vmware tools

2020-05-26 Thread Tony Wong
now no errors but its not getting installed as it would manually,



PLAY [testing win_get_url]
**

TASK [Gathering Facts]
**
task path: /home/tony/windows/download.yml:2
Using module file
/usr/lib/python2.7/dist-packages/ansible/modules/windows/setup.ps1
Pipelining is enabled.
 ESTABLISH WINRM CONNECTION FOR USER: adm-...@wsgr.com on PORT
5986 TO w10-adm-tkw
EXEC (via pipeline wrapper)
ok: [w10-adm-tkw]
META: ran handlers

TASK [Create Directory if not exist]

task path: /home/tony/windows/download.yml:5
Using module file
/usr/lib/python2.7/dist-packages/ansible/modules/windows/win_file.ps1
Pipelining is enabled.
 ESTABLISH WINRM CONNECTION FOR USER: adm-...@wsgr.com on PORT
5986 TO w10-adm-tkw
EXEC (via pipeline wrapper)
ok: [w10-adm-tkw] => {
"changed": false
}

TASK [Download exe to winbox]
***
task path: /home/tony/windows/download.yml:10
Using module file
/usr/lib/python2.7/dist-packages/ansible/modules/windows/win_get_url.ps1
Pipelining is enabled.
 ESTABLISH WINRM CONNECTION FOR USER: adm-...@wsgr.com on PORT
5986 TO w10-adm-tkw
EXEC (via pipeline wrapper)
ok: [w10-adm-tkw] => {
"changed": false,
"checksum_dest": "a6a1ffd84082aa327c40c17171c98027124418f7",
"checksum_src": "a6a1ffd84082aa327c40c17171c98027124418f7",
"dest": "c:\\temp\\VMware-tools-11.0.5-15389592-x86_64.exe",
"elapsed": 2.04831927,
"invocation": {
"module_args": {
"checksum": null,
"checksum_algorithm": "sha1",
"checksum_url": null,
"client_cert": null,
"client_cert_password": null,
"dest": "c:\\temp\\VMware-tools-11.0.5-15389592-x86_64.exe",
"follow_redirects": "safe",
"force": true,
"force_basic_auth": false,
"headers": null,
"http_agent": "ansible-httpget",
"maximum_redirection": 50,
"method": null,
"proxy_password": null,
"proxy_url": null,
"proxy_use_default_credential": false,
"proxy_username": null,
"timeout": 30,
"url": "
https://packages.vmware.com/tools/esx/latest/windows/x64/VMware-tools-11.0.5-15389592-x86_64.exe
",
"url_password": null,
"url_username": null,
"use_default_credential": false,
"use_proxy": true,
"validate_certs": true
}
},
"msg": "OK",
"size": 96612272,
"status_code": 200,
"url": "
https://packages.vmware.com/tools/esx/latest/windows/x64/VMware-tools-11.0.5-15389592-x86_64.exe
"
}

TASK [Install Vmware tools Silent]
**
task path: /home/tony/windows/download.yml:15
Using module file
/usr/lib/python2.7/dist-packages/ansible/modules/windows/win_package.ps1
Pipelining is enabled.
 ESTABLISH WINRM CONNECTION FOR USER: adm-tkw@xx on PORT
5986 TO w10-adm-tkw
EXEC (via pipeline wrapper)
ok: [w10-adm-tkw] => {
"changed": false,
"reboot_required": false
}
META: ran handlers
META: ran handlers

PLAY RECAP
**
w10-adm-tkw: ok=4changed=0unreachable=0failed=0
   skipped=0rescued=0ignored=0



why is ansible seeing the destination as :


"dest": "c:\\temp\\VMware-tools-11.0.5-15389592-x86_64.exe",


it should be "c:\temp\VMware-tools-11.0.5-15389592-x86_64.exe

On Tue, May 26, 2020 at 2:52 PM Tony Wong  wrote:

> I already tried the arguments. I know /s /v /qn works manually.
>
> why does that work on ansible?
>
> ---
> - name: testing win_get_url
>   hosts: all
>   tasks:
> - name: Create Directory if not exist
>   win_file:
> path: c:\temp
> state: directory
>
> - name: Download exe to winbox
>   win_get_url:
> url:
> https://packages.vmware.com/tools/esx/latest/windows/x64/VMware-tools-11.0.5-15389592-x86_64.exe
> dest: c:\temp\VMware-tools-11.0.5-15389592-x86_64.exe
>
> - name: Install Vmware tools Silent
>   win_package:
> path: 'c:\temp\VMware-tools-11.0.5-15389592-x86_64.exe'
> product_id: '{01767101-A688-4A95-9C83-6DED9EB6735D}'
> arguments: '/s /v /qn'
> state: present
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
>
> On Tue, May 26, 2020 at 2:19 PM Jean-Yves LENHOF 
> 

Re: [ansible-project] Re: Vm mount iso and install vmware tools

2020-05-26 Thread Tony Wong
I already tried the arguments. I know /s /v /qn works manually.

why does that work on ansible?

---
- name: testing win_get_url
  hosts: all
  tasks:
- name: Create Directory if not exist
  win_file:
path: c:\temp
state: directory

- name: Download exe to winbox
  win_get_url:
url:
https://packages.vmware.com/tools/esx/latest/windows/x64/VMware-tools-11.0.5-15389592-x86_64.exe
dest: c:\temp\VMware-tools-11.0.5-15389592-x86_64.exe

- name: Install Vmware tools Silent
  win_package:
path: 'c:\temp\VMware-tools-11.0.5-15389592-x86_64.exe'
product_id: '{01767101-A688-4A95-9C83-6DED9EB6735D}'
arguments: '/s /v /qn'
state: present
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~

On Tue, May 26, 2020 at 2:19 PM Jean-Yves LENHOF 
wrote:

> Hi,
>
> Just a guess (I'm not a windows man)...Perhaps you need to do silent
> install because you are not "desktop logged" when you use ansible.
>
> Have a look here for some example (you need to look for the good ones for
> your version, but you've got the idea)
>
>
> https://uncomplicatingit.com/vmware/command-to-do-a-complete-vmware-tools-install-silently/
>
> Regards,
>
>
> JYL
>
>
> Le 26/05/2020 à 22:46, Tony Wong a écrit :
>
> but I got all the steps working except win_package,
>
> There seems to be something wrong with execution.
>
> I manually ran the setup.exe and works
>
> On Tue, May 26, 2020 at 12:18 PM David Foley  wrote:
>
>> instead of the win_get_url use the win_package that will install the
>> application for you vm_tools
>>
>>   win_package:
>>   path:
>> https://repo.saltstack.com/windows/Salt-Minion-3000-Py3-AMD64-Setup.exe
>>   product_id: 'Salt-Minion-3000-Py3-AMD64-Setup.exe'
>>   arguments: 'Salt-Minion-3000-Py3-AMD64-Setup.exe /S /master={{
>> master }} /minion-name={{ minion }}'
>>   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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/8a1c6358-a435-4069-9c3c-a3fbdc738e4c%40googlegroups.com
>> 
>> .
>>
> --
> 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/CALmkhkqU4_KHjM%2B5Y9_XZWNLVGcL-wKHfnhPHXAxmWG7kqyS3Q%40mail.gmail.com
> 
> .
>
> --
> 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/6c088b60-9c8c-dcbd-79e9-416e60c12928%40lenhof.eu.org
> 
> .
>

-- 
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/CALmkhkp7cEhMHsWQ8t6ds%3DOpOW7CN%2BjiCXrMiHGu8wMfw7sFNw%40mail.gmail.com.


Re: [ansible-project] Re: Vm mount iso and install vmware tools

2020-05-26 Thread Jean-Yves LENHOF

Hi,

Just a guess (I'm not a windows man)...Perhaps you need to do silent 
install because you are not "desktop logged" when you use ansible.


Have a look here for some example (you need to look for the good ones 
for your version, but you've got the idea)


https://uncomplicatingit.com/vmware/command-to-do-a-complete-vmware-tools-install-silently/

Regards,


JYL


Le 26/05/2020 à 22:46, Tony Wong a écrit :

but I got all the steps working except win_package,

There seems to be something wrong with execution.

I manually ran the setup.exe and works

On Tue, May 26, 2020 at 12:18 PM David Foley > wrote:


instead of the win_get_url use the win_package that will install
the application for you vm_tools

  win_package:
          path:
https://repo.saltstack.com/windows/Salt-Minion-3000-Py3-AMD64-Setup.exe
          product_id: 'Salt-Minion-3000-Py3-AMD64-Setup.exe'
          arguments: 'Salt-Minion-3000-Py3-AMD64-Setup.exe /S
/master={{ master }} /minion-name={{ minion }}'
          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 view this discussion on the web visit

https://groups.google.com/d/msgid/ansible-project/8a1c6358-a435-4069-9c3c-a3fbdc738e4c%40googlegroups.com

.

--
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/CALmkhkqU4_KHjM%2B5Y9_XZWNLVGcL-wKHfnhPHXAxmWG7kqyS3Q%40mail.gmail.com 
.


--
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/6c088b60-9c8c-dcbd-79e9-416e60c12928%40lenhof.eu.org.


Re: [ansible-project] Re: Vm mount iso and install vmware tools

2020-05-26 Thread Tony Wong
but I got all the steps working except win_package,

There seems to be something wrong with execution.

I manually ran the setup.exe and works

On Tue, May 26, 2020 at 12:18 PM David Foley  wrote:

> instead of the win_get_url use the win_package that will install the
> application for you vm_tools
>
>   win_package:
>   path:
> https://repo.saltstack.com/windows/Salt-Minion-3000-Py3-AMD64-Setup.exe
>   product_id: 'Salt-Minion-3000-Py3-AMD64-Setup.exe'
>   arguments: 'Salt-Minion-3000-Py3-AMD64-Setup.exe /S /master={{
> master }} /minion-name={{ minion }}'
>   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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/8a1c6358-a435-4069-9c3c-a3fbdc738e4c%40googlegroups.com
> 
> .
>

-- 
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/CALmkhkqU4_KHjM%2B5Y9_XZWNLVGcL-wKHfnhPHXAxmWG7kqyS3Q%40mail.gmail.com.


[ansible-project] Re: Vm mount iso and install vmware tools

2020-05-26 Thread David Foley
instead of the win_get_url use the win_package that will install the 
application for you vm_tools

  win_package:
  path: 
https://repo.saltstack.com/windows/Salt-Minion-3000-Py3-AMD64-Setup.exe
  product_id: 'Salt-Minion-3000-Py3-AMD64-Setup.exe'
  arguments: 'Salt-Minion-3000-Py3-AMD64-Setup.exe /S /master={{ 
master }} /minion-name={{ minion }}'
  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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8a1c6358-a435-4069-9c3c-a3fbdc738e4c%40googlegroups.com.