become: yes
become_method: runas
become_user: SYSTEM
If you are on Ansible 2.5 I would highly recommend you use the last option as you can use any credential you want to access network resources. For example, I can run a process as the connection user but when accessing a fileshare I wnt to authenticate with the account fakeuser with the password fakepassword. The account fakeuser is not a valid logon account for the Windows host but a valid credential for the fileshare and before 2.5 you could only use become for a valid logon user. To achieve this you would do
- 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
become: yes
become_method: runas
become_flags: logon_type=new_credentials logon_flags=netcredentials_only
vars:
ansible_become_user: fakeuser
ansible_become_pass: fakepassword
Thanks Jordan, I upgraded to 2.5 yesterday, but seem to have even more problems now in that I can’t talk to any hosts… and the message is confusing
fatal: [AnsWin201601]: UNREACHABLE! => {"changed": false, "msg": "ssl: the specified credentials were rejected by the server", "unreachable": true}
I have made the changes to use become. Slightly confused by the message, is it unreachable, or are the credentials not accepted. I’ve probably messed something during the upgrade, I have another control host I am trying to configure from fresh in parallel… but if that message means anything blindly obvious to anyone please let me know
Thanks very much for the comments.
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0affdcf2-c611-4a88-97df-0c7b9f931329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks, it was just me being stupid… I had some stuff installed local and some in bin and was trying to clean up and I didn’t install the python Kerberos bit. Its all pretty much working now… but nice to know about that options its -vvvvvv ?
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/895b56c4-f867-4961-b567-99bd6b596f01%40googlegroups.com.
Ahh, I see, thank you!
From: ansible...@googlegroups.com [mailto:ansible...@googlegroups.com] On Behalf Of William Dossett
Sent: Friday, April 27, 2018 10:00 AM
To: Ansible Project <ansible...@googlegroups.com>
Subject: [ansible-project] Re: win_package
--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2e1443d5-2c9b-4506-a86a-19893c0ac9a3%40googlegroups.com.