[ansible-project] Re: Ansible - win_get_url copy file from network share

2014-08-18 Thread J Hawkesworth
I have not had the same issue as you but I found I had to add the domain 
user I was using into the remote management group that is created on the 
windows hosts at the time that you run Trond's setup script.  I'm away from 
the machine right now so can't remember the exact name of the group but it 
was something like __RemoteManagement.

Can you run other windows tasks ok, such as win_ping and setup?

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/ce16f347-94c6-4baf-abd3-82e594ea9ba1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible - win_get_url copy file from network share

2014-08-29 Thread J Hawkesworth
Hi,

I think you may have hit this 
issue: https://github.com/ansible/ansible/issues/8588

The name of the group I mentioned in previous post is WinRMRemoteWMIUsers__

on the windows host you want to manage, you need to run the following: 
net localgroup WinRMRemoteWMIUsers__ /add DOMAINNAME\domainusername
(where DOMAINNAME is the name of your domain and domainusername is the 
domain user you want to be able to use WinRM)

Hope this helps,

Jon


On Monday, August 11, 2014 4:35:06 PM UTC+1, Gopinath Suryadevara wrote:
>
> Hi,
>
> I was able to connect to a windows 7 box from a RHEL 5, ping it and also 
> changed the authentication to kerberos. Thank you, @Trond for the wonderful 
> script. Both the machines are on the same domain. When I use the 
> win_get_url module to copy a file from a network share, it fails. I turned 
> on the traces, got hold of the scripts on the remote win machine using 
> ANSIBLE_KEEP_FILES=1. When i execute the script on remote win machine using 
> the arguments file created by ansible, it executes successfully and copies 
> the file from a network share. But the script fails when run via ansible. 
> Even when i map the network share and try to use the assigned drive letter, 
> the script fails when executed from the ansible linux controller.
>
> Any help on this is appreciated!!
>

-- 
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/11a9d699-5ab5-4fe3-8bf1-837eccbe6e35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible - win_get_url copy file from network share

2014-08-29 Thread J Hawkesworth
Hi Damon, 

We seem to have started a separate thread here.

As posted to the previous thread:

Hi,

I think you may have hit this issue: 
https://github.com/ansible/ansible/issues/8588

The name of the group I mentioned in previous post is WinRMRemoteWMIUsers__

on the windows host you want to manage, you need to run the following: 
net localgroup WinRMRemoteWMIUsers__ /add DOMAINNAME\domainusername
(where DOMAINNAME is the name of your domain and domainusername is the 
domain user you want to be able to use WinRM)

Hope this helps,

Jon

On Monday, August 25, 2014 8:34:27 PM UTC+1, Damon Overboe wrote:
>
> Jon,
>
> If you can find the correct group for accessing with a domain account, 
> please let us know.
>
> Using trond's script, I'm able to connect using an admin account local to 
> the box, but the domain account (which is also in the local Administrator's 
> account) always fails to authenticate.
>
> Thanks!
> Damon
>

-- 
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/0af48027-1d88-4f40-99b0-e4cd3765419c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: winrm connection to windows server 2012r2 in EC2 - Unauthorized/basic auth failed

2014-09-23 Thread J Hawkesworth
Worth checking the firewall rules.  I think I had something like this 
happen first time I set up 2012 server, but I probably wasn't using basic 
auth.
>From memory I had an error when the following line of the setup script ran:
#FIrewallnetsh advfirewall firewall add rule Profile=public name="Allow 
WinRM HTTPS" dir=in localport=5986 protocol=TCP action=allowI think the 
problem was the Profile=public part.  Yeah, that was it, I had to tweak it 
to Profile=domain on 2012 but it had been happy on 2008r2 as is.
Bear in mind I was using a domain account, so not the same issue as you, 
but perhaps worth checking the firewall configuration anyway?

Jon

On Tuesday, September 23, 2014 9:11:01 PM UTC+1, Michael Wozniak wrote:
>
> I'm attempting to set up a windows 2012 system in EC2 which can be 
> accessed/managed with ansible.  I've used a script like the example (
> https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1)
>  
> passed as user_data at start-up to successfully connect to a windows 2008r2 
> based system, however I've had issues related to memory limits in 2008r2. 
>  When I try to use the same script to connect to a 2012r2 based system, I 
> get these errors:
>
>  ESTABLISH WINRM CONNECTION FOR USER: Admin1 on PORT 5986 TO IP
>  WINRM CONNECT: transport=plaintext endpoint=https://IP:5986/wsman
>  WINRM CONNECTION ERROR: 401 Unauthorized. basic auth failed
>  WINRM CONNECT: transport=plaintext endpoint=http://IP:5986/wsman
>
> I can successfully connect to the server with RDP, and as far as I can 
> tell, the winrm settings look correct.  Has anyone else experienced similar 
> issues? Any ideas on what could be going wrong?
>

-- 
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/79781399-d0d2-48a2-9783-c20423bbaed1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_ping issue

2014-09-29 Thread J Hawkesworth
Try not setting the ansible_ssh_host in your inventory - I think this might 
be forcing it to attempt ssh transport, which of course isn't going to work 
for windows hosts.

In other words, change

[ads800s]
ADS-6999 ansible_ssh_host=123.123.123.123

to

ads800s]
ADS-6999

and ensure ADS-6999 can either be resolved by your local dns or as an entry 
in /etc/hosts

On Wednesday, September 24, 2014 3:51:28 PM UTC+1, skinnedknuckles wrote:
>
>
> I'm having trouble getting win_ping to work.  Here is my info:
> Fedora 20
> Ansible 1.7.1
> Remote node running windows 7
> The WinRM script by Trond runs without errors on the remote node
> Control and Remote Machines are both on Lan with common domain w/o 
> firewalls
> So far as I can tell I've installed everything on control and remote 
> machine as described in documentation
>
> My inventory file contains
> [ads800s]
> ADS-6999 ansible_ssh_host=123.123.123.123
>
> My windows.yml file is in the group_vars directory and contains
> ansible_ssh_user: ansmgr
> ansible_ssh_pass: ansiblepw
> ansible_ssh_port: 5986
> ansible_connection: winrm
>
> Can you tell what I'm doing wrong?  Do you need any more information?
>
> Here is the debugging output of my win_ping command (with -c winrm is 
> below)
>
> [ansmgr@LinuxControlMachine ansible]$ ansible ADS-6999 -m win_ping -
> <123.123.123.123> ESTABLISH CONNECTION FOR USER: ansmgr
> <123.123.123.123> REMOTE_MODULE win_ping
> <123.123.123.123> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 
> 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 
> 'ControlPath=/home/ansmgr/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 
> 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 
> 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', 
> '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', 
> '123.123.123.123', "/bin/sh -c 'mkdir -p 
> $HOME/.ansible/tmp/ansible-tmp-1411567957.01-192759344617423 && chmod a+rx 
> $HOME/.ansible/tmp/ansible-tmp-1411567957.01-192759344617423 && echo 
> $HOME/.ansible/tmp/ansible-tmp-1411567957.01-192759344617423'"]
> ADS-6999 | FAILED => SSH encountered an unknown error. The output was:
> OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: /etc/ssh/ssh_config line 51: Applying options for *
> debug1: auto-mux: Trying existing master
> debug1: Control socket 
> "/home/ansmgr/.ansible/cp/ansible-ssh-123.123.123.123-22-ansmgr" does not 
> exist
> debug2: ssh_connect: needpriv 0
> debug1: Connecting to 123.123.123.123 [123.123.123.123] port 22.
> debug2: fd 3 setting O_NONBLOCK
> debug1: connect to address 123.123.123.123 port 22: Connection refused
> ssh: connect to host 123.123.123.123 port 22: Connection refused
>
> Here is the debugging output of my win_ping command with -c winrm is below
>
> [ansmgr@LinuxControlMachine ansible]$ ansible ADS-6999 -c winrm -m 
> win_ping -
> <123.123.123.123> ESTABLISH WINRM CONNECTION FOR USER: ansmgr on PORT 5986 
> TO 123.123.123.123
> ADS-6999 | FAILED => Traceback (most recent call last):
>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 
> 561, in _executor
> exec_rc = self._executor_internal(host, new_stdin)
>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 
> 666, in _executor_internal
> return self._executor_internal_inner(host, self.module_name, 
> self.module_args, inject, port, complex_args=complex_args)
>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 
> 837, in _executor_internal_inner
> conn = self.connector.connect(actual_host, actual_port, actual_user, 
> actual_pass, actual_transport, actual_private_key_file)
>   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py", 
> line 34, in connect
> self.active = conn.connect()
>   File 
> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>  
> line 132, in connect
> self.protocol = self._winrm_connect()
>   File 
> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>  
> line 71, in _winrm_connect
> cache_key = '%s:%s@%s:%d' % (self.user, 
> hashlib.md5(self.password).hexdigest(), self.host, port)
> TypeError: md5() argument 1 must be string or buffer, not None
>
>
>

-- 
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/0c52c661-746a-44b9-8bc3-805bcbf006fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Run powershell command as administrator

2014-10-02 Thread J Hawkesworth

>
> Not hit this particular problem myself and am not a powershell expert but 
> I have a couple of suggestions.
>

Last time I tried the raw module I came to the conclusion it was a running 
something close to a DOS command environment, rather than a powershell 
environment.   So maybe worth trying to turn your 'raw' into a 'script'.

Second (rather vague) suggestion is to make use of groups if possible and 
perhaps that way you don't need full administrator permissions, just 
logging in as a user who has sufficient group access to do whatever you 
need to to IIS might be enough.

Hope that's some help, please let us know how you get on, I know I have IIS 
configuration tasks I want to automate in the future.

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/cf3bd734-22c3-4e19-892f-920661ea46f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Is there a way to make my var less ugly?

2014-10-03 Thread J Hawkesworth
So I created some tasks in one of my roles today that queries Jenkins to 
find the latest build of a project and then uses that build number to go 
get a zip file onto one of my managed servers.

The relevant part of my tasks/main.yml looks like this:

- uri: 
url=http://jenkins/job/BuildSomeProject/api/json?tree=lastSuccessfulBuild[number]
 
method=GET return_content=yes
  delegate_to: localhost
  register: jenkins_response
  tags: latest

- debug: var=jenkins_response.json.lastSuccessfulBuild.number

- name: get specified zip
  win_get_url:
url: 
'http://jenkins/job/BuildSomeProject/lastSuccessfulBuild/artifact/zip/someProject.{{jenkins_response.json.lastSuccessfulBuild.number}}.zip'
dest: 
'C:\stagingArea\zips\someProject.{{jenkins_response.json.lastSuccessfulBuild.number}}.zip'

It works fine (thank you whoever created uri: module) but I'd like to 
assign a single variable name, say {{latestBuildNumber}}, rather than the 
{{jenkins_response.json.lastSuccessfulBuild.number}} which is a bit of a 
mouthful.

Maybe I'm thinking in programming mode and this is just the way it has to 
be, but I have the feeling I've been at the screen too long and I'm missing 
something obvious.

Jenkins can return a bunch of useful information about builds actually, so 
it would be nice to grab > 1 thing and assign it a more meaningful name 
that doesn't directly reference the structure of the json response.

Many thanks,

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/b61d49d3-f188-4153-8bbe-306742e5e11a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Is there a way to make my var less ugly?

2014-10-05 Thread J Hawkesworth
Thanks, just what I needed.

On Saturday, October 4, 2014 1:35:18 AM UTC+1, Michael Peters wrote:
>
> You can use the set_fact module for that.
> On Oct 3, 2014 7:03 PM, "J Hawkesworth"  > wrote:
>
>> So I created some tasks in one of my roles today that queries Jenkins to 
>> find the latest build of a project and then uses that build number to go 
>> get a zip file onto one of my managed servers.
>>
>> The relevant part of my tasks/main.yml looks like this:
>>
>> - uri: url=
>> http://jenkins/job/BuildSomeProject/api/json?tree=lastSuccessfulBuild[number]
>>  
>> method=GET return_content=yes
>>   delegate_to: localhost
>>   register: jenkins_response
>>   tags: latest
>>
>> - debug: var=jenkins_response.json.lastSuccessfulBuild.number
>>
>> - name: get specified zip
>>   win_get_url:
>> url: '
>> http://jenkins/job/BuildSomeProject/lastSuccessfulBuild/artifact/zip/someProject.{{jenkins_response.json.lastSuccessfulBuild.number}}.zip
>> '
>> dest: 
>> 'C:\stagingArea\zips\someProject.{{jenkins_response.json.lastSuccessfulBuild.number}}.zip'
>>
>> It works fine (thank you whoever created uri: module) but I'd like to 
>> assign a single variable name, say {{latestBuildNumber}}, rather than the 
>> {{jenkins_response.json.lastSuccessfulBuild.number}} which is a bit of a 
>> mouthful.
>>
>> Maybe I'm thinking in programming mode and this is just the way it has to 
>> be, but I have the feeling I've been at the screen too long and I'm missing 
>> something obvious.
>>
>> Jenkins can return a bunch of useful information about builds actually, 
>> so it would be nice to grab > 1 thing and assign it a more meaningful name 
>> that doesn't directly reference the structure of the json response.
>>
>> Many thanks,
>>
>> 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-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/b61d49d3-f188-4153-8bbe-306742e5e11a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/b61d49d3-f188-4153-8bbe-306742e5e11a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/39e8d849-829c-4be7-8c6d-4290b8a6d50c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Problems setting up WinRM

2014-10-15 Thread J Hawkesworth
Don't know for sure what is going on here but a couple of suggestions...

Check the winrm config and ensure basic auth is enabled:

*winrm get winrm/config/*

if basic auth is false set it to true (instructions further up in this 
thread).

You mention that both machines are on common domain but right now Ansible 
will not work with domain user accounts - so check that you are actually 
using a local account in your windows.yml.

Your windows.yml file shouldn't need to start with --- - mine doesn't 
anyway.

I had an issue with a windows server 2008 box that wasn't up to date with 
windows updates which caused winrm to fail as it was setting a very small 
limit on the allowed process size for commands run via winrm.  There was a 
specific patch for it but worth checking windows update is fully up to date 
if that's an option for you.

Your setup sounds pretty similar to one I have had working in the past. My 
controller was running centos 6.3 and I had it working against a win 7 host 
using a local account.

Hope this helps, let us know how you get on.

Jon
On Thursday, October 9, 2014 6:18:21 PM UTC+1, skinnedknuckles wrote:
>
> I've reinstalled everything and am still having trouble getting win_ping 
> to work.  Here is my info:
> Fedora 20
> Ansible 1.7.1
> Remote node running windows 7
> The WinRM script by Trond runs without errors on the remote node
> Control and Remote Machines are both on Lan with common domain w/o 
> firewalls
> So far as I can tell I've installed everything on control and remote 
> machine as described in documentation
>
> My inventory file contains
> [windows]
> 123.123.123.123
>
> My windows.yml file is in the group_vars directory and contains
> ansible_ssh_user: Administrator
> ansible_ssh_pass: ansiblepw
> ansible_ssh_port: 5986
> ansible_connection: winrm
>
> Should this file begin with "---"?
>
> Can you tell what I'm doing wrong?  Do you need any more information?
>
>
>
> [ansmgr@dhcp1-59-159 ansible]$ ansible windows -m win_ping --ask-pass 
> - 
> SSH password: 
> <123.123.123.123> ESTABLISH WINRM CONNECTION FOR USER: Administrator on 
> PORT 5986 TO 123.123.123.123 
> <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=
> https://123.123.123.123:5986/wsman 
> <123.123.123.123> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 104] 
> Connection reset by peer 
> <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=
> http://123.123.123.123:5986/wsman 
> 123.123.123.123 | FAILED => Traceback (most recent call last): 
> File "/etc/ansible/lib/ansible/runner/__init__.py", line 549, in _executor 
> exec_rc = self._executor_internal(host, new_stdin) 
> File "/etc/ansible/lib/ansible/runner/__init__.py", line 707, in 
> _executor_internal 
> return self._executor_internal_inner(host, self.module_name, 
> self.module_args, inject, port, complex_args=complex_args) 
> File "/etc/ansible/lib/ansible/runner/__init__.py", line 870, in 
> _executor_internal_inner 
> conn = self.connector.connect(actual_host, actual_port, actual_user, 
> actual_pass, actual_transport, actual_private_key_file) 
> File "/etc/ansible/lib/ansible/runner/connection.py", line 44, in connect 
> self.active = conn.connect() 
> File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 
> 132, in connect 
> self.protocol = self._winrm_connect() 
> File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 
> 86, in _winrm_connect 
> protocol.send_message('') 
> File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 173, in 
> send_message 
> return self.transport.send_message(message) 
> File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 76, in 
> send_message 
> response = urlopen(request, timeout=self.timeout) 
> File "/usr/lib64/python2.7/urllib2.py", line 127, in urlopen 
> return _opener.open(url, data, timeout) 
> File "/usr/lib64/python2.7/urllib2.py", line 404, in open 
> response = self._open(req, data) 
> File "/usr/lib64/python2.7/urllib2.py", line 422, in _open 
> '_open', req) 
> File "/usr/lib64/python2.7/urllib2.py", line 382, in _call_chain 
> result = func(*args) 
> File "/usr/lib64/python2.7/urllib2.py", line 1216, in http_open 
> return self.do_open(httplib.HTTPConnection, req) 
> File "/usr/lib64/python2.7/urllib2.py", line 1189, in do_open 
> r = h.getresponse(buffering=True) 
> File "/usr/lib64/python2.7/httplib.py", line 1045, in getresponse 
> response.begin() 
> File "/usr/lib64/python2.7/httplib.py", line 409, in begin 
> version, status, reason = self._read_status() 
> File "/usr/lib64/python2.7/httplib.py", line 365, in _read_status 
> line = self.fp.readline(_MAXLINE + 1) 
> File "/usr/lib64/python2.7/socket.py", line 476, in readline 
> data = self._sock.recv(self._rbufsize) 
> error: [Errno 104] Connection reset by peer
>
> On Saturday, June 28, 2014 7:16:15 AM UTC-5, Trond Hindenes wrote:
>>
>> I'm having trouble setting Ansible with WinRM. Here's my environment:
>> 10.10.50.4 - Win1 - the windows computer

Re: [ansible-project] Ansible quoting

2014-10-22 Thread J Hawkesworth

>
> I don't have a direct answer for this - rightly or wrongly the ps1 scripts 
> I have so far don't take any arguments - I consider them to be specific to 
> my roles and at the moment they embed some details that it would probably 
> be best to have as parameters.  However, it looks to me like your 
> deployLauncher.ps1 really wants to be a very general purpose deployment 
> tool and maybe it would be better off as an ansible module.  That way you 
> could perhaps take advantage of ansible's existing syntax for specifying 
> module arguments.
>

As an aside I believe @Trond Hindenes has a win_package module in the works 
which might do some of what you want.

-- 
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/7e37af37-905a-465c-8974-f42ad25681bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using Ansible with remote nodes running Windows 7

2014-10-26 Thread J Hawkesworth
I've had a couple of a occasions where I thought I had the firewall rules 
set right on my windows hosts but eventually realised they were set for the 
wrong profile - if you aren't connecting as a domain user make sure the 
profile is 'public', for example.


On Friday, October 24, 2014 7:05:32 PM UTC+1, skinnedknuckles wrote:
>
> Has anyone succeeded at running ansible with a remote node running Windows 
> 7?  I'm having problems getting win-ping to work in this configuration. 
>  I've tried Fedora 20 and CentOs7 with Ansible 1.8.  My inventory and 
> windows.yml files are good and I've run 
>
> pip install http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm
>
> Here is my debug output.
>
> [ansmgr@localhost ansible]$ ansible windows -c winrm -m win_ping 
> --ask-pass -
> SSH password: 
> <123.123.123.123> ESTABLISH WINRM CONNECTION FOR USER: ansmgr on PORT 5986 
> TO 123.123.123.123
> <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=
> https://123.123.123.123:5986/wsman
> <123.123.123.123> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 104] 
> Connection reset by peer
> <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=
> http://123.123.123.123:5986/wsman
> 123.123.123.123 | FAILED => Traceback (most recent call last):
>
>   File "/etc/ansible/lib/ansible/runner/__init__.py", line 559, in 
> _executor
> exec_rc = self._executor_internal(host, new_stdin)
>   File "/etc/ansible/lib/ansible/runner/__init__.py", line 732, in 
> _executor_internal
> return self._executor_internal_inner(host, self.module_name, 
> self.module_args, inject, port, complex_args=complex_args)
>   File "/etc/ansible/lib/ansible/runner/__init__.py", line 895, in 
> _executor_internal_inner
> conn = self.connector.connect(actual_host, actual_port, actual_user, 
> actual_pass, actual_transport, actual_private_key_file)
>   File "/etc/ansible/lib/ansible/runner/connection.py", line 44, in connect
> self.active = conn.connect()
>   File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 
> 132, in connect
> self.protocol = self._winrm_connect()
>   File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 
> 86, in _winrm_connect
> protocol.send_message('')
>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 173, in 
> send_message
> return self.transport.send_message(message)
>   File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 76, in 
> send_message
> response = urlopen(request, timeout=self.timeout)
>   File "/usr/lib64/python2.7/urllib2.py", line 127, in urlopen
> return _opener.open(url, data, timeout)
>   File "/usr/lib64/python2.7/urllib2.py", line 404, in open
> response = self._open(req, data)
>   File "/usr/lib64/python2.7/urllib2.py", line 422, in _open
> '_open', req)
>   File "/usr/lib64/python2.7/urllib2.py", line 382, in _call_chain
> result = func(*args)
>   File "/usr/lib64/python2.7/urllib2.py", line 1216, in http_open
> return self.do_open(httplib.HTTPConnection, req)
>   File "/usr/lib64/python2.7/urllib2.py", line 1189, in do_open
> r = h.getresponse(buffering=True)
>   File "/usr/lib64/python2.7/httplib.py", line 1045, in getresponse
> response.begin()
>   File "/usr/lib64/python2.7/httplib.py", line 409, in begin
> version, status, reason = self._read_status()
>   File "/usr/lib64/python2.7/httplib.py", line 365, in _read_status
> line = self.fp.readline(_MAXLINE + 1)
>   File "/usr/lib64/python2.7/socket.py", line 476, in readline
> data = self._sock.recv(self._rbufsize)
> error: [Errno 104] Connection reset by peer
>
>

-- 
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/c7e97b23-71dd-4674-8362-5e9f7bb498eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: action plugin vs module

2014-11-06 Thread J Hawkesworth
See 

http://docs.ansible.com/intro_configuration.html#action-plugins

In essence, action plugins provide services to modules and are used for 
various things including the abilty to let different modules share logic. 
 Modules provide a mechanism with a defined interface.  For example the 
ability to copy files to a remote machine is a useful capability for lots 
of modules (template, unarchive), so the action plugins let other modules 
use the logic in the copy module.



On Thursday, November 6, 2014 10:34:07 AM UTC, cdar z wrote:
>
> Could You help and tell me the difference between an action plugin and a 
> module? Why is an action plugin 'synchronize' and a module 'synchronize' at 
> the same time? Thanks.
>

-- 
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/e75e3056-4cc9-4ba5-85e0-17c7c1631cdb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Upgrades and reboots - question

2014-11-10 Thread J Hawkesworth
Just a guess but you might want to have a few seconds of delay set in your 
wait_for so that there is time for network services and sshd to come back 
up before ansible goes looking for it.

On Monday, November 10, 2014 2:33:55 AM UTC, Patrick Galbraith wrote:
>
> Hi all!
>
> We've been working on a playbook that does a dist upgrade and then 
> performs a reboot. This has been problematic and results in a failure 
> return status that sometimes means it worked and sometimes not. What is the 
> trick to reboots -- being able to smoothly reconnect after a reboot signal?
>
> ---
> - name: reboot the server
>   command: shutdown -r now "Ansible updates triggered"
>   async: 0
>   poll: 0
>   ignore_errors: true
>   tags:
> - reboot
>
> - name: waiting for server to come back
>   sudo: false
>   local_action: >
> wait_for:
>   host: {{ inventory_hostname }}
>   timeout: 300
>   delay: 0
>   port: 22
>   state: started
>   tags:
> - reboot
>
> Is there a technique that is commonly used that results in better plays 
> that result in success?
>
> Regards,
>
> Patrick 
>

-- 
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/6bb87a66-7f98-4379-bd47-57d6fdeab124%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Connection problem with a windows machine since ansible

2014-11-10 Thread J Hawkesworth
Just checking, have you run the powershell script to enable remoting on 
your windows-vm machine?

See http://docs.ansible.com/intro_windows.html#windows-system-prep

and this script here:

https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1

Until the script is run I would expect your windows-vm to refuse 
connections.



On Saturday, November 8, 2014 12:03:45 PM UTC, youmarva wrote:
>
> Hi,
>
> I recently install Ansible 1.8, and I'm testing its fonctionnality
> I recently installed Ansible 1.8 on Debian 7.1, I test its functionality in 
> order to work with.
>
> But testing the functionality of Windows logon, I have a connection error 
> as shown below:
>
> root@ansible:/etc/ansible# ansible windows-vm -m win_ping -
> <192.168.1.108> ESTABLISH WINRM CONNECTION FOR USER: administrateur on 
> PORT 5986 TO 192.168.1.108
> <192.168.1.108> WINRM CONNECT: transport=plaintext endpoint=https://
> 192.168.1.108:5986/wsman
> <192.168.1.108> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 111] 
> Connection refused
> <192.168.1.108> WINRM CONNECT: transport=plaintext endpoint=http://
> 192.168.1.108:5986/wsman
> <192.168.1.108> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 111] 
> Connection refused
> openerpb | FAILED => 500 WinRMTransport. [Errno 111] Connection refused
>
> I create a file windows.yml under  /etc/ansible/group_vars indicating in 
> the pameters of my windows server and I added the address of my host in 
> the /etc/ansible/hosts.
>
> root@ansible:/etc/ansible# cat hosts 
> [windows]
> windows-vm ansible_ssh_host=192.168.1.108
>
>
> root@ansible:/etc/ansible# cat group_vars/windows.yml 
> # it is suggested that these be encrypted with ansible-vault:
> # ansible-vault edit group_vars/windows.yml
>
> ansible_ssh_user: administrateur
> ansible_ssh_pass: password
> ansible_ssh_port: 5986
> ansible_connection: winrm
>
>
> This error is due to what do you think?
> Thank you for help
>
> youmarva
>
>

-- 
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/ae2c30a2-4709-4066-bd9e-eeb09365aebd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible + Jenkins

2014-11-17 Thread J Hawkesworth
You can use 'Publish over SSH' module to call a remote system running 
ansible.
Configure your ansible host in Jenkins -> Manage Jenkins -> Configure System
Then you can add a post build action called 'Send Build artifacts over 
ssh'.  Select your ansible host and then in the Transfers section, specify 
commands to run on your ansible host.  You don't actually have to transfer 
files with this action.

On Thursday, November 13, 2014 8:27:53 AM UTC, Alex T wrote:
>
> Hi! 
> Everybody knows, how to run ansible playbook from jenkins ci?
>

-- 
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/ce756f75-91f3-4af7-9870-d99773d06df3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible Windows

2014-12-04 Thread J Hawkesworth
Yes, there is a thread on the Ansible Development list detailing progress on 
this. 

-- 
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/0d6d6753-b481-4591-9ee4-3ef96296e765%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] using anyconfig-0.0.5 as a module in ansible

2014-12-13 Thread J Hawkesworth
Sounds to me like maybe you are after win_copy, win_template and win_lineinfile 
modules. I have created PRs for the first two. 

If you don't mind working from development version of Ansible you could try 
them now. I'd be grateful for any feedback. 

That might get you most of what you need, with the exception of replacing lines 
in existing files. You might find using the existing lineinfile module as a 
starting point would be a help. Actually,  thinking about it, you might be able 
to make use of a combination of of fetch, lineinfile and win_copy to manipulate 
the configuration files, if you can run lineinfile delegated to your Ansible 
controller, and you can get away with replacing the files on your windows 
nodes. 


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/69520b9c-15b2-4fbf-b3a0-854e54fa17bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] using anyconfig-0.0.5 as a module in ansible

2014-12-13 Thread J Hawkesworth
PRs, if you are interested are:
https://github.com/ansible/ansible-modules-core/pull/384
and
https://github.com/ansible/ansible/pull/9611

Jon

On Saturday, December 13, 2014 5:47:14 PM UTC, J Hawkesworth wrote:
>
> Sounds to me like maybe you are after win_copy, win_template and 
> win_lineinfile modules. I have created PRs for the first two. 
>
> If you don't mind working from development version of Ansible you could 
> try them now. I'd be grateful for any feedback. 
>
> That might get you most of what you need, with the exception of replacing 
> lines in existing files. You might find using the existing lineinfile 
> module as a starting point would be a help. Actually,  thinking about it, 
> you might be able to make use of a combination of of fetch, lineinfile and 
> win_copy to manipulate the configuration files, if you can run lineinfile 
> delegated to your Ansible controller, and you can get away with replacing 
> the files on your windows nodes. 
>
>
> 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/9bac8824-8f36-4119-8b25-c2cbb2babc26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible win_ping "WINRM RESULT "

2014-12-15 Thread J Hawkesworth
I think I had this StackOverflowException  problem in the past with a 
windows server 2008 installation which had not received any windows updates.
I suggest you check you are up to date with windows updates.
Jon

On Monday, December 15, 2014 3:44:48 PM UTC, youmarva wrote:
>
> Hi,
>
> I have configured my server Ansible and my windows machines to use the 
> windows modules, the connection is going well for most of the machines 
> tested except for a few where I have the following error when i execute 
> ansible 
> #windows -m win_ping -
> ansible windows -m win_ping -
> <172.16.0.80> ESTABLISH WINRM CONNECTION FOR USER: infra on PORT 5986 TO 
> 172.16.0.80
> <172.16.0.80> WINRM CONNECT: transport=plaintext endpoint=https://
> 172.16.0.80:5986/wsman
> <172.16.0.80> REMOTE_MODULE win_ping
> <172.16.0.80> EXEC (New-Item -Type Directory -Path $env:temp -Name 
> "ansible-tmp-141865.53-246551001925925").FullName | Write-Host -
> Separator '';
> <172.16.0.80> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive', 
> '-EncodedCommand', 
> 'KABOAGUAdwAtAEkAdABlAG0AIAAtAFQAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQBuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMQA4ADYANQAzADMAMwAzAC4ANQAzAC0AMgA0ADYANQA1ADEAMAAwADEAOQAyADUAOQAyADUAIgApAC4ARgB1AGwAbABOAGEAbQBlACAAfAAgAFcAcgBpAHQAZQAtAEgAbwBzAHQAIAAtAFMAZQBwAGEAcgBhAHQAbwByACAAJwAnADsA'
> ]
> <172.16.0.80> WINRM RESULT  err "">
> <172.16.0.80> PUT /tmp/tmpfe1MUN TO C:\Users\infra\AppData\Local\Temp\
> ansible-tmp-141865.53-246551001925925\\win_ping
> <172.16.0.80> WINRM PUT /tmp/tmpfe1MUN to C:\Users\infra\AppData\Local\
> Temp\ansible-tmp-141865.53-246551001925925\\win_ping.ps1 (offset=0 
> size=2037)
> <172.16.0.80> WINRM PUT /tmp/tmpfe1MUN to C:\Users\infra\AppData\Local\
> Temp\ansible-tmp-141865.53-246551001925925\\win_ping.ps1 (offset=2037 
> size=2037)
> <172.16.0.80> WINRM PUT /tmp/tmpfe1MUN to C:\Users\infra\AppData\Local\
> Temp\ansible-tmp-141865.53-246551001925925\\win_ping.ps1 (offset=4074 
> size=1807)
> <172.16.0.80> PUT /tmp/tmpMlMZ5d TO C:\Users\infra\AppData\Local\Temp\
> ansible-tmp-141865.53-246551001925925\\arguments
> <172.16.0.80> WINRM PUT /tmp/tmpMlMZ5d to C:\Users\infra\AppData\Local\
> Temp\ansible-tmp-141865.53-246551001925925\\arguments (offset=0 size=2
> )
> <172.16.0.80> EXEC PowerShell -NoProfile -NonInteractive -ExecutionPolicy 
> Unrestricted -File 
> "C:\Users\infra\AppData\Local\Temp\ansible-tmp-141865.53-246551001925925\\win_ping.ps1"
>  
> "C:\Users\infra\AppData\Local\Temp\ansible-tmp-141865.53-246551001925925\\arguments"
> ; Remove-Item 
> "C:\Users\infra\AppData\Local\Temp\ansible-tmp-141865.53-246551001925925\"
>  
> -Force -Recurse;
> <172.16.0.80> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive', 
> '-EncodedCommand', 
> 'UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARgBpAGwAZQAgACIAQwA6AFwAVQBzAGUAcgBzAFwAaQBuAGYAcgBhAFwAQQBwAHAARABhAHQAYQBcAEwAbwBjAGEAbABcAFQAZQBtAHAAXABhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMQA4ADYANQAzADMAMwAzAC4ANQAzAC0AMgA0ADYANQA1ADEAMAAwADEAOQAyADUAOQAyADUAXABcAHcAaQBuAF8AcABpAG4AZwAuAHAAcwAxACIAIAAiAEMAOgBcAFUAcwBlAHIAcwBcAGkAbgBmAHIAYQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADEAOAA2ADUAMwAzADMAMwAuADUAMwAtADIANAA2ADUANQAxADAAMAAxADkAMgA1ADkAMgA1AFwAXABhAHIAZwB1AG0AZQBuAHQAcwAiADsAIABSAGUAbQBvAHYAZQAtAEkAdABlAG0AIAAiAEMAOgBcAFUAcwBlAHIAcwBcAGkAbgBmAHIAYQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADEAOAA2ADUAMwAzADMAMwAuADUAMwAtADIANAA2ADUANQAxADAAMAAxADkAMgA1ADkAMgA1AFwAIgAgAC0ARgBvAHIAYwBlACAALQBSAGUAYwB1AHIAcwBlADsA']
> <172.16.0.80> WINRM RESULT  ">
> pc-bill | FAILED >> {
> "failed": true, 
> "msg": "ConvertTo-Json : \r\n", 
> "parsed": false
> }
>
> or 
>
> <172.16.0.80> WINRM RESULT  : Une">
> pc-bill | FAILED => Traceback (most recent call last):
>   File 
> "/usr/local/lib/python2.7/dist-packages/ansible-1.8-py2.7.egg/ansible/runner/__init__.py",
>  
> line 579, in _executor
> exec_rc = self._executor_internal(host, new_stdin)
>   File 
> "/usr/local/lib/python2.7/dist-packages/ansible-1.8-py2.7.egg/ansible/runner/__init__.py",
>  
> line 752, in _executor_internal
> return self._executor_internal_inner(host, self.module_name, 
> self.module_args, inject, port, complex_args=complex_args)
>   File 
> "/usr/local/lib/python2.7/dist-packages/ansible-1.8-py2.7.egg/ansible/runner/__init__.py",
>  
> line 985, in _executor_internal_inner
> result = handler.run(conn, tmp, module_name, module_args, inject, 
> complex_args)
>   File 
> "/usr/local/lib/python2.7/dist-packages/ansible-1.8-py2.7.egg/ansible/runner/action_plugins/normal.py",
>  
> line 57, in run
> return self.runner._execute_module(conn, tmp, module_name, 
> module_args, inje

[ansible-project] Re: win_template and line breaks

2014-12-20 Thread J Hawkesworth
Hmm... not sure the integration tests cover this, could be a bug.

I'd try using 

od -cx your_template | more

 to make sure you have got CR and LF at the end of your lines to start 
with.  If they are there in the template then please shout, as it sounds 
like it might need a fix.

Jon



On Thursday, December 18, 2014 5:48:02 PM UTC, Joey wrote:
>
> I'm using win_template to copy a text file with a couple variables to a 
> windows client. However, it seems to be removing all lines breaks from the 
> file. I tried using unix2dos on the template, as well as adding 
> "#jinja2:trim_blocks: 
> False", but neither one seemed to work. Any other ideas?
>

-- 
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/1caa2ac1-5e62-483c-a8b6-2e316c1f83e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_template and line breaks

2014-12-20 Thread J Hawkesworth
Oh, meant to say be aware that win_template has been unmerged due to a 
different issue.

On Saturday, December 20, 2014 5:19:25 PM UTC, J Hawkesworth wrote:
>
> Hmm... not sure the integration tests cover this, could be a bug.
>
> I'd try using 
>
> od -cx your_template | more
>
>  to make sure you have got CR and LF at the end of your lines to start 
> with.  If they are there in the template then please shout, as it sounds 
> like it might need a fix.
>
> Jon
>
>
>
> On Thursday, December 18, 2014 5:48:02 PM UTC, Joey wrote:
>>
>> I'm using win_template to copy a text file with a couple variables to a 
>> windows client. However, it seems to be removing all lines breaks from the 
>> file. I tried using unix2dos on the template, as well as adding 
>> "#jinja2:trim_blocks: 
>> False", but neither one seemed to work. Any other ideas?
>>
>

-- 
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/d7a40eab-d916-45d4-9ca9-10dd888b647e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: root of hg tree?

2014-12-21 Thread J Hawkesworth
'register' and perhaps 'set_fact' are probably what you need - here's an 
example:

$ cat set_fact.yml 
---
- hosts: linux
  tasks:
  - name: call a command to get some output...
command: "echo somecomandoutput"
delegate_to: localhost
register: result

# debug statements very handy for seeing what's in your registered 
variables.
  - debug: var=result


# now use set_fact to put the var into a fact.
  - name: set fact based on output of previous command
set_fact:
  my_hg_root: "{{result.stdout_lines[0]}}"

# debug just to show the value is now in the fact
  - debug: var=my_hg_root




On Saturday, December 20, 2014 5:07:44 PM UTC, Roy Smith wrote:
>
> I want to set a playbook variable to the root of my hg tree, i.e. capture 
> the output of the "hg root" command run on my local host.  How do I do that?
>
>

-- 
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/b8b8be2f-360b-4426--575141f2daa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] script module for powershell

2014-12-22 Thread J Hawkesworth
The only time I have seen inconsistent behaviour similar to what you describe I 
was trying to control machines which were many network hops away from the 
controller. 
One thing to try would be to keep an eye on the windows event log on the remote 
machines. 

I guess it might be worth checking what kind of network speeds you are getting 
just in case you are working over a busy network. 

Hope that's some help. 

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/29015c82-bf90-411e-b05a-83f8ab58733a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_template and line breaks

2014-12-24 Thread J Hawkesworth
I think that should be enough too.  Soon as I get the chance I'll see if I 
can work out what is going on.

Jon

On Monday, December 22, 2014 6:50:57 PM UTC, Joey wrote:
>
> Checked with od and I have \r\n at the end of every line, which I think 
> should do it.
>
> On Saturday, December 20, 2014 9:19:25 AM UTC-8, J Hawkesworth wrote:
>>
>> Hmm... not sure the integration tests cover this, could be a bug.
>>
>> I'd try using 
>>
>> od -cx your_template | more
>>
>>  to make sure you have got CR and LF at the end of your lines to start 
>> with.  If they are there in the template then please shout, as it sounds 
>> like it might need a fix.
>>
>> Jon
>>
>>
>>
>> On Thursday, December 18, 2014 5:48:02 PM UTC, Joey wrote:
>>>
>>> I'm using win_template to copy a text file with a couple variables to a 
>>> windows client. However, it seems to be removing all lines breaks from the 
>>> file. I tried using unix2dos on the template, as well as adding 
>>> "#jinja2:trim_blocks: 
>>> False", but neither one seemed to work. Any other ideas?
>>>
>>

-- 
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/1986dccc-2625-424d-b17b-4d2560576602%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_template and line breaks

2014-12-27 Thread J Hawkesworth
Ok, as it stands, it seems the templating only generates \n line endings.

Its easy enough to force dos line endings by making a one-line change to 
win_template.py 
after
 resultant = template.template_from_file(self.runner.basedir, source, 
inject, vault_password=self.runner.vault_pass)
just add
 resultant = resultant.replace('\n', '\r\n')

However, I'm wondering whether it should be optional.

Since you have a use case, do you have an opinion on whether something like 
'force_dos_line_endings' should be a module parameter for win_template.  If 
so I'm guessing defaulting it to True would be the best option?

Jon


On Wednesday, December 24, 2014 8:52:22 AM UTC, J Hawkesworth wrote:
>
> I think that should be enough too.  Soon as I get the chance I'll see if I 
> can work out what is going on.
>
> Jon
>
> On Monday, December 22, 2014 6:50:57 PM UTC, Joey wrote:
>>
>> Checked with od and I have \r\n at the end of every line, which I think 
>> should do it.
>>
>> On Saturday, December 20, 2014 9:19:25 AM UTC-8, J Hawkesworth wrote:
>>>
>>> Hmm... not sure the integration tests cover this, could be a bug.
>>>
>>> I'd try using 
>>>
>>> od -cx your_template | more
>>>
>>>  to make sure you have got CR and LF at the end of your lines to start 
>>> with.  If they are there in the template then please shout, as it sounds 
>>> like it might need a fix.
>>>
>>> Jon
>>>
>>>
>>>
>>> On Thursday, December 18, 2014 5:48:02 PM UTC, Joey wrote:
>>>>
>>>> I'm using win_template to copy a text file with a couple variables to a 
>>>> windows client. However, it seems to be removing all lines breaks from the 
>>>> file. I tried using unix2dos on the template, as well as adding 
>>>> "#jinja2:trim_blocks: 
>>>> False", but neither one seemed to work. Any other ideas?
>>>>
>>>

-- 
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/f1258d52-01d4-4050-8e16-5f2b486c4d4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_template and line breaks

2015-01-06 Thread J Hawkesworth
I just looked at what I was getting out from the template call in ansible. 
 I had a bit of a look at the jinja2 docs but didn't spot anything about 
line endings.
Next time I get some time I will have another look - I agree it would be 
nicer to use the template 'as is', as it would let you fetch a known 
working file, template it and then include into your own roles.

On Monday, January 5, 2015 5:58:47 PM UTC, Joey wrote:
>
> Instead of forcing the replacement, does it make sense to update 
> template_from_file to properly read \r\n vs \n? I think it'd be better to 
> keep the file as-is regardless of the line endings instead of having to 
> turn replacement on/off via parameter. Or is template_from_file something 
> from jinja2 that we can't really modify? I haven't looked too far into that 
> yet.
>
> On Saturday, December 27, 2014 3:49:36 PM UTC-8, J Hawkesworth wrote:
>>
>> Ok, as it stands, it seems the templating only generates \n line endings.
>>
>> Its easy enough to force dos line endings by making a one-line change to 
>> win_template.py 
>> after
>>  resultant = template.template_from_file(self.runner.basedir, source, 
>> inject, vault_password=self.runner.vault_pass)
>> just add
>>  resultant = resultant.replace('\n', '\r\n')
>>
>> However, I'm wondering whether it should be optional.
>>
>> Since you have a use case, do you have an opinion on whether something 
>> like 'force_dos_line_endings' should be a module parameter for 
>> win_template.  If so I'm guessing defaulting it to True would be the best 
>> option?
>>
>> Jon
>>
>>
>> On Wednesday, December 24, 2014 8:52:22 AM UTC, J Hawkesworth wrote:
>>>
>>> I think that should be enough too.  Soon as I get the chance I'll see if 
>>> I can work out what is going on.
>>>
>>> Jon
>>>
>>> On Monday, December 22, 2014 6:50:57 PM UTC, Joey wrote:
>>>>
>>>> Checked with od and I have \r\n at the end of every line, which I think 
>>>> should do it.
>>>>
>>>> On Saturday, December 20, 2014 9:19:25 AM UTC-8, J Hawkesworth wrote:
>>>>>
>>>>> Hmm... not sure the integration tests cover this, could be a bug.
>>>>>
>>>>> I'd try using 
>>>>>
>>>>> od -cx your_template | more
>>>>>
>>>>>  to make sure you have got CR and LF at the end of your lines to start 
>>>>> with.  If they are there in the template then please shout, as it sounds 
>>>>> like it might need a fix.
>>>>>
>>>>> Jon
>>>>>
>>>>>
>>>>>
>>>>> On Thursday, December 18, 2014 5:48:02 PM UTC, Joey wrote:
>>>>>>
>>>>>> I'm using win_template to copy a text file with a couple variables to 
>>>>>> a windows client. However, it seems to be removing all lines breaks from 
>>>>>> the file. I tried using unix2dos on the template, as well as adding 
>>>>>> "#jinja2:trim_blocks: 
>>>>>> False", but neither one seemed to work. Any other ideas?
>>>>>>
>>>>>

-- 
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/ba597f73-bba6-4c03-8654-215c9907c9f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_template and line breaks

2015-01-06 Thread J Hawkesworth
Thanks for this.  I guess the integration tests can't be covering this 
then... Another thing for me to look at while the v2 work progresses.


On Monday, January 5, 2015 7:49:50 PM UTC, Joey wrote:
>
> I know this has been backed out of devel, but I need windows template 
> support and it was so close to working for me that I decided to fix the few 
> issues I found and keep using the branch I was on. In case this is useful 
> for the future or for anyone else:
>
> ansible/lib/ansible/module_utils/powershell.ps1: Get-FileChecksum needs an 
> update from this:
> [System.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").
> ToLower();
> to this:
> $hash = [System.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", 
> "").ToLower();
>
> Otherwise it returns an array instead of a string, and win_copy will not 
> be able to compare the two checksums correctly.
>
>
> I also changed ansible/lib/ansible/modules/core/windows/win_copy.ps1 and 
> updated:
> $src_checksum.CompareTo($dest_checksum)
> to:
> $src_checksum.Equals($dest_checksum)
> as apparently Microsoft recommends using CompareTo for sorting, not for 
> checking equality, and I was getting some overload errors when CompareTo 
> kept running into the array from Get-FileChecksum.
>
>

-- 
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/33fe54ef-18ce-4eaf-b084-65d244250c11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: how can I include only parts (or subtasks of a role

2015-01-15 Thread J Hawkesworth
Could you use 

ansible-playbook --start-at-task



On Thursday, January 15, 2015 at 8:33:27 PM UTC, Peter Mooshammer wrote:
>
> Hi,
>
> I have a role that does everything to standup a server on aws - create a 
> network and provision a VM. But sometimes I only want to run only the part 
> that deploys a new server.
>
> Currently I simple include these sub-tasks in a playbook, which I don't 
> really like:
>
>   tasks:
> # should be called as a role, but only parts of it ...
>   - include: aws/tasks/provision-net.yml
>   - include: aws/tasks/provision-vm.yml
>
> thanks
>
> Peter
>

-- 
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/e95a4f78-0582-4155-bd08-bc1cfa0d7a03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows puzzler

2015-01-19 Thread J Hawkesworth
I can't explain the behaviour you are seeing but maybe some of the 
following will help.

Yes you are correct, state: absent is asking the module to ensure that IIS 
is not present.
You also have 'restart: yes' set.  I don't know off the top of my head if 
installing IIS requires a restart but perhaps the windows machine is 
restarting while you are attempting to run further playbooks (not sure if 
the module will wait for the restart to complete).  That might account for 
some strange behaviour.

You can also run ansible-playbook -v to get ansible to be more verbose 
about what its doing.  There are several levels of debug information so if 
-v doesn't give any clues try -v

My guess would be that the file that is being run by ansible is not the 
same as the one you are editing.  One trick I use to debug situations where 
I think my edits aren't being noticed is to deliberately introduce a syntax 
error, so you could try deliberately breaking the yaml in your playbook.

Hope this helps,

Jon


On Friday, January 16, 2015 at 9:09:32 PM UTC, Dimitri Yioulos wrote:
>
> All,
>
> I'm a newbie who's trying to get Ansible to work on a Windows Server 
> client. I followed instructions found here: 
> http://docs.ansible.com/intro_windows.html, and both the Linux-based 
> Ansible control server and Windows client seem to be set up properly.  I 
> originally ran this example playbook (from 
> http://docs.ansible.com/win_feature_module.html):
>
> # Playbook example
> ---
> - name: Install IIS
>   hosts: all
>   gather_facts: false
>   tasks:
> - name: Install IIS
>   win_feature:
> name: "Web-Server"
> state: absent
> restart: yes
> include_sub_features: yes
> include_management_tools: yes
>
> Interestingly, it appeared to *uninstall* IIS. I'm guessing it's because of 
> the line "state: absent" (but I'm a newbie, so what do I know).  So, then I 
> decided to change "absent" to "present", and started to get this error:
>
> Vault password:
> sawintest01 | FAILED >> {
> "failed": true,
> "msg": "A parameter cannot be found that matches parameter name 
> 'IncludeManagementTools'."
> }
>
> OK, so I removed the line "IncludeManagementTools".  Now, every time I run 
> the playbook, I get the same error.  And, if I create a new playbook to 
> install, say SNMP, the same error is still generated, despite the fact that 
> the line "IncludeManagementTools" isn't in the playbook (or any playbooks, 
> at this point).  Huh?  Why does Ansible keep whining about a parameter that 
> I'm not even including?  What am I doing wrong here?
>
> Help would be most gratefully appreciated.
>
> Dimitri
>

-- 
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/1082d2eb-783b-44b8-971f-3b21cd12f0a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows puzzler

2015-01-20 Thread J Hawkesworth
Ok, well I'm still mystified too, but here's a few other thoughts.

Might be worth checking what is between the controller and the windows 
machine network wise in case there's some proxying or something.  Would 
still be very strange behaviour for a proxy to introduce though.

I notice you have 

gather_facts: false 

might be worth setting that to true and running with -v just to see if the 
facts that get gathered tally with what you expect about the windows 
machine.

Something else that might show a bit more information is if you set 

ANSIBLE_KEEP_REMOTE_FILES=1

before running your playbook, it won't remove the files transferred to the 
remote machine.  From memory you'll need - to see the location where 
the files are transferred to.
You can then at least see what powershell is being run, which might help 
figure out what is going on.

Hope this helps,

Jon

On Monday, January 19, 2015 at 4:09:30 PM UTC, Dimitri Yioulos wrote:
>
>
> Thanks, Jon.
>
> I have used - to get as much debugging information as possible, and I 
> presented it in my op.  Only one instance of my playbook exists, and it 
> doesn't include the parameter 'IncludeManagementTools', though that was in 
> the example playbook that I used from Puppet documentation.  It's like the 
> original is cached somewhere and, if it is, I don't know where that 
> somewhere is.  As I mentioned, if I use the parameter "state: absent", the 
> playbook works to uninstall the service if it's installed.  But it fails if 
> I use the parameter "state: present".  Yeesh.
>
> Dimitri
>

-- 
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/b93a562f-73d8-481e-97fb-3e97e557d1a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows access denied

2015-01-20 Thread J Hawkesworth
A few things you could try...

check the windows event log

Check the user you are connecting with is actually a member of the 
administrators group.

log in to the windows machine as the same user you are connecting via 
ansible with and attempt to run the same msi.

Hope this helps,

Jon

On Tuesday, January 20, 2015 at 7:49:41 AM UTC, KlimaXima wrote:
>
> Hello all,
>
> I am following this turorial http://docs.ansible.com/intro_windows.html 
> to install the python on ansible but i keep running into problem. I think 
> it has something to do with the windows run as administrator or something.
>
> Here is what ansible says:
> This installation package could not be opened.  Verify that the package 
> exists and that you can access it, or contact the application vendor to 
> verify that this is a valid Windows Installer package.
>
> This is my playbook code:
> - name: Run the script
>   hosts: windows_server
>   tasks:
> - name: Install Python
>   win_msi:
> path="C:/Users/vagrant/Downloads/python-2.7.9.msi" state=present
>
> I can ping to my server run the raw commend like ipconfig and retrieve the 
> output but can't seem to download or install anything.
>
> Thank you so much for your 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/6f405ef5-48ee-4949-a5db-625e7b147e61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows puzzler redux

2015-02-08 Thread J Hawkesworth
It sounds like a network issue.

Here's a few things you could try:

1/ See Chris Church's suggestion on this thread for a curl command to test 
the communication:

https://groups.google.com/d/msgid/ansible-project/6e7dd49d-d56b-4f2e-8254-9ab0fd2a96f8%40googlegroups.com?utm_medium=email&utm_source=footer

2/ Check you are using the correct port 5986 for https, 5985 for http

3/ Check your machine names are resolvable by your local dns.

4/ Check the windows event log on your managed hosts.  When things are 
working there will be a login event.

5/ run with -v to see all the communication logging between ansible and 
your managed windows hosts.

3/ Check your machine names are resolvable from your Ansible master.

4/ Check the windows event log on your managed hosts.  When things are 
working, there will be a login event.  If there's no login event its 
probably not finished setting up the communications channel.

5/ run ansible-playbook -v to see all the communication logging between 
ansible and your managed windows machine.

Hope this helps,

Jon

On Saturday, February 7, 2015 at 6:23:35 PM UTC, Dimitri Yioulos wrote:
>
> All,
>
> After ultimately having set up a test Windows Server 2008 R2 box to work 
> with Ansible (it failed at first, but I thought I had solved the problem at 
> the Ansible control), I've tried to get it working on two other Server 
> boxes.  I set these up via the instructions found at 
> http://docs.ansible.com/intro_windows.html.  However, whereas my test 
> server returns "success" to win_ping, the newly set up boxes return 
> "Servername | FAILED => 500 WinRMTransport. [Errno 104] Connection reset by 
> peer".  I've tried everything I can (e.g. disabled Windows Firewall, added 
> a Windows hotfix, etc.), but nothing is working.  Does anyone have any 
> ideas as to why this isn't working?
>
> Many thanks.
>

-- 
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/a99cdc4e-75ca-44d6-acb9-d8b8b6591bbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_template and line breaks

2015-02-11 Thread J Hawkesworth
Hi,

Been meaning to say I discovered a few days ago that you can set the 
following in your j2 templates to ensure windows-style line endings

#jinja2: newline_sequence:'\r\n'

I still want to do automatic detection of this but there is at least a 
workaround (which would likely be backwardly compatible once auto detection 
is in place).

Jon



On Thursday, December 18, 2014 at 5:48:02 PM UTC, Joey wrote:
>
> I'm using win_template to copy a text file with a couple variables to a 
> windows client. However, it seems to be removing all lines breaks from the 
> file. I tried using unix2dos on the template, as well as adding 
> "#jinja2:trim_blocks: 
> False", but neither one seemed to work. Any other ideas?
>

-- 
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/1da08be1-7573-495a-9ea7-d573fe5e9858%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using YAML ansible-playbook -e EXTRA_VARS

2015-02-11 Thread J Hawkesworth
I can't test this right now but I think you need to add @ when you want the 
vars to be loaded from a file:
i.e.

   $ ansilble-playbook -e "@var.yml" playbook.yml

Documentation only shows example for json, but reading the text implies it 
would also work with yaml.

http://docs.ansible.com/playbooks_variables.html#passing-variables-on-the-command-line



On Wednesday, February 11, 2015 at 4:56:32 PM UTC, Paulo Gabriel Poiati 
wrote:
>
> Hello all,
>
> I'm struggle with this command line option. How can I use an YAML file 
> with the `-e` option?
>
> `$ ansilble-playbook -e /path/to/my/var.yml playbook.yml` doesn't works.
>
> I'm using ansible 1.8.2.
>
> Thanks in advance.
>

-- 
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/111adbf0-268d-4d1a-8598-c3af3ad85207%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] vsphere_guest module not recognizing from_template param

2015-02-17 Thread J Hawkesworth
Can you share your playbook? 

-- 
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/f9f79ccd-c255-4707-a946-a48835af26d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Caching get_url tasks

2015-02-18 Thread J Hawkesworth
Are you running get_url as a local action?  (on the ansible master rather 
than on your managed machines)?

I'd be tempted to try using something like varnish myself.

Jon

On Wednesday, February 18, 2015 at 9:02:00 AM UTC, Warren Seine wrote:
>
> Hi,
>
> For performance (faster first deployment), safety (in case the third party 
> goes down), and bad connectivity (no internet) reasons, I'd like to cache 
> downloads made with get_url.
>
> I know this can be done manually, but I wonder if there's a module to do 
> it. Would a cache=yes property make sense in the get_url module?
>
> Regards,
> Warren.
>

-- 
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/a9293f56-4f02-41ba-9a88-c5156f65ca3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Connecting winrm module from Ansible on Linux

2015-02-20 Thread J Hawkesworth
I think I had this on a fresh Windows Server 2008 R2 installation which had 
not received any windows updates. 
If I recall there was a bug which caused the maximum amount of memory 
available to processes started by powershell to be very small, which was 
fixed in a subsequent hotfix.
Is your windows server 2008 machine fully up to date with windows updates?

Jon

On Friday, February 20, 2015 at 10:52:22 AM UTC, satheesh kumar wrote:
>
> Hi,
>
> It was my mistake that I tried connecting to Windows server 2008 (PS2), 
> whereas I am checking PS version from Windows server 2012.
>
> Now, I upgraded Windows server 2008 poweshell version to PS3, using same 
> steps mentioned in ansible for windows documentstion.
>
> It successfuly pings, but when i run any other commands for like 
> # ansible windows -m setup -
>
> I am getting below error:
>
> failed: [winserver.cloudapp.net] => {"failed": true, "parsed": false}
>
> Process is terminated due to StackOverflowException.
>
>
>
> STACKTRACE:
>
> $ ansible windows -m setup -
>  ESTABLISH WINRM CONNECTION FOR USER: coremedia 
> on PORT 5986 TO winserver.cloudapp.net
>  WINRM CONNECT: transport=plaintext endpoint=
> https://winserver.cloudapp.net:5986/wsman
>  REMOTE_MODULE setup
>  EXEC (New-Item -Type Directory -Path $env:temp 
> -Name "ansible-tmp-1424429207.53-10354320142574").FullName | Write-Host 
> -Separator '';
>  WINRM EXEC 'PowerShell' ['-NoProfile', 
> '-NonInteractive', '-EncodedCommand', 
> 'KABOAGUAdwAtAEkAdABlAG0AIAAtAFQAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQBuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMgA0ADQAMgA5ADIAMAA3AC4ANQAzAC0AMQAwADMANQA0ADMAMgAwADEANAAyADUANwA0ACIAKQAuAEYAdQBsAGwATgBhAG0AZQAgAHwAIABXAHIAaQB0AGUALQBIAG8AcwB0ACAALQBTAGUAcABhAHIAYQB0AG8AcgAgACcAJwA7AA==']
>  WINRM RESULT  "C:\Users\coremedia\A", err "">
>  PUT /tmp/tmpgISwtQ TO 
> C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\setup
>  WINRM PUT /tmp/tmpgISwtQ to 
> C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\setup.ps1
>  
> (offset=0 size=2037)
>  WINRM PUT /tmp/tmpgISwtQ to 
> C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\setup.ps1
>  
> (offset=2037 size=2037)
>  WINRM PUT /tmp/tmpgISwtQ to 
> C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\setup.ps1
>  
> (offset=4074 size=2037)
>  WINRM PUT /tmp/tmpgISwtQ to 
> C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\setup.ps1
>  
> (offset=6111 size=2037)
>  WINRM PUT /tmp/tmpgISwtQ to 
> C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\setup.ps1
>  
> (offset=8148 size=446)
>  PUT /tmp/tmpt9SWcw TO 
> C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\arguments
>  WINRM PUT /tmp/tmpt9SWcw to 
> C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\arguments
>  
> (offset=0 size=2)
>  EXEC PowerShell -NoProfile -NonInteractive 
> -ExecutionPolicy Unrestricted -File 
> "C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\setup.ps1"
>  
> "C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\\arguments";
>  
> Remove-Item 
> "C:\Users\coremedia\AppData\Local\Temp\ansible-tmp-1424429207.53-10354320142574\"
>  
> -Force -Recurse;
>  WINRM EXEC 'PowerShell' ['-NoProfile', 
> '-NonInteractive', '-EncodedCommand', 
> 'UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARgBpAGwAZQAgACIAQwA6AFwAVQBzAGUAcgBzAFwAYwBvAHIAZQBtAGUAZABpAGEAXABBAHAAcABEAGEAdABhAFwATABvAGMAYQBsAFwAVABlAG0AcABcAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANAAyADQANAAyADkAMgAwADcALgA1ADMALQAxADAAMwA1ADQAMwAyADAAMQA0ADIANQA3ADQAXABcAHMAZQB0AHUAcAAuAHAAcwAxACIAIAAiAEMAOgBcAFUAcwBlAHIAcwBcAGMAbwByAGUAbQBlAGQAaQBhAFwAQQBwAHAARABhAHQAYQBcAEwAbwBjAGEAbABcAFQAZQBtAHAAXABhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMgA0ADQAMgA5ADIAMAA3AC4ANQAzAC0AMQAwADMANQA0ADMAMgAwADEANAAyADUANwA0AFwAXABhAHIAZwB1AG0AZQBuAHQAcwAiADsAIABSAGUAbQBvAHYAZQAtAEkAdABlAG0AIAAiAEMAOgBcAFUAcwBlAHIAcwBcAGMAbwByAGUAbQBlAGQAaQBhAFwAQQBwAHAARABhAHQAYQBcAEwAbwBjAGEAbABcAFQAZQBtAHAAXABhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMgA0ADQAMgA5ADIAMAA3AC4ANQAzAC0AMQAwADMANQA0ADMAMgAwADEANAAyADUANwA0AFwAIgAgAC0ARgBvAHIAYwBlACAALQBSAGUAYwB1AHIAcwBlADsA']
>  WINRM RESULT 
> winserver.cloudapp.net | FAILED >> {
> "failed": true, 
> "msg": "", 
> "parsed": false
> }
>
>
> Can somebody help me out please
>
>
>

-- 
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

[ansible-project] Re: Connecting winrm module from Ansible on Linux

2015-02-20 Thread J Hawkesworth
This is the hotfix 

 http://support.microsoft.com/kb/2842230 

All the best, 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/959c4a48-90e8-47e8-b557-43a310a5a93d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Winrm connection error - 500 WinRMTransport. [Errno -2] Name or service not known

2015-03-02 Thread J Hawkesworth
Can your ansible controller machine resolve the name 
windowsserver.cloudapp.net to an ip address?
If so, check that firewalling alllows connections to port 5986.

On Monday, March 2, 2015 at 12:34:17 AM UTC, satheesh kumar wrote:
>
> I tried to ping windows server from ansible, and getting the below error:
>
> $ ansible windows -m win_ping -
>  ESTABLISH WINRM CONNECTION FOR USER: 
> windowsuser on PORT 5986 TO windowsserver.cloudapp.net
>  WINRM CONNECT: transport=plaintext endpoint=
> https://windowsserver.cloudapp.net:5986/wsman
>  WINRM CONNECTION ERROR: 500 WinRMTransport. 
> [Errno -2] Name or service not known
>  WINRM CONNECT: transport=plaintext endpoint=
> http://windowsserver.cloudapp.net:5986/wsman
>  WINRM CONNECTION ERROR: 500 WinRMTransport. 
> [Errno -2] Name or service not known
> windowsserver.cloudapp.net | FAILED => 500 WinRMTransport. [Errno -2] 
> Name or service not known
>
>
> I have correct host under inventories/hosts file, and windows user/pass 
> under group_vars/windows.yml
>
> It worked fine earlier some time back, but has name or service not known 
> error. where might be the issue?
>

-- 
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/60cc9386-80f5-484e-a223-1f95dd3ebd6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using Ansible to update Windows servers

2015-03-26 Thread J Hawkesworth
Hi Dimitri,


A few others have reported StackOverflow and OutOfMemory exceptions on 
unpatched Server 2008 machines - 
see https://github.com/ansible/ansible/pull/8345#issuecomment-52074837 for 
a hotfix that worked for me.

By the way you can put any custom modules you want to use in your 
/etc/ansible/library rather than have to insert things into your actual 
ansible installation.

What ansible version are you using?
Are you connecting as a local user or a domain user?

Also possibly sounds close to this bug report:

https://github.com/ansible/ansible-modules-extras/issues/275

Hope some of the above helps,

Jon

On Thursday, March 26, 2015 at 2:27:10 PM UTC, Dimitri Yioulos wrote:
>
> All,
>
> I've got Ansible working on a few Windows 2008 servers.  The Ansible 
> command server runs CentOS 6.  I'm trying to get the module "win_updates" 
> working, but am not having much success.  I'd like to be able to run this 
> both via the command line, and via a playbook.  The extant documentation 
> isn't very detailed.  Here's what I've done/am trying (sorry, this will 
> probably be long):
>
> * I had to download the windows module of which win_updates is a part, and 
> manually put it in 
> "/usr/lib/python2.6/site-packages/ansible/modules/extras/"
> * I installed "PSWindowsUpdate" on the Windows server
> * If I run the command "ansible myhost -m win_updates", I get the 
> following output:
>
> myhost | success >> {
> "changed": false, 
> "updates_already_present": null, 
> "updates_category": "critical", 
> "updates_installed": [], 
> "updates_installed_afterwards": null, 
> "updates_installed_count": 0, 
> "updates_reboot_needed": true, 
> "updates_success": "true"
> }
>
> Fine, but the updates aren't done.  So, I figure I need an argument.  The 
> win_updates document gives the following example:
>
> # Install updates from security category
> win_updates:
>   category: security
>
> I've tried every combination I can think of, as in:
>
> "ansible myhost -m win_updates -a category=security" and  "ansible myhost -m 
> win_updates -a security" and "ansible myhost -m win_updates -a 
> category:security", and I get something like this:
>
> myhost | FAILED >> {
> "failed": true, 
> "msg": "\nProcess is terminated due to StackOverflowException.\n", 
> "parsed": false
> }
>
> * I created the following playbook:
>
> ---
>
> - name: update windows
>   hosts: windows
>   gather_facts: true
>   tasks:
> - name: win update
>   win_updates:
> category: security
>
> It, too, fails, with a much more verbose error message (which I'll skip 
> posting, for now).  I've tried other combinations in the playbook and, they 
> too, fail.
>
> I would greatly appreciate help in getting this to work, both from the 
> command line and from a playbook.
>
> Dimitri
>
>

-- 
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/4082c132-efb5-4b16-8218-98718cb01c40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using Ansible to update Windows servers

2015-03-26 Thread J Hawkesworth
What happens if you reboot the box?  I haven't tried this myself but I've 
seen windows delay applying updates until shutdown (and I think following a 
reboot too in some cases).

Might need a bit of work judging by the comments but there is a win_reboot 
module which you could try.
https://github.com/ansible/ansible/pull/8946/files

Jon

On Thursday, March 26, 2015 at 7:16:01 PM UTC, Dimitri Yioulos wrote:
>
> Hi, Jon.
>
> I appreciate the response, and certainly will look into your suggestions.  
> I'm using version 1.8.4.
>
> As I've continued to hack away, I've got this to work, kind of:
>
> ansible somehost -m win_updates -a category:security
>
> The output looks like this:
>
> somehostb | success >> {
> "changed": true, 
> "updates_already_present": [
> "2506014", 
> "2506212", 
> "2511455", 
> "2509553", 
> "2506928",
>   ~
> "updates_category": "critical", 
> "updates_installed": [], 
> "updates_installed_afterwards": [
> "2506014", 
> "2506212", 
> "2511455", 
> "2509553", 
> "2506928", 
>   ~
> "updates_installed_count": 0, 
> "updates_reboot_needed": true, 
> "updates_success": "true"
> }
>
> The curious thing is that no updates are made, despite the fact that 
> updates are available on the Win server, and they are of the category 
> "Security", as in the following:
>
> Security Update for Windows Server 2008 R2 x64 Edition (KB3002657)
> Download size: 1.3 MB
> You may need to restart your computer for this update to take effect.
> Update type: Important
>
> That comes from the Windows Update Manager.  I tried changing 
> "Category:security" to "Category:important", and still no joy.
>
> Ideas?
>
>
> On Thursday, March 26, 2015 at 10:27:10 AM UTC-4, Dimitri Yioulos wrote:
>>
>> All,
>>
>> I've got Ansible working on a few Windows 2008 servers.  The Ansible 
>> command server runs CentOS 6.  I'm trying to get the module "win_updates" 
>> working, but am not having much success.  I'd like to be able to run this 
>> both via the command line, and via a playbook.  The extant documentation 
>> isn't very detailed.  Here's what I've done/am trying (sorry, this will 
>> probably be long):
>>
>> * I had to download the windows module of which win_updates is a part, 
>> and manually put it in 
>> "/usr/lib/python2.6/site-packages/ansible/modules/extras/"
>> * I installed "PSWindowsUpdate" on the Windows server
>> * If I run the command "ansible myhost -m win_updates", I get the 
>> following output:
>>
>> myhost | success >> {
>> "changed": false, 
>> "updates_already_present": null, 
>> "updates_category": "critical", 
>> "updates_installed": [], 
>> "updates_installed_afterwards": null, 
>> "updates_installed_count": 0, 
>> "updates_reboot_needed": true, 
>> "updates_success": "true"
>> }
>>
>> Fine, but the updates aren't done.  So, I figure I need an argument.  The 
>> win_updates document gives the following example:
>>
>> # Install updates from security category
>> win_updates:
>>   category: security
>>
>> I've tried every combination I can think of, as in:
>>
>> "ansible myhost -m win_updates -a category=security" and  "ansible myhost -m 
>> win_updates -a security" and "ansible myhost -m win_updates -a 
>> category:security", and I get something like this:
>>
>> myhost | FAILED >> {
>> "failed": true, 
>> "msg": "\nProcess is terminated due to StackOverflowException.\n", 
>> "parsed": false
>> }
>>
>> * I created the following playbook:
>>
>> ---
>>
>> - name: update windows
>>   hosts: windows
>>   gather_facts: true
>>   tasks:
>> - name: win update
>>   win_updates:
>> category: security
>>
>> It, too, fails, with a much more verbose error message (which I'll skip 
>> posting, for now).  I've tried other combinations in the playbook and, they 
>> too, fail.
>>
>> I would greatly appreciate help in getting this to work, both from the 
>> command line and from a playbook.
>>
>> Dimitri
>>
>>

-- 
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/1109a545-2032-4f69-adb1-5e1261d041a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Failing to connect to Windows clients with 1.9.0 -- No credentials cache file found

2015-03-29 Thread J Hawkesworth
If I recall, if you have pykerberos installed, winrm will attempt kerberos 
connection. 

I guess your options are to remove pykerberos or use knit to acquire a kerberos 
ticket and connect as a domain user. 

Hope that helps. 

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/2428e714-a731-4db0-accc-a455fb264fc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Failing to connect to Windows clients with 1.9.0 -- No credentials cache file found

2015-04-03 Thread J Hawkesworth
I'm not sure there's a one-size fits all solution to this.

Personally I use a callback plugin to call kinit and acquire the necessary 
kerberos ticket whenever I start running a playbook.  This works for me as 
I want my ansible controller to be able to work with > 1 domain. Its not 
ideal as it will only work for ansible-playbook and not ansible commands.  
I've read that others use a local action to call kinit as their first task 
and I believe others are happy to have an ansible controller per domain and 
have kinit set up the kerberos ticket when you log in.  

Jon

On Monday, March 30, 2015 at 11:33:32 PM UTC+1, Peter Loron wrote:
>
> Well, apparently there's *some* kind of python glue installed. I did kinit 
> to acquire a ticket for the appropriate user, and I was able to get it to 
> work.
>
> There still needs to be a switch. I don't want to muck about with kinit 
> every time I want to run playbooks.
>
> On Monday, March 30, 2015 at 2:26:23 PM UTC-7, Peter Loron wrote:
>>
>> As far as I know, I do not have pykerberos installed. If I start the 
>> default python and do "import kerberos", it fails.
>>
>> Regardless, there should be an option to force the connection type.
>>
>> On Sunday, March 29, 2015 at 2:56:26 PM UTC-7, J Hawkesworth wrote:
>>>
>>> If I recall, if you have pykerberos installed, winrm will attempt 
>>> kerberos connection. 
>>>
>>> I guess your options are to remove pykerberos or use knit to acquire a 
>>> kerberos ticket and connect as a domain user. 
>>>
>>> Hope that helps. 
>>>
>>> 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/cd6a5785-650d-46f5-a0cf-40706787025a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Connection refused

2015-04-07 Thread J Hawkesworth
It looks like you are making an ssh connection so it appears your vars are 
not getting picked up.
Since your config has a user 'ansible' but the logging output shows you are 
connecting as 'ansmgr', and clearly connecting to port 22 not 5986  I am 
wondering if you are picking up the inventory / hosts file that you expect?

Jon

On Thursday, April 2, 2015 at 9:22:58 PM UTC+1, skinnedknuckles wrote:
>
> Thanks for the tip.  In my case it would be simpler to keep everything in 
> the hosts file.
>
> But actually I did have the ansible_ssh vars in the 
> etc/ansible/group_vars/windows.yml
>
> On Thursday, April 2, 2015 at 12:31:25 PM UTC-5, skinnedknuckles wrote:
>>
>> I'm having trouble getting win_ping to work with or without SSL.  Here 
>> are my details...
>>
>>
>> CentOS Linux release 7.1.1503 (Core)
>>
>> ansible 1.8 (devel 57d2622c8c) last updated 2014/10/17 18:19:13 (GMT -500)
>>
>>
>> using pywinrm-0.0.3-py2.7
>>
>>
>> I started winrm on the remote node using this script from Hindenes/Church 
>> 
>>
>>
>> windows.yml file contains... 
>>
>>
>> ansible_ssh_user: ansible 
>>
>> ansivle_ssh_pass: ansible123 
>>
>> ansible_ssh_port: 5986 
>>
>> ansible_connection: winrm
>>
>>  
>>
>> hosts file contains...
>>
>> [windows] 
>> ComputerName
>>
>>  
>>
>>
>> This is my output when trying to run win_ping
>>
>> [ansmgr@dhcp1-60-20 ansible]$ ansible windows -m win_ping - 
>>
>> http://ads-6999.am.ad.seagate.com>> ESTABLISH 
>> CONNECTION FOR USER: ansmgr 
>>
>> http://ads-6999.am.ad.seagate.com>> REMOTE_MODULE 
>> win_ping 
>>
>> http://ads-6999.am.ad.seagate.com>> EXEC ssh -C -tt 
>> -vvv -o ControlMaster=auto -o ControlPersist=60s -o 
>> ControlPath=/home/ansmgr/.ansible/cp/ansible-ssh-%h-%p-%r -o 
>> KbdInteractiveAuthentication=no -o 
>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
>> -o PasswordAuthentication=no -o ConnectTimeout=10 www.example.com 
>>  /bin/sh -c 'mkdir -p 
>> $HOME/.ansible/tmp/ansible-tmp-1427994666.99-36837830948182 && chmod a+rx 
>> $HOME/.ansible/tmp/ansible-tmp-1427994666.99-36837830948182 && echo 
>> $HOME/.ansible/tmp/ansible-tmp-1427994666.99-36837830948182' 
>>
>> www.example.com  | FAILED => SSH 
>> encountered an unknown error. The output was: 
>>
>> OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013 
>>
>> debug1: Reading configuration data /etc/ssh/ssh_config 
>>
>> debug1: /etc/ssh/ssh_config line 56: Applying options for * 
>>
>> debug1: auto-mux: Trying existing master 
>>
>> debug1: Control socket 
>> "/home/ansmgr/.ansible/cp/ansible-ssh-www.example.com-22-ansmgr" does not 
>> exist 
>>
>> debug2: ssh_connect: needpriv 0 
>>
>> debug1: Connecting to www.example.com  
>> [123.123.123.123] port 22. 
>>
>> debug2: fd 3 setting O_NONBLOCK 
>>
>> debug1: connect to address 123.123.123.123 port 22: Connection refused 
>>
>> ssh: connect to host www.example.com  
>> port 22: Connection refused 
>>
>>  
>>
>

-- 
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/e8818ff4-57ad-4142-b659-6ebb3bbde34e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: trying to use win_get_url and win_msi together

2015-04-24 Thread J Hawkesworth
Can you show us your playbook? - it does sound like a syntax error.  You 
definitely need to specify an http url with win_get_url.

Jon

On Thursday, April 23, 2015 at 10:09:04 PM UTC+1, Aishwarya Muraleedharan 
wrote:
>
> Hi, I am trying to write a playbook to download a msi file from the 
> internet to my local disk and then use "win_msi" to install the msi 
> application to my Windows client.
>
> Bu when ever I run my playbook, I get an error,
>
> failed: [host2] => {"failed":true}
> msg: Error downloading logserver.com/test.msi to C:\test.msi
>
> FATAL: all hosts have already failed -- aborting
>
> I also read in one of the blogs that win_get_url works only for urls that 
> start with "http://..."; . Is that why my playbook fails?
>
>

-- 
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/1f21243a-7749-4e49-86c7-65f2d4fe738d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: win_updates not working

2016-01-06 Thread J Hawkesworth
Which ansible version are you using?

If I recall 1.9.1 didn't always set correct execution policy.

I would recommend 1.9.4 at least and try 2.0 if you can.

On Friday, January 1, 2016 at 2:54:52 PM UTC, Joseph Jenkins wrote:
>
> I am logging with the local administrator account does that not suffice to 
> get an administrator shell? 
>
>
> Joe 
>
> > On Dec 31, 2015, at 10:53 PM, Brian Coca  > wrote: 
> > 
> > Currently Ansible does not support 'run as' so you have to login with 
> > a user with admin privileges if you need them. 
> > 
> > 
> > -- 
> > Brian Coca 
> > 
> > -- 
> > You received this message because you are subscribed to a topic in the 
> Google Groups "Ansible Project" group. 
> > To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/ansible-project/ryvTWUb0Kvg/unsubscribe. 
>
> > To unsubscribe from this group and all its topics, 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/CAJ5XC8%3DC%2BH-Y1xfnB%2Bts0ZeCvXx0RL1T_A1huhBoDyxxhvnL4Q%40mail.gmail.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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/389ec4a2-0a2e-4ab3-af14-9b15857c48be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] win_updates not working

2016-01-06 Thread J Hawkesworth
Tiwhat powershell version, version of Windows Management Framework and 
version of windows are you running this against?



On Wednesday, January 6, 2016 at 4:55:54 PM UTC, Joseph Jenkins wrote:
>
> So I updated to Ansible 2.0 had to fix a few things like log_path is now 
> required, but I am getting this error when running:
>
> An exception occurred during task execution. The full traceback is:
> At 
> C:\Users\jjenkins_da\AppData\Local\Temp\ansible-tmp-1452099077.0-277924138780563\win_updates.ps1:536
>  
> char:6
> +   if($schedjob.RunAsTask) {
> +  ~~~
> fatal: [caveeam3.hottopic.com]: FAILED! => {"changed": false, "failed": 
> true, "msg": "Property 'RunAsTask' cannot be found on this object. Make 
> sure that it exists.”}
>
>
>
> On Jan 6, 2016, at 7:15 AM, Joseph Jenkins  > wrote:
>
> I am running 1.9.4. I also as a test setup kerberos auth and ran the 
> process with a Domain Admin account, but that didn’t work either. Same 
> issue. Let me try getting 2.0 and see if that solves it.
>
> On Jan 6, 2016, at 7:06 AM, J Hawkesworth  > wrote:
>
> Which ansible version are you using?
>
> If I recall 1.9.1 didn't always set correct execution policy.
>
> I would recommend 1.9.4 at least and try 2.0 if you can.
>
> On Friday, January 1, 2016 at 2:54:52 PM UTC, Joseph Jenkins wrote:
>>
>> I am logging with the local administrator account does that not suffice 
>> to get an administrator shell? 
>>
>>
>> Joe 
>>
>> > On Dec 31, 2015, at 10:53 PM, Brian Coca  wrote: 
>> > 
>> > Currently Ansible does not support 'run as' so you have to login with 
>> > a user with admin privileges if you need them. 
>> > 
>> > 
>> > -- 
>> > Brian Coca 
>> > 
>> > -- 
>> > You received this message because you are subscribed to a topic in the 
>> Google Groups "Ansible Project" group. 
>> > To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/ansible-project/ryvTWUb0Kvg/unsubscribe. 
>>
>> > To unsubscribe from this group and all its topics, 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/CAJ5XC8%3DC%2BH-Y1xfnB%2Bts0ZeCvXx0RL1T_A1huhBoDyxxhvnL4Q%40mail.gmail.com.
>>  
>>
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/ansible-project/ryvTWUb0Kvg/unsubscribe.
> To unsubscribe from this group and all its topics, 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/389ec4a2-0a2e-4ab3-af14-9b15857c48be%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/ansible-project/389ec4a2-0a2e-4ab3-af14-9b15857c48be%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/ansible-project/ryvTWUb0Kvg/unsubscribe.
> To unsubscribe from this group and all its topics, 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/101E954F-49CE-44E7-AC80-D45ADDA392B2%40me.com
>  
> <https://groups.google.com/d/msgid/ansible-project/101E954F-49CE-44E7-AC80-D45ADDA392B2%40me.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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/f1640928-792a-4729-8944-c0ac947661a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible windows kerberos issue

2016-01-18 Thread J Hawkesworth
Hi Mayur,

You usually get that message when kerberos is not configured properly on 
your ansible controller.

Please ensure you have followed the setup instructions here:

http://docs.ansible.com/ansible/intro_windows.html#configuring-kerberos

Without this, the ansible controller does cannot connect to your windows 
domain, because it is unaware of the network location of your windows 
domain controllers.

Hope this helps,

Jon

On Friday, January 15, 2016 at 6:54:39 PM UTC, Mayur Barge wrote:
>
> Hi I'm facing below issue while connecting to windows machine using AD 
> accounts 
>
>
> File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 
> 586, in _executor
> exec_rc = self._executor_internal(host, new_stdin)
>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 
> 789, in _executor_internal
> return self._executor_internal_inner(host, self.module_name, 
> self.module_args, inject, port, complex_args=complex_args)
>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 
> 968, in _executor_internal_inner
> conn = self.connector.connect(actual_host, actual_port, actual_user, 
> actual_pass, actual_transport, actual_private_key_file, delegate_host)
>   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py", 
> line 52, in connect
> self.active = conn.connect()
>   File 
> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>  
> line 140, in connect
> self.protocol = self._winrm_connect()
>   File 
> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>  
> line 96, in _winrm_connect
> protocol.send_message('')
>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 193, in 
> send_message
> return self.transport.send_message(message)
>   File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 269, in 
> send_message
> krb_ticket = KerberosTicket(self.krb_service)
>   File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 205, in 
> __init__
> kerberos.authGSSClientStep(krb_context, '')
> GSSError: (('Unspecified GSS failure.  Minor code may provide more 
> information', 851968), ('Server not found in Kerberos database', 
> -1765328377))
>
>
> Please help
>
> Thanks,
> Mayur
>
>

-- 
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/102e25aa-e4c7-4314-9856-47197f9906fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Connecting to Windows AD accounts

2016-01-18 Thread J Hawkesworth
There's a few things that could be wrong

1/ the password supplied is not correct for the user you are connecting as

2/ you must specify the domain in UPPER CASE letters.  

3/ you must use the full domain name, not just the first part

so 

u...@my.company.com
not
user@MY

3/ you must use an @ to separate between the username and the domain name

Probably others too, but check these first.

Also check the windows event viewer to see if the login request is reaching 
your windows machine.

Hope this helps,

Jon

On Friday, January 15, 2016 at 6:43:01 PM UTC, Mayur Barge wrote:
>
> Is anyone facing 
> FAILED => 401 Unauthorized. basic auth failed
> issue for AD domain account
>
> what could go wrong ?
>
>

-- 
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/ed41b327-e089-4351-ab64-e8c906eee612%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: action_plugin/ vs library/ module

2016-01-22 Thread J Hawkesworth
Taking a step back, what problem are you trying to solve?

Depending on what you are trying to do, you might be able to solve the 
problem using the existing modules working together in a (re-usable) role.

Jon
On Thursday, January 21, 2016 at 11:00:35 PM UTC, Mike Biancaniello wrote:
>
> So, what's the deal with action_plugins? There is very little 
> documentation on their purpose.
>
> Observations:
> 1. If action_plugin/foo.py and library/foo.py both exist, then only 
> action_plugin/foo.py gets called (the plugin *may* call the module if it 
> wants, but that is not by default).
> 2. If library/foo.py exists, but there is no corresponding action_plugin, 
> the library is called.
> 3. If action_plugin/foo.py exists, but there is no corresponding module, 
> then Ansible throws a syntax error.
> 4. If action_plugin/foo.py exists, and the library is empty (literally 
> created with 'touch library/foo.py'), then the action_plugin is called and 
> everything works.
> 5. *some*times, but no always, the action_plugin does some preliminary 
> work with data that is not available to the library or the option plugin 
> modifies the results.
>
> For #5, I can understand a solid use case. If a vendor supplies a module 
> and you want to use it, but would prefer to have the data returned 
> differently (or strip out data or whatever) but don't want to modify the 
> vendor's module, then this makes a lot of sense as a module wrapper.
>
> I need to write a module and can't decide if I should write a standard 
> library module or if I should write an action_plugin with a blank library 
> module (I suppose just to use for documentation, though that seems odd).
>
> any clarification would 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/4b4442a0-7517-4341-85c0-806e29608a1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Remote Windows batch script says completed successful, but did not work

2016-01-22 Thread J Hawkesworth
My guess would be you need to run as a privileged user, such as Administrator. 

There is a PR for a win_share module which sounds like just what you are after 
though. 

I will dig out the link. 

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/a6ebafbc-6401-4942-959e-09c0eca9bb3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Remote Windows batch script says completed successful, but did not work

2016-01-22 Thread J Hawkesworth
My guess would be you need to run as a privileged user, such as Administrator. 

There is a PR for a win_share module which sounds like just what you are after 
though. 

I will dig out the link. 

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/8a1d0fac-5c3d-4905-bc29-a34c4d0ab653%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Remote Windows batch script says completed successful, but did not work

2016-01-22 Thread J Hawkesworth
It's here 

 https://github.com/ansible/ansible-modules-extras/pull/1213

Would be great if you could test it as it would get it one step closer to being 
included in Ansible. 

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/bbe75488-9000-480e-8cf5-200f72079d53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible Windows Winrm Authentication or permission failure.

2016-01-25 Thread J Hawkesworth
Someone else has posted something simliar as a bug report here 
- https://github.com/ansible/ansible/issues/14085

Since both you and the bug reporter are experiencing a failure to create a 
directory in the user's temp folder, I'm wondering if your users' temp 
folder is actually present?

The command that is failing in your case is as follows:

Set-StrictMode -Version Latest
(New-Item -Type Directory -Path $env:temp -Name 
"ansible-tmp-1453456566.48-573286182894").FullName | Write-Host -Separator 
'';

can you run the following and see if you get an error message?

   gci -Path $env:temp

(interactively and via the 'raw' module too, preferably).

Not sure what is going on but hoping this might throw some light on the 
problem.

Jon






On Monday, January 25, 2016 at 4:39:00 PM UTC, Joe Levis wrote:
>
> Hm, that's interesting. It doesn't make sense that raw commands work but 
> not the basic win_ping module. Yes, it does sound like it's something to do 
> with your module or pywinrm setup.
>
> My main issue for connection was with kerberos, but that's because the 
> user I'm using to authenticate with is a Domain AD account. I'm assuming 
> your user isn't, since I see vagrant. In which case, the only other thing I 
> noted in my documentation was that I installed:
> apt-get install libffi-dev libssl-dev
>
> DISCLAIMER: I haven't tested if I absolutely needed those. I tried a lot 
> of different things based on postings I found during my Ansible+Windows 
> setup.
>
> Let me know what you find from running other modules.
>
>
> -Joe
>
> On Saturday, January 23, 2016 at 9:26:03 AM UTC-8, Dan Gibbons wrote:
>>
>> Hi Joe,
>>
>> Thanks for getting back to me I did both the items when I setup the 
>> control server and windows client.  Upon further investigation I can 
>> successfully execute raw commands which shows the config is correct, it's 
>> just the win_pin that fails for some reason so I presume I can't run 
>> modules.  I'll try another module when I get back to work but if you have 
>> any other suggestions please let me know.
>>
>> Thanks
>>
>> Dan
>>
>>
>>
>>
>> On Friday, 22 January 2016 18:14:54 UTC, Joe Levis wrote:
>>>
>>> Hi Dan,
>>>
>>> I ran into a lot of issues when trying to get Ansible to connect to my 
>>> remote Windows Server 2012 R2 VM. I finally got it working - maybe my 
>>> solutions will help you.
>>>
>>> *A couple questions:*
>>>
>>>1. Did you set up your Ansible Control Machine following the 
>>>official documentation to a tee (
>>>http://docs.ansible.com/ansible/intro_windows.html)?
>>>2. Have you run the remote setup PS1 script on the target server (
>>>
>>> https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1
>>>)?
>>>
>>>
>>> On Friday, January 22, 2016 at 9:00:30 AM UTC-8, Dan Gibbons wrote:

 Hi,

 I'm doing a POC with Ansible and Puppet but currently I can't even get 
 Ansible to talk to Windows using WinRM.  Here is my setup in Vagrant:

 Control server
 Centos 7.1 with all the right extras installed (pywinrm etc)

 group_vars/windows.yml
 ansible_user: vagrant
 ansible_password: vagrant
 ansible_port: 5985
 ansible_connection: winrm
 ansible_winrm_server_cert_validation: ignore

 Windows 2012 R2
 - Powershell winrm is pretty much open in terms of config (basic auth, 
 allow unencypted)


 I've tested winrm connections from the ansible server using the 
 following python script:
 import winrm

 import winrm

 s = winrm.Session('http://192.168.33.12:5985/wsman', auth=('user', 
 'password'))
 r = s.run_cmd('ipconfig', ['/all'])
 print r.status_code
 print r.std_out
 print r.std_err

 This works successfully and my host Windows desktop can winrm to the 
 target server as well.

 But Ansible just will not work always giving me the following error:

 [root@ansible ansible]# ansible windows -m win_ping -v
 Using /ansible/ansible.cfg as config file
 Loaded callback minimal of type stdout, v2.0
 <192.168.33.12> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 
 5985 TO 192.168.33.12
 <192.168.33.12> WINRM CONNECT: transport=plaintext endpoint=
 http://192.168.33.12:5985/wsman
 <192.168.33.12> EXEC /bin/sh -c 'PowerShell -NoProfile -NonInteractive 
 -ExecutionPolicy Unrestricted -EncodedCommand 
 UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgAoAE4AZQB3AC0ASQB0AGUAbQAgAC0AVAB5AHAAZQAgAEQAaQByAGUAYwB0AG8AcgB5ACAALQBQAGEAdABoACAAJABlAG4AdgA6AHQAZQBtAHAAIAAtAE4AYQBtAGUAIAAiAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANAA1ADMANAA1ADYANQA2ADYALgA0ADgALQA1ADcAMwAyADgANgAxADgAMgA4ADkANAAiACkALgBGAHUAbABsAE4AYQBtAGUAIAB8ACAAVwByAGkAdABlAC0ASABvAHMAdAAgAC0AUwBlAHAAYQByAGEAdABvAHIAIAAnACcAOwA='
 <192.168.33.12> WINRM OPEN SHELL: C6B534E7-4F4B-4AEB-B34A-97FE55EB0225
 <192.168.33.12> WINR

[ansible-project] Re: Windows 2008 R2 - WinRM and disabling TLS 1.0

2016-01-27 Thread J Hawkesworth
Not hit this myself, but seems likely its coming for many of us.

Just wondering if bouncing the winrm service might fix this?  or a 
Restart-Computer (I'd recommend the win_reboot role on galaxy if it really 
does need a reboot) - so many things in windows still need a reboot :-(

I guess it will need to renegotiate after a change like this has been 
made.  

Noticed this when I was searching around - 
https://support.microsoft.com/en-us/kb/3080079 if remote desktop needed a 
change then maybe winrm does too?  No idea at this point if they share any 
logic.

Please let us know if the restart does the trick

Jon


On Tuesday, January 26, 2016 at 2:53:30 AM UTC, Chris Carlson wrote:
>
> Recently, I've undertaken the task of PCI Compliance for several servers I 
> manage. One of the recurring recommendations is to disable TLS 1.0 in favor 
> of TLS 1.1/1.2. 
>
> The good news.. Disabling TLS 1.0 on a group of servers is super easy 
> using Ansible! Sadly, one of the side effects of disabling is that the 
> WinRM connection in my Ansible scripts becomes completely broken afterward. 
> After disabling, connecting to Windows servers results in the following 
> error:
>
> fatal: [10.0.20.20]: FAILED! => {"failed": true, "msg": "ERROR! ssl: 500 
> WinRMTransport. [Errno 54] Connection reset by peer"}
>
> Re-enabling TLS 1.0 will correct the issue, but obviously it's not ideal 
> and I'm wondering what can be done.. So, some questions:
>
> 1. Is TLS 1.0 required in Windows, or is it something in pywinrm package?
> 2. If TLS 1.0 must be used, is there an interim solution where it can be 
> disabled for IIS (port 443) only? The only solutions I have found online 
> disable it in the SCHANNEL/Protocols registry key, which then disables it 
> system-wide in Windows
> 3. Has anyone run into this problem or discovered another workaround?
>
> Thanks, looking forward to discussing!
>
> -chris
>

-- 
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/d695ee03-4cb8-4686-920d-88d35ee95a2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_firewall_rule "The property 'failed' cannot be found on this object. Verify that the property exists."

2016-01-27 Thread J Hawkesworth
This is likely due to the change to enforce strict mode which was 
introduced in ansible 2.

There is an issue open on this module 
https://github.com/ansible/ansible-modules-extras/issues/1406

If you can't wait for the module to be fixed you could try setting strict 
mode off at the start of the module code

To do so, copy the module (win_firewall_rule.ps1 and win_firewall_rule.py) 
into your /etc/ansible/library or into your role's library folder and then 
after

 # WANT_JSON
 # POWERSHELL_COMMON

add this line:
   Set-StrictMode -Off

Might get you out of a hole.

Let us know how you get on.


On Friday, January 22, 2016 at 5:07:35 PM UTC, Joe Levis wrote:
>
> *I'm running Ansible 2.0.0.2 on a Ubuntu 14.04 Control Machine, trying to 
> enable an Inbound port on a target Windows Server 2012 R2 using the 
> win_firewall_rule.*
>
> *Here's my playbook:*
>
> - name: Allow inbound connection to port 12398
>
>   action: win_firewall_rule
>
>   args:
>
> name: "Port 12398"
>
> enabled: yes
>
> state: present
>
> localport: 12398
>
> protocol: TCP
>
> action: allow
>
> direction: In
>
>
> *Receiving this error message:*
>
> FAILED! => {"changed": false, "failed": true, "invocation": 
> {"module_name": "win_firewall_rule"}, "msg": "The property 'failed' cannot 
> be found on this object. Verify that the property exists."}
>
>
>
> Am I missing something or configured it wrong?
>

-- 
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/6eb22342-c30e-4b1d-8fc4-9104a79a9dc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Do I need to use Kerberos or Windows domain authentication to have Ansible manage Windows servers?

2016-02-01 Thread J Hawkesworth
Hello,

No you don't need to use kerberos to control a windows machine, unless you 
are trying to use a domain user to connect.

To start with I suggest you set things up as described here - 
http://docs.ansible.com/ansible/intro_windows.html#inventory

with a windows group in your inventory and the group vars needed to connect 
to windows set up.

It looks at the moment like you are still missing a setting as it shouldn't 
be attempting to connect via SSH, since windows only works with Winrm (at 
the moment).

If you are able to establish a WinRM connection but still receive 401 
Unauthorized, check that the local user name exists on the Windows machine 
and you have supplied the correct password.  Sometimes the windows event 
log (eventvwr) will give you a clue as well.

Hope this helps,

Jon

On Monday, 1 February 2016 12:22:21 UTC, Kiran wrote:
>
> I want to manage Windows servers with Ansible 1.9 running on a Linux 
> server.
>
>
> I'd prefer to use a local Windows account without installing Moba SSH. I 
> found very little documentation on how to set up Ansible with Windows 
> servers. I have a Linux server running Ansible.  I am trying to configure 
> Ansible to push files to a Windows server. I have a basic playbook. The 
> /etc/ansible/hosts file has an entry for an IP address for the Windows 
> server. The /etc/ansible/hosts file is configured to use a local user 
> account on the Windows server. I am not using Kerberos. I am not trying to 
> use Windows domain authentication. Do I need to use Kerberos or Windows 
> domain authentication to have Ansible manage Windows servers? 
>
>
> When the /etc/ansible/hosts file has this entry (in the [windows:var] 
> section):  ansible_connection=winrm 
>
> I can run a playbook and get the following output:
>
> ESTABLISH WINRM CONNECTION... fata [x.x.x.x] => 401 Unauthorized
>
> The above playbook run corresponds with no event logging on the Windows 
> server. The below output corresponds with Windows Server System Log events. 
>
> When the /etc/ansible/hosts file has this entry (in the [windows:var] 
> section, and instead of the ansible_connection entry above):  
> ansible_ssh_connection=winrm 
>
>
> and I run a playbook, I get this output:
>
> ESTABLISH CONNECTION FOR USER... PasswordAuthentication=no ... fatal: 
> [x.x.x.x] => SSH Error: Connection timed out during banner exchange ... 
> unreachable = 1 ...
>
> I expect the Playbook to work. I don't expect the PasswordAuthentication 
> to be set to no. I'm not sure how SSH works with a Windows server. I want 
> to use Ansible to manage a Windows server with local authentication.
>

-- 
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/038f9c3d-0f1b-466e-b685-7bfd7fc49190%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using ansible on windows with UAC enabled

2016-02-02 Thread J Hawkesworth
Yeah this stuff is frustrating...

You can disable UAC just for Administrators ...


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"ConsentPromptBehaviorAdmin"=dword:

then re-enable it once you have completed tasks that need it.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"ConsentPromptBehaviorAdmin"=dword:0002

Regular, non admin users will still get UAC prompts.

Hope this helps

Jon



On Tuesday, 2 February 2016 13:58:33 UTC, Marc Farrow wrote:
>
> Hi All,
>
> This is a basic question as I'm just getting started with Ansible. I've 
> got this working perfectly on our Linux distributions but not on Windows.
>
> Our environment dictates we need UAC enabled and we cannot use the built 
> in administrator account for day to day activities. With ansible some of 
> the modules work perfectly. However I'm having an issue with the modules 
> such as win_msi that effectively need elevated permissions within UAC to 
> "runas" administrator. If I run win_msi as the actual administrator (edit 
> the ssh_user as the actual local administrator) then it works fine. But 
> switching to either a domain user or a local user that's added to the local 
> administrators group fails with access denied. Running the same command on 
> the server requires me to either run the command in an elevated window or 
> accept the prompts to install as administrator. WinRM is working as 
> expected as I can perform tasks that don't require elevated permissions 
> perfectly with the domain or local user.
>
> Does ansible have any way around this? I see from the notes that at some 
> point "runas" is going to be enabled for windows, I guess this might be 
> when powershell starts to support SSH?
>
> But if anyone has any advice then this would be greatly appreciated.
>
> Thanks
>
> Marc
>

-- 
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/b69026fd-5f9b-4d2d-b37a-4fe1643f3d67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_template Illegal characters in path

2016-02-02 Thread J Hawkesworth
I'm guessing here that you are getting bitten by the \t part of c:\temp 
being interpreted as a tab character.

try

- name: Config file

  win_template: src=templates/config.j2 dest='C:\temp\test.conf'


or if you prefer double quotes:


- name: Config file

  win_template: src=templates/config.j2 dest="C:\\temp\\test.conf"


(note the \\ as windows path separator):


actually may need to be


- name: Config file

  win_template: "src=templates/config.j2 dest=C:\\temp\\test.conf"


Hope this helps,

Jon



On Monday, 1 February 2016 23:38:05 UTC, Joe Levis wrote:
>
> Not sure what I'm doing wrong here. I've tried all different styles of 
> configuration with no success. I'm trying to templatize a config file on a 
> Windows Server 2012 R2, but it's throwing the below error:
>
> *"failed": true, "invocation": {"module_args": {"dest": 
> "C:\temp\test.conf", "src": "templates/config.j2"}, "module_name": 
> "win_template"}, "msg": "Illegal characters in path."}*
>
> *Playbook:*
>
> ---
>
> - include_vars: variables.yml
>
> - name: Config file
>
>   win_template: src=templates/config.j2 dest=C:\temp\test.conf
>
>
> *variables.yml:*
>
> test_password: test123!
>
>
> *templates/config.j2:*
>
> password={{ test_password }}
>
>
> What exactly is the illegal argument? I'm using Ansible 2.0.0.2 on Ubuntu 
> 14.04.
>

-- 
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/1b777dd4-d6cf-42e8-b238-d5bcb39f8dc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: winrm

2016-02-03 Thread J Hawkesworth
You have

ansible_user: user@domain.local

set, implying that you want to use a domain user.

When you run, the following is shown:

transport=plaintext endpoint=https://X:5986/wsman 


The transport needs to be kerberos to connect with a domain user.

I suspect you are missing the python kerberos library.

If this can't be loaded then ansible will attempt a plaintext connection 
which I am fairly certain won't work with a domain user.

You don't mention which OS you are running ansible on but you probably need 
to install

python-kerberos from yum 
or
pykerberos from pip

Hope this helps

Jon


On Tuesday, 2 February 2016 23:00:01 UTC, Nikhil Shah wrote:
>
> maybe this might be a bit more insight:
>
> ansible windows -m win_ping - 
>
> <10.40.1.31> ESTABLISH WINRM CONNECTION FOR USER: *root* on PORT 5986 TO 
> XXX
>
> <10.40.1.31> WINRM CONNECT: transport=plaintext endpoint=
> https://X:5986/wsman
>
> <10.40.1.31> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 111] 
> Connection refused
>
> 10.40.1.31 | FAILED => 500 WinRMTransport. [Errno 111] Connection refused
>
>
>
> I've got a group_var/windows.yml:
>
>
>
> ansible_user: user@domain.local
>
> ansible_password: 
>
> ansible_port: 5986
>
> ansible_connection: winrm
>
> # The following is necessary for Python 2.7.9+ when using default WinRM 
> self-signed certificates:
>
> ansible_winrm_server_cert_validation: ignore
>
> On Tuesday, February 2, 2016 at 4:01:55 PM UTC-5, Nikhil Shah wrote:
>>
>>
>>
>> Feb 2, 12:42
>>
>> Hello,
>>
>> I followed the guidelines in setting up a windows node. 
>> http://docs.ansible.com/ansible/intro_windows.html#windows-system-prep
>>
>> I am using Windows 2008 R2, which had PowerShell 2.0 installed; I 
>> upgraded to PowerShell 4.0 (since the requirements said PowerShell 3.0)
>>
>> When trying to run ansible, I am running the following and getting the 
>> below listed error message:
>>
>> ansible-playbook -i hosts ipconfig.yml --ask-vault
>> Vault password:
>>
>> PLAY [test raw module] 
>> 
>>
>> TASK: [run ipconfig] 
>> ** 
>> fatal: [qa-codegen01.theorchard.local] => 500 WinRMTransport. [Errno 111] 
>> Connection refused
>>
>> FATAL: all hosts have already failed -- aborting
>>
>>
>>
>> Note - I went ahead and enabled winRM and configured with the following 
>> settings:
>>
>> winrm quickconfig -q
>>
>> winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
>>
>> winrm set winrm/config '@{MaxTimeoutms="180"}'
>>
>> winrm set winrm/config/service '@{AllowUnencrypted="true"}'
>>
>> winrm set winrm/config/service/auth '@{Basic="true"}'
>>
>>
>>

-- 
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/a467b8b0-516e-4bcc-bab1-b53c4c9e1500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible log_plays.py callback plugin not working with ansible 2.0.1 as expected

2016-02-03 Thread J Hawkesworth
Yes the internal ansible APIs have changed in v2

Have a look at the other plugins in your ansible installation.

For example

site-packages/ansible/plugins/callback/timer.py

You will notice that the plugins now subclass CallbackModule.

Another change in Ansible 2.0 is that you can just whitelist the plugins 
that you want to use in your ansible.cfg, rather than having to copy them 
to somewhere on your plugin path.

Hope this helps,

Jon

On Wednesday, 3 February 2016 13:48:38 UTC, tiny...@gmail.com wrote:
>
> I believe you should use 'v2_' versions of functions in 2.0
>
> On Wednesday, February 3, 2016 at 4:23:05 PM UTC+3, Ankit Kulkarni wrote:
>>
>> We are using ansible in our production and our log_plays callback plugin 
>> just broke after upgrading from 1.9.4 to 2.0.0.1 .
>>   
>> I need to put my custom logging using log_plays.py ( say store the 
>> results in a sqllitedb for later analysis ) . The same was working fine 
>> till ansible 1.9.4 . I am using *ansible 2.0.0 on ubuntu 14.04 64 bit . *
>>
>> I used this log file 
>> https://github.com/ansible/ansible/blob/stable-2.0.0.1/lib/ansibale/plugins/callback/log_plays.py
>>  
>> . Any function overrided under the `class CallbackModule(CallbackBase):` are 
>> not reflecting while the code outside class is working .  
>>
>> Example - 
>>
>> def runner_on_ok(self, host, res):
>> self.log(host, 'ok-it-worked', res)
>>
>>
>> I wanted to use the *playbook_on_stats(self, stats) *function . How can 
>>> I use it  ? I can see the changes from the 1.9.4 log_plays.py file 
>>> https://github.com/ansible/ansible/blob/stable-1.9/plugins/callbacks/log_plays.py
>>>  
>>>  like now  not all functions are included but not getting why the functions 
>>> are not overriding . 
>>
>>
>>
>>

-- 
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/7303972f-303d-4984-a294-7be8953f0e09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Centralizing authentication file for multiple Windows hosts using the same user credentials

2016-02-07 Thread J Hawkesworth
Hey. 

Groups can have child groups,  so the way I handle it is to have a high level 
group that just defines connection parameters, and then the more specialised 
groups such as Web servers or db servers get added as children of the high 
level group in my inventory . 

You can also define group_vars/all if that makes sense for you. 

Inventory looks a bit like this 

[windows] 

[win_db] 
Windb1
Windb2

[win_web] 
Winweb1
Winweb2

[windows:children]
win_db
win_web 

Hope this helps 

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/4bc6d32f-ebfe-43f2-a943-7b4d9bea6cac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Windows Modules

2016-02-07 Thread J Hawkesworth
Script, fetch and raw are the only modules which run against windows that don't 
start with the win_ prefix. 

The scripting language for Windows hosts is powershell,  not Python. 

You could probably use raw to run commands, but raw will always report changed 
= true so you would have to handle idempotency yourself. 

Depending on what you want to achieve you might need to write a windows module 
or two. 

Hope this helps,

 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/889b65fc-52fa-4502-8b47-3f0d26c68f62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_environment module

2016-02-08 Thread J Hawkesworth
Hi, 

You could use the script module and just add to the path that way.

But the module is this way for a reason.  To me, I want to take control of 
exactly what is configured on machines.  So when I look at my playbooks I 
can know exactly what the PATH is set to on all machines that the playbook 
applies to.

Perhaps you are trying to acheive something where this needs to be 
different on each machine though?

What is it you need to do?

Jon (module author)

On Wednesday, 3 February 2016 14:51:00 UTC, Shmulik Alfandari wrote:
>
> Hi,
>
> I am trying to add specific path to the Path Environment Variables on 
> windows hosts using win_environment module
> The problem is that this module can only add new variable or delete 
> existing one, it's impossible to add something to existing variable.
>
> Is there any other way to update Path Environment Variables on windows 
> hosts?
>
> Thanks,
> Shmulik.
>  
>

-- 
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/b6a68189-aa84-4831-9212-50140f9861af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_nssm task shows 'changed' for every run

2016-02-08 Thread J Hawkesworth
I've not looked at the code, but perhaps it is a bug.  Since you seem to be 
able to reproduce, I suggest raising it in ansible modules extra project 
(using the issue 
template) https://github.com/ansible/ansible/raw/devel/ISSUE_TEMPLATE.md

You might be able to work around using changed_when - 
see 
http://docs.ansible.com/ansible/playbooks_error_handling.html#controlling-what-defines-failure

To do so, you might need to check if the service exists already, which you 
can do something like this (untested)

- name: check if service exists
  raw: "Get-Service -Name 'appservice'"
  register: appservice_status
  ignore_errors: True

Then you'd have to check the stdout stored in the registered 
appservice_status var to see if it exists.

You could perhaps even use a when: clause so the win_nssm only runs when 
the service doesn't exist, although that wouldn't ever let you reconfigure 
the service in the same playbook (which may or may not be important to you).

Hope this helps,

Jon


On Wednesday, 3 February 2016 18:11:45 UTC, Joe Levis wrote:
>
> Ubuntu 14.04, Ansible 2.0.0.2
>
> I'm using win_nssm to install a service. It's successfully installing the 
> service, however all subsequent runs show the win_nssm task as 'changed'.
>
> Why is win_nssm showing 'changed' even though the service has already been 
> installed and nothing has been modified? Is it actually re-installing the 
> service?
>
> *Playbook:*
>
>   win_nssm:
>
> name: servicename
>
> state: present
>
> application: C:\path\to\exe
>
> start_mode: manual
>
> user: 
>
> password: 
>
>
> *Output:*
>
> TASK [appservice : Install appservice via NSSM] 
>
> changed: [server1.my.domain.com]
>
>
>
> Any way to condition around this?
>

-- 
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/535af3b3-d09a-401c-ab1a-82370ea4ef7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible log_plays.py callback plugin not working with ansible 2.0.1 as expected

2016-02-08 Thread J Hawkesworth
Have you 'whitelisted' your plugin in your ansible.cfg?


# callback_whitelist = timer, mail
callback_whitelist = log_plays 

If so, you can throw in some print statements temporarily to debug it.

You might want to whitelist the context_demo plugin as that will show you 
what play and task objects are available to plugins.

Hope this helps.

Jon

On Monday, 8 February 2016 10:20:33 UTC, Ankit Kulkarni wrote:
>
> Can anyone help with below . Its not yet solved for me . 
>
> On Wednesday, February 3, 2016 at 8:05:31 PM UTC+5:30, Ankit Kulkarni 
> wrote:
>>
>>
>> On Wednesday, February 3, 2016 at 7:41:53 PM UTC+5:30, J Hawkesworth 
>> wrote:
>>>
>>> Yes the internal ansible APIs have changed in v2
>>>
>>> Have a look at the other plugins in your ansible installation.
>>>
>>> For example
>>>
>>> site-packages/ansible/plugins/callback/timer.py
>>>
>>> You will notice that the plugins now subclass CallbackModule.
>>>
>>> Another change in Ansible 2.0 is that you can just whitelist the plugins 
>>> that you want to use in your ansible.cfg, rather than having to copy them 
>>> to somewhere on your plugin path.
>>>
>>> Hope this helps,
>>>
>>> Jon
>>>
>>> On Wednesday, 3 February 2016 13:48:38 UTC, tiny...@gmail.com wrote:
>>>>
>>>> I believe you should use 'v2_' versions of functions in 2.0
>>>>
>>>
>>
>> Thanks a lot guys . I used the 'v2_' versions of the functions however it 
>> still couldn't work. I have the following below code . Is something wrong 
>> in it 
>>
>> class CallbackModule(CallbackBase):
>> """
>> logs playbook results, per host, in /var/log/ansible/hosts
>> """
>> CALLBACK_VERSION = 2.0
>> CALLBACK_TYPE = 'notification'
>> CALLBACK_NAME = 'log_plays'
>> CALLBACK_NEEDS_WHITELIST = True
>>
>>
>> TIME_FORMAT="%b %d %Y %H:%M:%S"
>> MSG_FORMAT="%(now)s - %(category)s - %(data)s\n\n"
>>
>>
>> def __init__(self):
>>
>>
>> super(CallbackModule, self).__init__()
>>
>>
>> if not os.path.exists("/var/log/ansible/hosts"):
>> os.makedirs("/var/log/ansible/hosts")
>>
>>
>> def log(self, host, category, data):
>> if type(data) == dict:
>> if '_ansible_verbose_override' in data:
>> # avoid logging extraneous data
>> data = 'omitted'
>> else:
>> data = data.copy()
>> invocation = data.pop('invocation', None)
>> data = json.dumps(data)
>> if invocation is not None:
>> data = json.dumps(invocation) + " => %s " % data
>>
>> path = os.path.join("/var/log/ansible/hosts", host)
>> now = time.strftime(self.TIME_FORMAT, time.localtime())
>> msg = to_bytes(self.MSG_FORMAT % dict(now=now, category=category, 
>> data=data))
>> with open(path, "ab") as fd:
>> fd.write(msg)
>>
>>
>> def v2_runner_on_failed(self, host, res, ignore_errors=False):
>> self.log(host, 'FAILED', res)
>>
>>
>> def v2_runner_on_ok(self, host, res):
>> self.log(host, 'OK', res)
>>
>>
>> def v2_runner_on_skipped(self, host, item=None):
>> self.log(host, 'SKIPPED', '...')
>>
>>
>> def v2_runner_on_unreachable(self, host, res):
>> self.log(host, 'UNREACHABLE', res)
>>
>>
>> def v2_runner_on_async_failed(self, host, res, jid):
>> self.log(host, 'ASYNC_FAILED', res)
>>
>>
>> def v2_playbook_on_import_for_host(self, host, imported_file):
>> self.log(host, 'IMPORTED', imported_file)
>>
>>
>> def v2_playbook_on_not_import_for_host(self, host, missing_file):
>> self.log(host, 'NOTIMPORTED', missing_file)
>>  
>>
>> It still didn't overrided . 
>>
>>>
>>>> On Wednesday, February 3, 2016 at 4:23:05 PM UTC+3, Ankit Kulkarni 
>>>> wrote:
>>>>>
>>>>> We are using ansible in our production and our log_plays callback 
>>>>> plugin just br

[ansible-project] Re: Running Powershell Script not working

2016-02-09 Thread J Hawkesworth
Looks like you have lost some backslashes somehow

instead of 

set-ItemProperty -Path 'HKLM:SystemCurrentControlSetControlTerminal 
Server'-name "fDenyTSConnections" -Value 0

try

set-ItemProperty -Path 'HKLM:System\CurrentControlSet\Control\Terminal 
Server'-name "fDenyTSConnections" -Value 0

Or, if you are running ansible 2.0, try using the win_regedit module

http://docs.ansible.com/ansible/win_regedit_module.html

Something like (not tested):

win_regedit:
  key: 'HKLM:\System\CurrentControlSet\Control\Terminal Server'
  value: fDenyTSConnections
  data: 0 

datatype: dword  

Hope this helps,

Jon
On Monday, 8 February 2016 15:23:01 UTC, Mark Matthews wrote:
>
> Hi 
>
> I am trying to run a simple playbook to run a Powershell script. But it 
> keeps failing.
> If I run the Powershell script directly on the server it works fine. Below 
> is the play book ans the script.
>
> Is there something that needs to be done to get Ansible to run the 
> Powershell script?
>
> Powershell Scripts (rdp.ps1)
>
> # Enable Remote Desktop
> set-ItemProperty -Path 'HKLM:SystemCurrentControlSetControlTerminal 
> Server'-name "fDenyTSConnections" -Value 0
>
>
> Playbook:
>
> ---
> - name: Enable Remote Desktop on
>   hosts: all
>   tasks:
> - name: Enable Remote Desktop
>   script: files/Enable_RDP.ps1
>
>
> Error:
> changed: [10.10.3.170] => {"changed": true, "invocation": {"module_args": 
> {"_raw_params": "files/Enable_RDP.ps1"}, "module_name": "script"}, "rc": 0, 
> "stderr": "#< CLIXML\r\n http://schemas.microsoft.com/powershell/2004/04\";> S=\"Error\">set-ItemProperty : Cannot find path _x000D__x000A_ S=\"Error\">'HKLM:\\SystemCurrentControlSetControlTerminal Server' because 
> it does not _x000D__x000A_exist._x000D__x000A_ S=\"Error\">At 
> C:\\Users\\Administrator\\AppData\\Local\\Temp\\ansible-tmp-1454943953.17-24292631_x000D__x000A_  
> S=\"Error\">07433\\Enable_RDP.ps1:2 char:1_x000D__x000A_ S=\"Error\">+ set-ItemProperty -Path 
> 'HKLM:SystemCurrentControlSetControlTerminal _x000D__x000A_ S=\"Error\">Server'-name ..._x000D__x000A_+ 
> ~_x000D__x000A_  
> S=\"Error\">~~~_x000D__x000A_ + CategoryInfo : 
> ObjectNotFound: (HKLM:\\SystemCur...Terminal Serv _x000D__x000A_ S=\"Error\"> er:String) [Set-ItemProperty], 
> ItemNotFoundException_x000D__x000A_ + 
> FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetIt 
> _x000D__x000A_ emPropertyCommand_x000D__x000A_ S=\"Error\"> _x000D__x000A_", "stdout": "", "stdout_lines": []} 
>
>

-- 
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/22688df3-b644-47d0-a870-63563cebf6e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Running Powershell Script not working

2016-02-09 Thread J Hawkesworth
My apologies, I missed the leading slash after the 'drive name' ( For some 
reason powershell has its own notion of 'drives' which include parts of the 
registry -  HKLM: is the name of the powershell drive that maps to the 
HKEY_LOCAL_MACHINE part ot the registry.)

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal 
Server' -name "fDenyTSConnections" -Value 0

Hope this helps,

Jon



On Tuesday, 9 February 2016 10:55:13 UTC, Mark Matthews wrote:
>
> Thanks for the response!
>
> I have tried the following Powershell options:
> set-ItemProperty -Path 'HKLM:System\CurrentControlSet\Control\Terminal 
> Server'-name "fDenyTSConnections" -Value 0
> set-ItemProperty -Path 
> 'HKEY_LOCAL_MACHINE:System\CurrentControlSet\Control\Terminal Server' -name 
> "fDenyTSConnections" -Value 0
> set-ItemProperty -Path 
> 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server' -name 
> "fDenyTSConnections" -Value 0
>
> But none of them work. Got the following error with the option you 
> suggested.
>
> fatal: [10.10.3.170]: FAILED! => {"changed": false, "failed": true, 
> "invocation": {"module_args": {"_raw_params": "set-ItemProperty -Path 
> 'HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Terminal Server' 
> -name \"fDenyTSConnections\" -Value 0"}, "module_name": "raw"}, "rc": 1, 
> "stderr": "#< CLIXML\r\n http://schemas.microsoft.com/powershell/2004/04\";> S=\"Error\">set-ItemProperty : Cannot find path 
> 'C:\\Users\\Administrator\\HKEY_LOCAL_MACHINE\\_x000D__x000A_ S=\"Error\">System\\CurrentControlSet\\Control\\Terminal Server' because it 
> does not exist._x000D__x000A_At line:1 
> char:1_x000D__x000A_+ set-ItemProperty -Path 
> _x000D__x000A_ S=\"Error\">'HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Term 
> ..._x000D__x000A_+ 
> ~_x000D__x000A_  
> S=\"Error\">~~~_x000D__x000A_ + CategoryInfo : 
> ObjectNotFound: (C:\\Users\\Admini...Terminal Serv _x000D__x000A_ S=\"Error\"> er:String) [Set-ItemProperty], 
> ItemNotFoundException_x000D__x000A_ + 
> FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetIt 
> _x000D__x000A_ emPropertyCommand_x000D__x000A_ S=\"Error\"> _x000D__x000A_", "stdout": "", "stdout_lines": []} 
> I have no doubt if I used the win_regedit it would work. But Im trying to 
> figure out why Ansible is not able to run a simple Powershell script from a 
> playbook?
> Why am I able to run that script successfully from the machine, but it 
> fails when Ansible ties to execute it from a playbook.
>
> This is the part of the error that concerns me:
> set-ItemProperty : Cannot find path 
> 'C:\\Users\\Administrator\\HKEY_LOCAL_MACHINE\\_x000D__x000A_
>
> Why is Ansible trying to find the path in C:\\ when this is a registry 
> script?
>
> Any ideas would be appreciated.
>
> Cheers
> Mark
>
>
> On Monday, February 8, 2016 at 3:23:01 PM UTC, Mark Matthews wrote:
>>
>> Hi 
>>
>> I am trying to run a simple playbook to run a Powershell script. But it 
>> keeps failing.
>> If I run the Powershell script directly on the server it works fine. 
>> Below is the play book ans the script.
>>
>> Is there something that needs to be done to get Ansible to run the 
>> Powershell script?
>>
>> Powershell Scripts (rdp.ps1)
>>
>> # Enable Remote Desktop
>> set-ItemProperty -Path 'HKLM:SystemCurrentControlSetControlTerminal 
>> Server'-name "fDenyTSConnections" -Value 0
>>
>>
>> Playbook:
>>
>> ---
>> - name: Enable Remote Desktop on
>>   hosts: all
>>   tasks:
>> - name: Enable Remote Desktop
>>   script: files/Enable_RDP.ps1
>>
>>
>> Error:
>> changed: [10.10.3.170] => {"changed": true, "invocation": {"module_args": 
>> {"_raw_params": "files/Enable_RDP.ps1"}, "module_name": "script"}, "rc": 0, 
>> "stderr": "#< CLIXML\r\n> http://schemas.microsoft.com/powershell/2004/04\";>> S=\"Error\">set-ItemProperty : Cannot find path _x000D__x000A_> S=\"Error\">'HKLM:\\SystemCurrentControlSetControlTerminal Server' because 
>> it does not _x000D__x000A_exist._x000D__x000A_> S=\"Error\">At 
>> C:\\Users\\Administrator\\AppData\\Local\\Temp\\ansible-tmp-1454943953.17-24292631_x000D__x000A_>  
>> S=\"Error\">07433\\Enable_RDP.ps1:2 char:1_x000D__x000A_> S=\"Error\">+ set-ItemProperty -Path 
>> 'HKLM:SystemCurrentControlSetControlTerminal _x000D__x000A_> S=\"Error\">Server'-name ..._x000D__x000A_+ 
>> ~_x000D__x000A_>  
>> S=\"Error\">~~~_x000D__x000A_ + CategoryInfo : 
>> ObjectNotFound: (HKLM:\\SystemCur...Terminal Serv _x000D__x000A_> S=\"Error\"> er:String) [Set-ItemProperty], 
>> ItemNotFoundException_x000D__x000A_ + 
>> FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetIt 
>> _x000D__x000A_ emPropertyCommand_x000D__x000A_> S=\"Error\"> _x000D__x000A_", "stdout": "", "stdout_lines": []} 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansib

[ansible-project] Re: ERROR: win_copy is not a legal parameter in an Ansible task or handler

2015-05-01 Thread J Hawkesworth
Hi,

What version of Windows are you targeting?

Is it a fresh image?  Is it up to date with windows updates?

What version of Powershell is running on the windows host?

Can you run any Powershell directly on the windows machine (using the same 
user that you are connecting as)?

Jon

On Friday, May 1, 2015 at 3:32:29 AM UTC+1, ken.k...@gmail.com wrote:
>
> Another possible solution though I have failed to find a good one.
> As a note if you are using 64 bit windows then the path might be 
> windows.powershell32
>
>
> http://blogs.technet.com/b/heyscriptingguy/archive/2013/07/30/learn-how-to-configure-powershell-memory.aspx
>
>
>
> On Wednesday, April 29, 2015 at 2:48:32 PM UTC-5, ken.k...@gmail.com 
> wrote:
>>
>> ansible --version
>> ansible 2.0.0
>>   configured module search path = None
>>
>>
>> I receive this error when attempting to use wincopy.  
>> But I do see win_copy in modules
>>
>> ls /usr/lib/python2.7/site-packages/ansible/modules/core/windows/
>> copy.ps1  setup.ps1 win_copy.pyo win_feature.pyo 
>>  win_get_url.pyo  win_group.pyo  win_msi.pyo   win_ping.pyo 
>> win_service.pyo  win_stat.pyo  win_user.ps1
>> __init__.py   slurp.ps1 win_feature.ps1  win_get_url.ps1 
>>  win_group.ps1win_msi.ps1win_ping.ps1  win_service.ps1 
>>  win_stat.ps1 win_template.py   win_user.py
>> __init__.pyc  win_copy.py   win_feature.py   win_get_url.py   
>> win_group.py win_msi.py win_ping.py   win_service.py   win_stat.py 
>>  win_template.pyc  win_user.pyc
>> __init__.pyo  win_copy.pyc  win_feature.pyc  win_get_url.pyc 
>>  win_group.pycwin_msi.pycwin_ping.pyc  win_service.pyc 
>>  win_stat.pyc win_template.pyo  win_user.pyo
>>
>>

-- 
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/7c408917-7f26-48be-bf64-1d4a6b1926c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: No Kerberos credentials available'

2015-05-01 Thread J Hawkesworth
Hi,

If you want to use domain accounts, by the looks of things you probably 
need to set up your controller so it is a kerberos client and can acquire 
the credentials needed in order to connect via kerberos.

I suggest searching for 'kerberos client setup' for your controller 
platform.

Its probably a case of installing krb5-workstation and then configuring the 
/etc/krb5.conf file so kerberos knows where your domain controllers are.

Usually you can test by running 

kinit user@DOMAIN

(in my experience DOMAIN has to be in upper case).

Hope this helps,

Jon


On Friday, May 1, 2015 at 2:34:08 AM UTC+1, Kenneth Krog wrote:
>
> As a note I've updated to version 2.0 and  I'm using local credentials now 
> and avoiding the ldap issue. If I get it to work I'll post back here.
>
> On Wed, Apr 29, 2015 at 9:54 AM, > wrote:
>
>>
>> With the latest version I can get this to work with local machine 
>> credentials but not ldap.
>>
>>
>> On Monday, April 27, 2015 at 1:55:45 PM UTC-5, ken.k...@gmail.com wrote:
>>>
>>>
>>> I downloaded the lastest version and did a source./env-setup
>>> Now when I run ansible --version I receive
>>>
>>> ansible --version
>>> ansible 2.0.0
>>>   lib/ansible/modules/core:  not found - use git submodule update --init 
>>> lib/ansible/modules/core
>>>   lib/ansible/modules/extras:  not found - use git submodule update 
>>> --init lib/ansible/modules/extras
>>>   v2/ansible/modules/core:  not found - use git submodule update --init 
>>> v2/ansible/modules/core
>>>   v2/ansible/modules/extras:  not found - use git submodule update 
>>> --init v2/ansible/modules/extras
>>>   configured module search path = None
>>>
>>>
>>> I still receive the kerberose error message.
>>>
>>> On Thursday, April 23, 2015 at 12:46:14 PM UTC-5, ken.k...@gmail.com 
>>> wrote:

 I'm running ansible against a windows host for testing purposes.  I can 
 get pywinrm working against the host but when I attempt using either a 
 domain account or an account local to the windows host specified in my 
 ansible/hosts file I receive the error specified below.  Any help or 
 explanation would be appreciated thank you in advance.  

 Centos: 7
 Version: ansible 1.9.0.1

  
 /etc/ansible/hosts

 [windows]
 corpigs8471b
 #ntdvwqwebpcp02b

 [windows:vars]
 ansible_connection=winrm
 ansible_ssh_user=user...@domain.fqdn.net 
 ansible_ssh_pass=***
 ansible_ssh_port=5986

 [root@corpigs8471b ansible]# ansible windows -m setup
 corpigs8471b | FAILED => Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 582, in _executor
 exec_rc = self._executor_internal(host, new_stdin)
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 785, in _executor_internal
 return self._executor_internal_inner(host, self.module_name, 
 self.module_args, inject, port, complex_args=complex_args)
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 960, in _executor_internal_inner
 conn = self.connector.connect(actual_host, actual_port, 
 actual_user, actual_pass, actual_transport, actual_private_key_file, 
 delegate_host)
   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py", 
 line 52, in connect
 self.active = conn.connect()
   File 
 "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
  
 line 147, in connect
 self.protocol = self._winrm_connect()
   File 
 "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
  
 line 101, in _winrm_connect
 protocol.send_message('')
   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 173, 
 in send_message
 return self.transport.send_message(message)
   File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 195, 
 in send_message
 krb_ticket = KerberosTicket(self.krb_service)
   File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 147, 
 in __init__
 kerberos.authGSSClientStep(krb_context, '')
 GSSError: (('Unspecified GSS failure.  Minor code may provide more 
 information', 851968), ('No Kerberos credentials available', -1765328243))




  -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/ansible-project/nuBN0JvCJos/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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/434ef3b5-7cc8-43f4-8a4d-7bbfc9c827f7%

[ansible-project] Re: ERROR: win_copy is not a legal parameter in an Ansible task or handler

2015-05-01 Thread J Hawkesworth
Please see this thread on the development mailing list

https://groups.google.com/d/msg/ansible-devel/Jl5qP73CiKo/gGHQFaa9QvUJ

Jon

On Friday, May 1, 2015 at 3:43:58 PM UTC+1, John Jelinek wrote:
>
> Is a win_copy (and win_file / win_template) plugin anticipated for the v2 
> launch?
>
> On Friday, May 1, 2015 at 2:41:51 AM UTC-5, J Hawkesworth wrote:
>>
>> Hi,
>>
>> What version of Windows are you targeting?
>>
>> Is it a fresh image?  Is it up to date with windows updates?
>>
>> What version of Powershell is running on the windows host?
>>
>> Can you run any Powershell directly on the windows machine (using the 
>> same user that you are connecting as)?
>>
>> Jon
>>
>> On Friday, May 1, 2015 at 3:32:29 AM UTC+1, ken.k...@gmail.com wrote:
>>>
>>> Another possible solution though I have failed to find a good one.
>>> As a note if you are using 64 bit windows then the path might be 
>>> windows.powershell32
>>>
>>>
>>> http://blogs.technet.com/b/heyscriptingguy/archive/2013/07/30/learn-how-to-configure-powershell-memory.aspx
>>>
>>>
>>>
>>> On Wednesday, April 29, 2015 at 2:48:32 PM UTC-5, ken.k...@gmail.com 
>>> wrote:
>>>>
>>>> ansible --version
>>>> ansible 2.0.0
>>>>   configured module search path = None
>>>>
>>>>
>>>> I receive this error when attempting to use wincopy.  
>>>> But I do see win_copy in modules
>>>>
>>>> ls /usr/lib/python2.7/site-packages/ansible/modules/core/windows/
>>>> copy.ps1  setup.ps1 win_copy.pyo win_feature.pyo 
>>>>  win_get_url.pyo  win_group.pyo  win_msi.pyo   win_ping.pyo 
>>>> win_service.pyo  win_stat.pyo  win_user.ps1
>>>> __init__.py   slurp.ps1 win_feature.ps1  win_get_url.ps1 
>>>>  win_group.ps1win_msi.ps1win_ping.ps1  win_service.ps1 
>>>>  win_stat.ps1 win_template.py   win_user.py
>>>> __init__.pyc  win_copy.py   win_feature.py   win_get_url.py   
>>>> win_group.py win_msi.py win_ping.py   win_service.py   win_stat.py 
>>>>  win_template.pyc  win_user.pyc
>>>> __init__.pyo  win_copy.pyc  win_feature.pyc  win_get_url.pyc 
>>>>  win_group.pycwin_msi.pycwin_ping.pyc  win_service.pyc 
>>>>  win_stat.pyc win_template.pyo  win_user.pyo
>>>>
>>>>

-- 
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/546718fe-1fd9-4b71-9d64-3f5674cc7aa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: winrm.py tries SSL handshake on WinRM HTTP port

2015-05-01 Thread J Hawkesworth
Can you run with -v - we might see the whole of the error?

Also can you share your group_vars for windows_hosts ?

My guess is you are missing a python dependency.

As an aside you might be able to install a more recent ansible from 
releases.ansible.com if you can work with the tar.gz

Jon

On Wednesday, April 29, 2015 at 4:40:55 PM UTC+1, grobs wrote:
>
> Hi,
>
> I' trying to run a simple test on a remote windows host.
> I read http://docs.ansible.com/intro_windows.html and saw that Michael 
> recommends to install pywinrm like this:
> pip install http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm
>
> In my case, I don't have any possibility to run pip and hit github due to 
> network security rules so I did it like this (on Debian 8 - Jessie):
>
>1. aptitude install python-isodate python-xmltodict python-pytest 
>python-pytest-cov pep8
>2. # Downloaded 
>http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm and put 
>it on my Ansible server
>3. unzip pywinrm-master.zip
>4. cd pywinrm-master/
>5. python setup.py install
>
>
> All went well and I have this directory installed 
> /usr/local/lib/python2.7/dist-packages/winrm/
>
> After having modified 
> file 
> /usr/lib/python2.7/dist-packages/ansible/runner/connection_plugins/winrm.py 
> as expected in https://github.com/ansible/ansible/issues/8720 , my 
> problem is that when I run the ping test, this is what I get:
>
> ansible windows_hosts -m win_ping
>> WINSRV-01 | FAILED => 500 WinRMTransport. [SSL: UNKNOWN_PROTOCOL] unknown 
>> protocol (_ssl.c:581)
>
>
> Any idea?
>
> I'm running ansible 1.7.2 (Debian package: ansible-1.7.2+dfsg-2 on Debian 
> Jessie).
>
> Tom
>

-- 
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/5df8b3af-8a1b-4952-9b94-28a0706f4800%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: What are the file formats supported?

2015-05-06 Thread J Hawkesworth
In the windows world you can use powershell scripting to invoke whatever 
the default action is for a file:

https://technet.microsoft.com/en-gb/library/hh849794.aspx

Not really sure what you mean by edited and monitored though.  Can you be 
more specific about what you need to do?

On Wednesday, May 6, 2015 at 2:33:43 PM UTC+1, Saleh Alobaid wrote:
>
> Hello everyone,
> My question might seem a bit broad but I would like to know what file 
> formats are exactly supported that can be edited and monitored? For example 
> a Microsoft Office file, PDF's, and/or Solidworks and AutoCAD files? Of 
> course Ansible can't obviously edit them itself but will it recognize them 
> at least and open the associated software?
>

-- 
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/a68b8d5d-c830-48bb-afb9-002bc533f818%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Callback plugin output; logging to ansible.log

2015-05-13 Thread J Hawkesworth
We use a couple of callback plugins and one of my colleagues has noticed 
that their output doesn't appear in ansible.log

Is it possible to change this so we can see callback output?

We're running 1.9.1

Many thanks,

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/cf7cdc61-5126-49b9-8999-32bb3fafee02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Callback plugin output; logging to ansible.log

2015-05-13 Thread J Hawkesworth
Fair enough, a default would not seem right.

I will modify my plugins.

On Wednesday, May 13, 2015 at 1:07:34 PM UTC+1, Brian Coca wrote:
>
> Considering there are syslog callbacks I would be remiss to make this 
> the default, but the callbacks themselves should be able to explicitly 
> send data to ansible.log. 
>
>
> -- 
> Brian Coca 
>

-- 
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/cfae2929-831a-4c96-be73-68700c17b956%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using Ansible for Application Deployment

2015-05-20 Thread J Hawkesworth
Yeah so vars_prompt is local to a specific play (remember here you can have 
multiple plays in a playbook).

I'm wondering if you could, or would want to pass the prompted values to 
your jenkinsfetch role though?

I use set_fact to set facts which aren't just true for the current host in 
some cases.

Interested to hear what others do though.

Jon

On Wednesday, May 20, 2015 at 1:41:00 PM UTC+1, Mike Herron wrote:
>
> I've been using Ansible for a few years, mostly for server provisioning 
> and configuration management. I think it's a fantastic tool. For a new 
> project, I've also begun to attempt to use Ansible as a web application 
> deployment tool where I would have previously used ant. However, there are 
> a couple of snags that have me questioning whether the Ansible model is the 
> best fit for this type of task.
>
> For example, the first thing I want to is download the deployment artefact 
> from Jenkins. This is only available internally, so my plan was to download 
> locally and then upload to the production servers. I quickly realised that 
> this was totally different to anything I'd done before as I was trying to 
> perform a task that wasn't really associated with any remote hosts. After a 
> bit of searching, I found this:
>
> - hosts: 127.0.0.1
>   connection: local
>
> Which works perfectly well, and could have been designed for exactly this 
> type of task, but it feels a bit like trying to fit a round peg in to a 
> square hole. I understand that since all modules assume that they are 
> executing within the context of a host, there is really no other way it 
> could be, but it got me thinking if Ansible is a good place to write these 
> type of non-host specific, pre-deployment steps?
>
> The next challenge then was to have the play book prompt the user for the 
> job and build to deploy. var_prompt seemed perfect for this, so I ended up 
> with a playbook like so:
>
> - hosts: 127.0.0.1
>   connection: local
>   vars_prompt:
>jenkins_job: "Job Name"
>jenkins_build: "Build Number"
>   roles:
>- jenkinsfetch
>
> - hosts: dashboards
>   roles:
>- { role: uploadapp, app_name: 'dashboard' }
>
> Which seemed to work well until I tried to reference jenkins_job and 
> jenkins_build from within the uploadapp role and couldn't:
>
> TASK: [uploadapp | upload build tar] 
> ***
> fatal: [local.dev] => One or more undefined variables: 'jenkins_job' is 
> undefined
>
> FATAL: all hosts have already failed -- aborting
>
> I spent a bit of time trying to figure out how to make these variables 
> visible across the plays but couldn't. I tried set_fact, which didn't work 
> as it's host specific. I tried to include both roles within the same play 
> but couldn't (obviously as I don't want to run uploadapp on 127.0.0.1) and 
> finally just resolved to put the variables as part of a global var file 
> rather than prompt for them. I can workaround this works, but it feels to 
> me like I'm trying to make Ansible do something it really doesn't want to.
>
> The variable problem also came up when I wanted to abbreviate some paths 
> within my jenkinsfetch role:
>
> ---
> - name: create builds dir
>   file: >
>path=/tmp/builds/{{jenkins_job}}
>state=directory
>
> - name: fetch build from jenkins
>   get_url: >
>   
>  
> url={{jenkins_url}}/job/{{jenkins_job}}/{{jenkins_build}}/artifact/build/output/{{jenkins_job}}_{{jenkins_build}}.tar.gz
>dest=/tmp/builds/{{jenkins_job}}
>
> So rather than reference /tmp/builds/{{jenkins_job}} twice, I wanted to 
> redefine a new variable, something along the lines of:
>
> ---
> - name: set build dir
>   var: >
>name=build_dir 
>value=/tmp/builds/{{jenkins_job}}
> - name: create builds dir
>   file: >
>path=/tmp/builds/{{jenkins_job}}
>state=directory
>
> In this case, set_fact may happen to work, but I'm not setting a fact 
> about a host, I'm just wanting to define a new variable (and have that 
> visible across the rest of the plays).
>
> So I will carry on, but given these small snags, I'm curious if anyone 
> else has had the same experience - that when trying to implement a set of 
> deployment steps in Ansible, it sometimes feels like trying to force the 
> tool to do something it wasn't designed for?  
>
> Thanks
>

-- 
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/7b304455-9880-4945-bff0-dea86d3ff122%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible coming from a Fabric perspective

2015-05-20 Thread J Hawkesworth
Have you considered setting local facts. You could then test for the local fact 
being present and then skip steps which don't need to be repeated? 

-- 
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/842b49ee-18c7-43b6-b3ac-64a890d0c90c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: cannot get win_template to work

2015-05-29 Thread J Hawkesworth
Which ansible version are you using?

1.9.1 contains the action plugin for win_template, but needs win_file and 
win_copy modules to work, which weren't included in that release.

I just pushed a couple of PRs to improve win_copy / win_file / win_template 
and would be grateful for any feedback if you could test.

PRs are:

ansible/ansible#11086 
and
#1438 

Jon
On Thursday, May 28, 2015 at 6:46:13 PM UTC+1, Jake Dupuy wrote:
>
> Thanks for the reply, I've got a work around but do need to figure out 
> what was going wrong:
>
> - name: create script locally
>   local_action: template dest="{{ my_dest }}" src="{{ my_template }}"
>
> - name: run ps script on remote
>   script: "{{ my_ps_script }}"
>
> On Thursday, May 28, 2015 at 7:04:42 AM UTC-5, Jake Dupuy wrote:
>>
>> someone please help me out. I cannot get win_template or win_copy to 
>> work. I'm able to do a simple ipconfig test to confirm that ansible is 
>> working with windows I've got some powershell scripts that I need to have 
>> in a template with vars so I can put them on the windows box and run them. 
>> I've got a roles structure setup
>>
>> when I do this>>
>> - name: check file dir
>>   win_stat: path=C:\temp
>>   register: win_test
>>
>> - name: debug
>>   debug: var=win_test
>>
>> >>>output of the debug
>> ok: [172.16.0.81] => {
>> "var": {
>> "win_test": {
>> "changed": false,
>> "invocation": {
>> "module_args": "path=C:\\temp",
>> "module_name": "win_stat"
>> },
>> "stat": {
>> "exists": true,
>> "isdir": true
>> }
>> }
>> }
>> }
>> >>>
>>
>> - name: copy template
>>   win_template: dest=C:\temp src="{{ template_ps1 }}"
>>
>> >>>  but when I try and use the win_template I get:
>> "ERROR: win_template is not a legal parameter in an Ansible task or 
>> handler"
>>
>

-- 
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/5c568b84-6507-4063-8f48-4c55252ae7cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_template and line breaks

2015-05-29 Thread J Hawkesworth
Just to follow up, I have created new PRs which include the fixes described 
by Joey and added documentation about windows-style line endings to 
win_template module docs.

PRs are

https://github.com/ansible/ansible/pull/11086

https://github.com/ansible/ansible-modules-core/pull/1438


Jon
On Wednesday, February 11, 2015 at 6:37:22 PM UTC, J Hawkesworth wrote:
>
> Hi,
>
> Been meaning to say I discovered a few days ago that you can set the 
> following in your j2 templates to ensure windows-style line endings
>
> #jinja2: newline_sequence:'\r\n'
>
> I still want to do automatic detection of this but there is at least a 
> workaround (which would likely be backwardly compatible once auto detection 
> is in place).
>
> Jon
>
>
>
> On Thursday, December 18, 2014 at 5:48:02 PM UTC, Joey wrote:
>>
>> I'm using win_template to copy a text file with a couple variables to a 
>> windows client. However, it seems to be removing all lines breaks from the 
>> file. I tried using unix2dos on the template, as well as adding 
>> "#jinja2:trim_blocks: 
>> False", but neither one seemed to work. Any other ideas?
>>
>

-- 
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/161ab852-7b7e-4a86-952e-99f32063a794%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows Tag MisMatch

2015-06-03 Thread J Hawkesworth
Is your server 2008 r2 machine fully up to date with Windows updates. There is 
a known bug in wmf 3 - see the blue note box in the windows system prep section 
of this page in the documentation 
http://docs.ansible.com/intro_windows.html#windows-system-prep

Hope that helps. 

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/8bab95b7-4506-4f2e-849b-d8f82a3d8b5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows Tag MisMatch

2015-06-03 Thread J Hawkesworth
See http://docs.ansible.com/intro_windows.html#windows-system-prep 

Your server 2008 r2 machine may need to be patched due to a bug in wmf 3 

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/58744d1a-eaef-4b53-95e4-b98553399723%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: WinRM configuration script error

2015-06-04 Thread J Hawkesworth
Do you have windows management framework installed?

On Thursday, June 4, 2015 at 4:32:59 PM UTC+1, Rene Metery wrote:
>
> Hi,
>
> I am currently configuring a windows computer to accept remote access from 
> ansible and I am having a problem while running the 
> script ConfigureRemotingForAnsible.ps1.
>
> Here is the error :
>
> PS D:\Ansible\Power Shell 3> .\ConfigureRemotingForAnsible.ps1
> Unable to establish an HTTP or HTTPS remoting session.
> Au caractère D:\Ansible\Power Shell 3\ConfigureRemotingForAnsible.ps1:129 
> : 5
> + Throw "Unable to establish an HTTP or HTTPS remoting session."
> + ~~
> + CategoryInfo  : OperationStopped: (Unable to estab...moting 
> session.:String) [], RuntimeException
> + FullyQualifiedErrorId : Unable to establish an HTTP or HTTPS remoting 
> session.
>
>
> I have checked my authentication configuration an it seems ok.
>
> PS D:\Ansible\Power Shell 3> winrm get winrm/config
> Config
> MaxEnvelopeSizekb = 500
> MaxTimeoutms = 6
> MaxBatchItems = 32000
> MaxProviderRequests = 4294967295
> Client
> NetworkDelayms = 5000
> URLPrefix = wsman
> AllowUnencrypted = false
> Auth
> Basic = true
> Digest = true
> Kerberos = true
> Negotiate = true
> Certificate = true
> CredSSP = false
>
>
> If you have any idea about the problem it will greatly help me.
> I can't find any post about that problem.
> Cheers,
>
> René METERY
>

-- 
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/37903361-219c-47dd-bf35-0d5da64804ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: WinRM configuration script error

2015-06-05 Thread J Hawkesworth
My guess would be firewall configuration on the windows machine is stopping 
the remoting to localhost from working.
The other place to look would be in the winrm configuration.
Sometimes checking the windows event log can be helpful - have you looked 
there?

Jon

On Thursday, June 4, 2015 at 4:32:59 PM UTC+1, Rene Metery wrote:
>
> Hi,
>
> I am currently configuring a windows computer to accept remote access from 
> ansible and I am having a problem while running the 
> script ConfigureRemotingForAnsible.ps1.
>
> Here is the error :
>
> PS D:\Ansible\Power Shell 3> .\ConfigureRemotingForAnsible.ps1
> Unable to establish an HTTP or HTTPS remoting session.
> Au caractère D:\Ansible\Power Shell 3\ConfigureRemotingForAnsible.ps1:129 
> : 5
> + Throw "Unable to establish an HTTP or HTTPS remoting session."
> + ~~
> + CategoryInfo  : OperationStopped: (Unable to estab...moting 
> session.:String) [], RuntimeException
> + FullyQualifiedErrorId : Unable to establish an HTTP or HTTPS remoting 
> session.
>
>
> I have checked my authentication configuration an it seems ok.
>
> PS D:\Ansible\Power Shell 3> winrm get winrm/config
> Config
> MaxEnvelopeSizekb = 500
> MaxTimeoutms = 6
> MaxBatchItems = 32000
> MaxProviderRequests = 4294967295
> Client
> NetworkDelayms = 5000
> URLPrefix = wsman
> AllowUnencrypted = false
> Auth
> Basic = true
> Digest = true
> Kerberos = true
> Negotiate = true
> Certificate = true
> CredSSP = false
>
>
> If you have any idea about the problem it will greatly help me.
> I can't find any post about that problem.
> Cheers,
>
> René METERY
>

-- 
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/862982df-5c45-4773-b58b-1f7d28e9d562%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ERROR: win_file is not a legal parameter in an Ansible task or handler

2015-06-09 Thread J Hawkesworth
Actually win_copy and win_file were not included in 1.9.1. They are in 1.9.2 
rc1 but there were a couple of issues with win_copy for which I have made 
fixes. I hope these will be incorporated into 1.9.2 rc2.

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/9a08e784-6465-415f-9813-3a9b82245d2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] run a windows script once

2015-06-10 Thread J Hawkesworth
Something I have done in the past is wrap the command I want to run inside a 
powershell script but have the powershell script run a test-path first so the 
command only gets run if the test-path is false. That's not great though as the 
script always reports 'changed', so a module would be better. 

There is a win_package module which hasn't yet been merged which I believe will 
run exe files that might be just what you need. I have not tried it but it 
looks worth a go. 

You can use unmerged modules by copying them into your /etc/ansible/library 

Hope this helps. 

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/ab32eb40-27d1-425d-879d-cadef9498c1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ERROR: win_file is not a legal parameter in an Ansible task or handler

2015-06-10 Thread J Hawkesworth
I don't have a mac to try this out on but it seems you aren't picking up 
your modules.

I did a quick search and I found a couple of threads that might be relevant:

https://github.com/ansible/ansible/issues/5412

https://groups.google.com/forum/#!topic/ansible-project/Px4DyaHwD3I

I suggest

1/ trying a clean ansible installation, if possible
2/ checking your playbook for invalid yaml (use a yaml-aware text editor 
like notepad++ or www.yamllint.com)

Hope this helps,

Jon

On Wednesday, June 10, 2015 at 1:23:53 PM UTC+1, Slim Slam wrote:
>
> I think these might be the relevant module directories on my Mac:
>
> $ ls /Library/Python/2.7/site-packages/ansible/modules/core/windows
> __init__.py win_feature.ps1 win_get_url.py win_group.pyc win_ping.ps1 
> win_service.py win_stat.pyc
> __init__.pyc win_feature.py win_get_url.pyc win_msi.ps1 win_ping.py 
> win_service.pyc win_user.ps1
> setup.ps1 win_feature.pyc win_group.ps1 win_msi.py win_ping.pyc win_stat.ps1 
> win_user.py
> slurp.ps1 win_get_url.ps1 win_group.py win_msi.pyc win_service.ps1 
> win_stat.py win_user.pyc
>
> AND
>
> $ ls /Library/Python/2.7/site-packages/ansible/modules/extras/windows
> __init__.py win_chocolatey.ps1 win_chocolatey.pyc win_updates.py
> __init__.pyc win_chocolatey.py win_updates.ps1 win_updates.pyc
>
>
>
> On Wednesday, June 10, 2015 at 7:19:31 AM UTC-5, Slim Slam wrote:
>>
>> I've been installing Ansible using pip, e.g.  "sudo pip install 
>> --upgrade ansible"
>>
>> By the way, if the only task I have is this one:
>>
>> tasks:
>>   - win_chocolatey: 
>> name: PSWindowsUpdate 
>> state: present
>>
>> I get this error:
>>
>> ERROR: state is not a legal parameter in an Ansible task or handler
>>
>> I can't get any of the Windows tasks to work, but the Linux stuff works 
>> fine.
>>
>> On Wednesday, June 10, 2015 at 12:54:07 AM UTC-5, J Hawkesworth wrote:
>>>
>>> Actually win_copy and win_file were not included in 1.9.1. They are in 
>>> 1.9.2 rc1 but there were a couple of issues with win_copy for which I have 
>>> made fixes. I hope these will be incorporated into 1.9.2 rc2. 
>>>
>>> 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/8efa0e0f-20d2-4035-ab43-4d9d2ad4dd68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ERROR: win_file is not a legal parameter in an Ansible task or handler

2015-06-10 Thread J Hawkesworth
Have you set the module search path by modifying your ansible.cfg?

My 1.9.1 install shows

   configured module search path = None

unless I set a library= value in my ansible.cfg  (maybe cos I originally 
installed from yum though).


On Wednesday, June 10, 2015 at 5:22:45 PM UTC+1, Slim Slam wrote:
>
> Ok. I filed a documentation bug on the two windows modules which are not 
> in Ansible 1.9.1 (but the docs don't mention that):
> https://github.com/ansible/ansible/issues/11220
>
> After some further testing, it appears that the windows modules in the 
> "core/windows" directory
> work ok.  However, the windows modules in the "extras/windows" directory 
> don't seem to be loading. 
>
> Is my search path correct?
>
> $ ansible --version
> ansible 1.9.1
>   configured module search path = /Library/Python/2.7/site-packages/
> ansible/modules/core:/Library/Python/2.7/site-packages/ansible/modules/
> extras
>
> -J
>
> On Wednesday, June 10, 2015 at 8:51:05 AM UTC-5, Slim Slam wrote:
>>
>> I did "sudo pip uninstall ansible"  and then "sudo pip install ansible". 
>>  Made no difference.
>>
>> yamllint.com says that my ansible script is valid.
>>
>> I'm stumped.
>>
>> J
>>
>> On Wednesday, June 10, 2015 at 7:43:33 AM UTC-5, J Hawkesworth wrote:
>>>
>>> I don't have a mac to try this out on but it seems you aren't picking up 
>>> your modules.
>>>
>>> I did a quick search and I found a couple of threads that might be 
>>> relevant:
>>>
>>> https://github.com/ansible/ansible/issues/5412
>>>
>>> https://groups.google.com/forum/#!topic/ansible-project/Px4DyaHwD3I
>>>
>>> I suggest
>>>
>>> 1/ trying a clean ansible installation, if possible
>>> 2/ checking your playbook for invalid yaml (use a yaml-aware text editor 
>>> like notepad++ or www.yamllint.com)
>>>
>>> Hope this helps,
>>>
>>> Jon
>>>
>>> On Wednesday, June 10, 2015 at 1:23:53 PM UTC+1, Slim Slam wrote:
>>>>
>>>> I think these might be the relevant module directories on my Mac:
>>>>
>>>> $ ls /Library/Python/2.7/site-packages/ansible/modules/core/windows
>>>> __init__.py win_feature.ps1 win_get_url.py win_group.pyc win_ping.ps1 
>>>> win_service.py win_stat.pyc
>>>> __init__.pyc win_feature.py win_get_url.pyc win_msi.ps1 win_ping.py 
>>>> win_service.pyc win_user.ps1
>>>> setup.ps1 win_feature.pyc win_group.ps1 win_msi.py win_ping.pyc 
>>>> win_stat.ps1 win_user.py
>>>> slurp.ps1 win_get_url.ps1 win_group.py win_msi.pyc win_service.ps1 
>>>> win_stat.py win_user.pyc
>>>>
>>>> AND
>>>>
>>>> $ ls /Library/Python/2.7/site-packages/ansible/modules/extras/windows
>>>> __init__.py win_chocolatey.ps1 win_chocolatey.pyc win_updates.py
>>>> __init__.pyc win_chocolatey.py win_updates.ps1 win_updates.pyc
>>>>
>>>>
>>>>
>>>> On Wednesday, June 10, 2015 at 7:19:31 AM UTC-5, Slim Slam wrote:
>>>>>
>>>>> I've been installing Ansible using pip, e.g.  "sudo pip install 
>>>>> --upgrade ansible"
>>>>>
>>>>> By the way, if the only task I have is this one:
>>>>>
>>>>> tasks:
>>>>>   - win_chocolatey: 
>>>>> name: PSWindowsUpdate 
>>>>> state: present
>>>>>
>>>>> I get this error:
>>>>>
>>>>> ERROR: state is not a legal parameter in an Ansible task or handler
>>>>>
>>>>> I can't get any of the Windows tasks to work, but the Linux stuff 
>>>>> works fine.
>>>>>
>>>>> On Wednesday, June 10, 2015 at 12:54:07 AM UTC-5, J Hawkesworth wrote:
>>>>>>
>>>>>> Actually win_copy and win_file were not included in 1.9.1. They are 
>>>>>> in 1.9.2 rc1 but there were a couple of issues with win_copy for which I 
>>>>>> have made fixes. I hope these will be incorporated into 1.9.2 rc2. 
>>>>>>
>>>>>> 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/f1d7e170-36d9-4a05-85c8-023cba14d9be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ERROR: win_file is not a legal parameter in an Ansible task or handler

2015-06-11 Thread J Hawkesworth
I haven't tried chocolatey but I can get win_updates to execute.  But my 
ansible was installed via yum and I'm not on a mac.

It does feel like something is stopping ansible from finding parts of 
itself.  Have you upgraded from an older ansible version (or did you start 
with a fresh 1.9.1 install the first time)?  Have you ever also pulled 
directly from github?

Jon


On Thursday, June 11, 2015 at 3:14:15 AM UTC+1, Slim Slam wrote:
>
> It originally said "path = None" but I then explicitly set the path. It 
> didn't make
> a difference. Still broken. Are you able to access update and chocolatey?
>
> J
>
> On Wednesday, June 10, 2015 at 3:29:45 PM UTC-5, J Hawkesworth wrote:
>>
>> Have you set the module search path by modifying your ansible.cfg?
>>
>> My 1.9.1 install shows
>>
>>configured module search path = None
>>
>> unless I set a library= value in my ansible.cfg  (maybe cos I originally 
>> installed from yum though).
>>
>>
>> On Wednesday, June 10, 2015 at 5:22:45 PM UTC+1, Slim Slam wrote:
>>>
>>> Ok. I filed a documentation bug on the two windows modules which are not 
>>> in Ansible 1.9.1 (but the docs don't mention that):
>>> https://github.com/ansible/ansible/issues/11220
>>>
>>> After some further testing, it appears that the windows modules in the 
>>> "core/windows" directory
>>> work ok.  However, the windows modules in the "extras/windows" directory 
>>> don't seem to be loading. 
>>>
>>> Is my search path correct?
>>>
>>> $ ansible --version
>>> ansible 1.9.1
>>>   configured module search path = /Library/Python/2.7/site-packages/
>>> ansible/modules/core:/Library/Python/2.7/site-packages/ansible/modules/
>>> extras
>>>
>>> -J
>>>
>>> On Wednesday, June 10, 2015 at 8:51:05 AM UTC-5, Slim Slam wrote:
>>>>
>>>> I did "sudo pip uninstall ansible"  and then "sudo pip install 
>>>> ansible".  Made no difference.
>>>>
>>>> yamllint.com says that my ansible script is valid.
>>>>
>>>> I'm stumped.
>>>>
>>>> J
>>>>
>>>> On Wednesday, June 10, 2015 at 7:43:33 AM UTC-5, J Hawkesworth wrote:
>>>>>
>>>>> I don't have a mac to try this out on but it seems you aren't picking 
>>>>> up your modules.
>>>>>
>>>>> I did a quick search and I found a couple of threads that might be 
>>>>> relevant:
>>>>>
>>>>> https://github.com/ansible/ansible/issues/5412
>>>>>
>>>>> https://groups.google.com/forum/#!topic/ansible-project/Px4DyaHwD3I
>>>>>
>>>>> I suggest
>>>>>
>>>>> 1/ trying a clean ansible installation, if possible
>>>>> 2/ checking your playbook for invalid yaml (use a yaml-aware text 
>>>>> editor like notepad++ or www.yamllint.com)
>>>>>
>>>>> Hope this helps,
>>>>>
>>>>> Jon
>>>>>
>>>>> On Wednesday, June 10, 2015 at 1:23:53 PM UTC+1, Slim Slam wrote:
>>>>>>
>>>>>> I think these might be the relevant module directories on my Mac:
>>>>>>
>>>>>> $ ls /Library/Python/2.7/site-packages/ansible/modules/core/windows
>>>>>> __init__.py win_feature.ps1 win_get_url.py win_group.pyc win_ping.ps1 
>>>>>> win_service.py win_stat.pyc
>>>>>> __init__.pyc win_feature.py win_get_url.pyc win_msi.ps1 win_ping.py 
>>>>>> win_service.pyc win_user.ps1
>>>>>> setup.ps1 win_feature.pyc win_group.ps1 win_msi.py win_ping.pyc 
>>>>>> win_stat.ps1 win_user.py
>>>>>> slurp.ps1 win_get_url.ps1 win_group.py win_msi.pyc win_service.ps1 
>>>>>> win_stat.py win_user.pyc
>>>>>>
>>>>>> AND
>>>>>>
>>>>>> $ ls /Library/Python/2.7/site-packages/ansible/modules/extras/windows
>>>>>> __init__.py win_chocolatey.ps1 win_chocolatey.pyc win_updates.py
>>>>>> __init__.pyc win_chocolatey.py win_updates.ps1 win_updates.pyc
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wednesday, June 10, 2015 at 7:19:31 AM UTC-5, Slim Slam wrote:
>>>>>>>
>>>>>>> I've been installing Ansible using pip

Re: [ansible-project] ERROR: win_file is not a legal parameter in an Ansible task or handler

2015-06-11 Thread J Hawkesworth
I think latest devel is only available by cloning from github.

I am hoping there will be a 1.9.2 release candidate 2 soon which might 
include these modules.

Jon

On Thursday, June 11, 2015 at 5:40:39 PM UTC+1, Slim Slam wrote:
>
> Since v1.9.2 is not released yet, is there a way to use pip to upgrade to 
> the latest development version of 1.9.2?
>
> J
>
> On Thursday, June 11, 2015 at 11:37:59 AM UTC-5, Jake Dupuy wrote:
>>
>> I've got a similar issue, I need to get win_file working for one of my 
>> plays. Sounds like upgrade to 1.9.2 should do the trick?
>>
>>
>> On Thursday, June 11, 2015 at 11:27:51 AM UTC-5, Slim Slam wrote:
>>>
>>> If you look back  through this thread, you'll see that I unistalled and 
>>> then reinstalled Ansible. It didn't change anything.
>>> The core windows modules work, but not the windows modules in extras.
>>>
>>> J
>>>
>>> On Thursday, June 11, 2015 at 11:02:59 AM UTC-5, J Hawkesworth wrote:
>>>>
>>>> I haven't tried chocolatey but I can get win_updates to execute.  But 
>>>> my ansible was installed via yum and I'm not on a mac.
>>>>
>>>> It does feel like something is stopping ansible from finding parts of 
>>>> itself.  Have you upgraded from an older ansible version (or did you start 
>>>> with a fresh 1.9.1 install the first time)?  Have you ever also pulled 
>>>> directly from github?
>>>>
>>>> Jon
>>>>
>>>>
>>>> On Thursday, June 11, 2015 at 3:14:15 AM UTC+1, Slim Slam wrote:
>>>>>
>>>>> It originally said "path = None" but I then explicitly set the path. 
>>>>> It didn't make
>>>>> a difference. Still broken. Are you able to access update and 
>>>>> chocolatey?
>>>>>
>>>>> J
>>>>>
>>>>> On Wednesday, June 10, 2015 at 3:29:45 PM UTC-5, J Hawkesworth wrote:
>>>>>>
>>>>>> Have you set the module search path by modifying your ansible.cfg?
>>>>>>
>>>>>> My 1.9.1 install shows
>>>>>>
>>>>>>configured module search path = None
>>>>>>
>>>>>> unless I set a library= value in my ansible.cfg  (maybe cos I 
>>>>>> originally installed from yum though).
>>>>>>
>>>>>>
>>>>>> On Wednesday, June 10, 2015 at 5:22:45 PM UTC+1, Slim Slam wrote:
>>>>>>>
>>>>>>> Ok. I filed a documentation bug on the two windows modules which are 
>>>>>>> not in Ansible 1.9.1 (but the docs don't mention that):
>>>>>>> https://github.com/ansible/ansible/issues/11220
>>>>>>>
>>>>>>> After some further testing, it appears that the windows modules in 
>>>>>>> the "core/windows" directory
>>>>>>> work ok.  However, the windows modules in the "extras/windows" 
>>>>>>> directory don't seem to be loading. 
>>>>>>>
>>>>>>> Is my search path correct?
>>>>>>>
>>>>>>> $ ansible --version
>>>>>>> ansible 1.9.1
>>>>>>>   configured module search path = /Library/Python/2.7/site-packages/
>>>>>>> ansible/modules/core:/Library/Python/2.7/site-packages/ansible/
>>>>>>> modules/extras
>>>>>>>
>>>>>>> -J
>>>>>>>
>>>>>>> On Wednesday, June 10, 2015 at 8:51:05 AM UTC-5, Slim Slam wrote:
>>>>>>>>
>>>>>>>> I did "sudo pip uninstall ansible"  and then "sudo pip install 
>>>>>>>> ansible".  Made no difference.
>>>>>>>>
>>>>>>>> yamllint.com says that my ansible script is valid.
>>>>>>>>
>>>>>>>> I'm stumped.
>>>>>>>>
>>>>>>>> J
>>>>>>>>
>>>>>>>> On Wednesday, June 10, 2015 at 7:43:33 AM UTC-5, J Hawkesworth 
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> I don't have a mac to try this out on but it seems you aren't 
>>>>>>>>> picking up your modules.
>>>>>>>

[ansible-project] Re: WinRMTransportError: Bad HTTP response returned from server. Code 500

2015-06-12 Thread J Hawkesworth
I think there are others who have experienced something similar:

https://github.com/ansible/ansible/issues/9980

It is possible that you are hitting one of the quota limits set in the 
winrm configuration 
- https://msdn.microsoft.com/en-us/library/ee309367%28v=vs.85%29.aspx

Personally I only use win_copy to push out small files usually less than 
1Mb.  To transfer large binary files it is much quicker to use the 
win_get_url module to make the remote host retrieve them.

Jon

On Friday, June 12, 2015 at 2:19:55 PM UTC+1, rrrki...@gmail.com wrote:
>
> Hi ,
>
> I am trying to copy file to windows using win_copy and file size is around 
> 20 mb , i am getting following error
>
> Traceback (most recent call last):
>   File 
> "/usr/lib/python2.6/site-packages/ansible/runner/connection_plugins/winrm.py",
>  
> line 198, in put_file
> result = self._winrm_exec(cmd_parts[0], cmd_parts[1:])
>   File 
> "/usr/lib/python2.6/site-packages/ansible/runner/connection_plugins/winrm.py",
>  
> line 125, in _winrm_exec
> command_id = self.protocol.run_command(self.shell_id, command, args)
>   File "/usr/lib/python2.6/site-packages/winrm/protocol.py", line 232, in 
> run_command
> rs = self.send_message(xmltodict.unparse(rq))
>   File "/usr/lib/python2.6/site-packages/winrm/protocol.py", line 173, in 
> send_message
> return self.transport.send_message(message)
>   File "/usr/lib/python2.6/site-packages/winrm/transport.py", line 95, in 
> send_message
> raise WinRMTransportError(error_message)
> WinRMTransportError: Bad HTTP response returned from server. Code 500
>
>
> Any idea on this .. please suggest me if anyone faced this issue.
>
> Thanks
> Ravi 
>

-- 
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/4d5fbdbe-0269-4df2-bf53-b7fdfa864089%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: this module requires key=value arguments ??

2015-06-15 Thread J Hawkesworth
It depends on what your goals are.

1.9.2 will be maintenance release of the v 1 codebase.

Current devel, which will eventually be 2.0, has completely refactored 
core.  

On Monday, June 15, 2015 at 11:57:15 AM UTC+1, Barry Kaplan wrote:
>
> Well I scp'ed my ansible checkout from my mac to my linux and all works 
> now. So yes, it must be mismatches in the ansible branch and modules. But I 
> have no idea how I got my mac into the state its in (ie, working) that is 
> different from what I did with my linux box.
>
> I have been trying to run with 1.9.2-rc. But is that much different from 
> master/2.0? Should I just stay on master?
>

-- 
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/d23f29c9-eb6e-4c44-aef2-a085e922e6fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Managing windows using an domain admin user

2015-06-15 Thread J Hawkesworth
Hello, 

You need to use

usern...@full.domain.name

Also make sure you have installed kerberos and configured your ansible 
controller as a kerberos client. 

Depending on how you set things up, you may need to acquire a kerberos ticket 
by running 

kinit  usern...@full.domain.name 

before running your playbook. 

You can test if you have got a kerberos ticket by running 

klist 

Hope this helps, 

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/a79846a0-8789-4c9d-84ad-f308d67d2a2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Run powershell command as administrator

2015-06-18 Thread J Hawkesworth
If it is working on \\srv01\ but not on \\srv02 then there is a difference 
between the two machines.

I suggest you check the event log on \\srv02, the configuration of the 
share02 sharing and the firewall on \\srv02 

If you are not using Active Directory domain user, also check the same 
username and password is set up on \\svr02 as \\svr01

Hope this helps,

Let us know how you get on.

Jon

On Thursday, June 18, 2015 at 7:31:38 PM UTC+1, ale...@pollie.me wrote:
>
> Hi @all,
>>
> I have almost identical issue.
> I am running powershell script on srv01:
> get-childitem \\srv01\share01
> get-childitem \\srv02\share02
> The first one is executing without issues, but on second one i am 
> receiving Access Denied.
> It doesn't look like double hop trouble, but anyway just in case i've 
> enabled PSRemoting and Enable-WsmanCredSSP just in case.
>
>

-- 
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/7c557439-43e6-4e93-a55f-41245f78d8e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Run powershell command as administrator

2015-06-19 Thread J Hawkesworth
I think what you describe is basically second hop issue then..

I just found 
this https://msdn.microsoft.com/en-us/library/ee309365(v=vs.85).aspx 
regarding multi-hop configuration for winrm - I suggest working through it 
and seeing if it is any help.

Jon 

On Friday, June 19, 2015 at 8:16:23 AM UTC+1, ale...@pollie.me wrote:
>
> Both servers are domain members and i am using domain administrator 
> account.
> Following scheme doesn't work neither:
>
> Ansible ---> srv01 ---> srv01   works
>|
>---> srv02  doesn't work
>
> Ansible ---> srv02  ---> srv02  works
> |
> ---> srv01  doesn't work
>
> This issue is quite critical for me as i really need to deploy windows 
> machines the same way i do linux.
>
> On Friday, June 19, 2015 at 2:13:19 AM UTC+2, Trond Hindenes wrote:
>>
>> So just to sum up:
>> Ansible-->srv01: You can list stuff in \\srv01\ but not \\srv02
>>
>> Are you connecting to srv01 from ansible using a domain account or a 
>> local account? If local it's pretty logical that you have this issue: The 
>> user doesn't have any permissions outside srv01, so that's the only thing 
>> you can see.
>>
>> For cross-machine boundaries you need to connect using a domain account. 
>> Or you can write an Ansible module which takes username/password as a 
>> parameter and pass that in (look at the PR for win_package in the 
>> "ansible-modules-extras" repo on githug, it has the functionality to get 
>> files from a unc share using explicitly defined credentials.
>>
>

-- 
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/e4e6b42e-a6ea-402e-83e1-0c03fc197b2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Based on hostname select variables.

2015-06-22 Thread J Hawkesworth
There probably several ways of doing this.

To start with have a look at 'host_vars' - you can set variables for each 
machine in your inventory: 
http://docs.ansible.com/intro_inventory.html#host-variables

You will probably find very soon after that you want to set the same 
variables for groups of servers, so read about group vars as well (on the 
same page).

Hope this helps,

Jon


On Monday, June 22, 2015 at 12:46:56 PM UTC+1, Dhanasekaran Anbalagan wrote:
>
> Hi Guys,
>
> I am new to ansible world, Based on hostname I need to select variables 
> and feed input to template file.
>
> In my case :: I need to deploy app on multiple hosts, based on hostname I 
> need to configure db_name and db_user and db_pass etc..
>
> Please guide me, How to do this.
>
>
> -Dhanasekaran.
>
> Did I learn something today? If not, I wasted it.
>  

-- 
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/2f10f20f-87d7-47ea-a28f-5fad65c093f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: connection with windows

2015-06-22 Thread J Hawkesworth
Looks like you just need to add your server into a group called windows - 
the example here shows the group 
http://docs.ansible.com/intro_windows.html#inventory

So your inventory file needs to look like this:

[windows]
WIN-F6531IBP8HG

The group vars will then take effect for your host and ansible will know to 
connect via winrm instead of ssh, which it is trying at the moment (which 
isn't going to work as Windows doesn't understand SSH).

Hope this helps,

Jon

On Monday, June 22, 2015 at 12:46:56 PM UTC+1, Guillaume Querso wrote:
>
> Hello, i am running ansible 1.9.1 on a Ubuntu server 14.04.2, my remote 
> machine is a windows 7 sp1.
> i have the following files and error message, i don't understand where the 
> issue is.. 
>
> /etc/ansible/group_vars/windows.yml
>
> ansible_ssh_user: AnsibleUser
> ansible_ssh_pass: ansiblepass
> ansible_ssh_port: 5986
> ansible_connection: winrm
>
> /etc/ansible/winplaybook.yml
>
>- hosts: WIN-F6531IBP8HG tasks:
>   - name: unarchive unarchive: src=/tmp/hello.txt.zip 
>   dest=C:\Users\Querso\Desktop
>
> /etc/ansible/hosts
>
> WIN-F6531IBP8HG
>
> i have python 2.7.6 and i have the following error message:
> ansible-playbook /etc/ansible/winplaybook.yml -i WIN-F6531IBP8HG,
>
> PLAY [WIN-F6531IBP8HG] 
> 
>
> GATHERING FACTS 
> *** 
> fatal: [WIN-F6531IBP8HG] => SSH Error: Permission denied 
> (publickey,password,keyboard-interactive).
> while connecting to 192.168.79.133:22
> It is sometimes useful to re-run the command using -, which prints SSH 
> debug output to help diagnose the issue.
>
> TASK: [unarchive] 
> * 
> FATAL: no hosts matched or all hosts have already failed -- aborting
>
> PLAY RECAP 
>  
> to retry, use: --limit @/home/guillaume/winplaybook.retry
>
> WIN-F6531IBP8HG : ok=0 changed=0 unreachable=1 failed=0
>
> if i try to ping windows:
> ansible WIN-F6531IBP8HG -m win_ping
> WIN-F6531IBP8HG | FAILED => SSH Error: Permission denied 
> (publickey,password,keyboard-interactive).
> while connecting to 192.168.79.133:22
> It is sometimes useful to re-run the command using -, which prints SSH 
> debug output to help diagnose the issue.
>
> thanks for your 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/8c825a50-899a-400d-8a49-dbfa9bc39de1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: connection with windows

2015-06-22 Thread J Hawkesworth
Looks like you have hit the windows management framework 3.0 bug described 
in the blue box here:

http://docs.ansible.com/intro_windows.html#windows-system-prep

Since win_ping is working for you now, you just need to install the hotfix 
to get up and running:

http://support.microsoft.com/kb/2842230

Jon

On Monday, June 22, 2015 at 1:56:30 PM UTC+1, Guillaume Querso wrote:
>
> i have done this as said in my edit but it is not working for the 
> playbook. do i have anything else to do to make it run properly? 
>
> Le lundi 22 juin 2015 13:48:43 UTC+1, J Hawkesworth a écrit :
>>
>> Looks like you just need to add your server into a group called windows - 
>> the example here shows the group 
>> http://docs.ansible.com/intro_windows.html#inventory
>>
>> So your inventory file needs to look like this:
>>
>> [windows]
>> WIN-F6531IBP8HG
>>
>> The group vars will then take effect for your host and ansible will know 
>> to connect via winrm instead of ssh, which it is trying at the moment 
>> (which isn't going to work as Windows doesn't understand SSH).
>>
>> Hope this helps,
>>
>> Jon
>>
>> On Monday, June 22, 2015 at 12:46:56 PM UTC+1, Guillaume Querso wrote:
>>>
>>> Hello, i am running ansible 1.9.1 on a Ubuntu server 14.04.2, my remote 
>>> machine is a windows 7 sp1.
>>> i have the following files and error message, i don't understand where 
>>> the issue is.. 
>>>
>>> /etc/ansible/group_vars/windows.yml
>>>
>>> ansible_ssh_user: AnsibleUser
>>> ansible_ssh_pass: ansiblepass
>>> ansible_ssh_port: 5986
>>> ansible_connection: winrm
>>>
>>> /etc/ansible/winplaybook.yml
>>>
>>>- hosts: WIN-F6531IBP8HG tasks:
>>>   - name: unarchive unarchive: src=/tmp/hello.txt.zip 
>>>   dest=C:\Users\Querso\Desktop
>>>
>>> /etc/ansible/hosts
>>>
>>> WIN-F6531IBP8HG
>>>
>>> i have python 2.7.6 and i have the following error message:
>>> ansible-playbook /etc/ansible/winplaybook.yml -i WIN-F6531IBP8HG,
>>>
>>> PLAY [WIN-F6531IBP8HG] 
>>> 
>>>
>>> GATHERING FACTS 
>>> *** 
>>> fatal: [WIN-F6531IBP8HG] => SSH Error: Permission denied 
>>> (publickey,password,keyboard-interactive).
>>> while connecting to 192.168.79.133:22
>>> It is sometimes useful to re-run the command using -, which prints 
>>> SSH debug output to help diagnose the issue.
>>>
>>> TASK: [unarchive] 
>>> * 
>>> FATAL: no hosts matched or all hosts have already failed -- aborting
>>>
>>> PLAY RECAP 
>>>  
>>> to retry, use: --limit @/home/guillaume/winplaybook.retry
>>>
>>> WIN-F6531IBP8HG : ok=0 changed=0 unreachable=1 failed=0
>>>
>>> if i try to ping windows:
>>> ansible WIN-F6531IBP8HG -m win_ping
>>> WIN-F6531IBP8HG | FAILED => SSH Error: Permission denied 
>>> (publickey,password,keyboard-interactive).
>>> while connecting to 192.168.79.133:22
>>> It is sometimes useful to re-run the command using -, which prints 
>>> SSH debug output to help diagnose the issue.
>>>
>>> thanks for your 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/c53a555c-d30c-45d6-964d-2fa13a410d60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible up and running book - first playbook exampe

2015-06-22 Thread J Hawkesworth
I think you just need to line up your whitespace correctly. Indentation 
level is significant in YAML - have a look at the yaml primer 
http://docs.ansible.com/YAMLSyntax.htmlor use yamlint if you need to check 
your playbook.

Hope this helps.

Jon

On Monday, June 22, 2015 at 12:46:58 PM UTC+1, Julien Deloubes wrote:
>
> Hello,
> just learning Ansible with Vagrant and the help of the book "Ansible up 
> and running".
>
> I cannot execute the first playbook  in the book i always had a syntax 
> error.
> Ansible version: 1.9.1
>
> Playbook :
>
> - name: Configure webserver with nginx
> hosts: webservers
> sudo: True
> tasks:
> - name: install nginx
> apt: name=nginx update_cache=yes
> - name: copy nginx config file
> copy: src=files/nginx.conf dest=/etc/nginx/sites-available/default
> - name: enable configuration
> file: >
> dest=/etc/nginx/sites-enabled/default
> src=/etc/nginx/sites-available/default
> state=link
> - name: copy index.html
> template: src=templates/index.html.j2 dest=/usr/share/nginx/html/index.html
> mode=0644
> - name: restart nginx
> service: name=nginx state=restarted
>
> Error:
> ERROR: Syntax Error while loading YAML script, web-notls.yml
> Note: The error may actually appear before this position: line 3, column 2
>
> - name: Configure webserver with nginx
>  hosts: webservers
>  ^
>
> I couldn't find where the syntax is faulty here, do you have any clues?
>
> Thanks.
>

-- 
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/f371a2aa-76fc-4265-bacd-934229f4d917%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: connection with windows

2015-06-22 Thread J Hawkesworth
It is a bug in windows management framework which incorrectly sets the 
amount of memory available to processes connected via winrm - its really 
outside Ansible's domain.

If you can't install the hotfix another way to get round it is to install 
windows managment framework 4, which doesn't have this particular bug (and 
has the advantage of giving you powershell 4.0 which has a number of useful 
extra features over powershell 3.0).

Hope this helps

Jon

On Monday, June 22, 2015 at 3:17:29 PM UTC+1, Guillaume Querso wrote:
>
> i can't install the hotfix, i am stuck on the terms ans conditions 
> page. 
> is this bug related to ansible-playbook because i can make a ping but not 
> run my playbook?
>
> Le lundi 22 juin 2015 14:50:22 UTC+1, J Hawkesworth a écrit :
>>
>> Looks like you have hit the windows management framework 3.0 bug 
>> described in the blue box here:
>>
>> http://docs.ansible.com/intro_windows.html#windows-system-prep
>>
>> Since win_ping is working for you now, you just need to install the 
>> hotfix to get up and running:
>>
>> http://support.microsoft.com/kb/2842230
>>
>> Jon
>>
>> On Monday, June 22, 2015 at 1:56:30 PM UTC+1, Guillaume Querso wrote:
>>>
>>> i have done this as said in my edit but it is not working for the 
>>> playbook. do i have anything else to do to make it run properly? 
>>>
>>> Le lundi 22 juin 2015 13:48:43 UTC+1, J Hawkesworth a écrit :
>>>>
>>>> Looks like you just need to add your server into a group called windows 
>>>> - the example here shows the group 
>>>> http://docs.ansible.com/intro_windows.html#inventory
>>>>
>>>> So your inventory file needs to look like this:
>>>>
>>>> [windows]
>>>> WIN-F6531IBP8HG
>>>>
>>>> The group vars will then take effect for your host and ansible will 
>>>> know to connect via winrm instead of ssh, which it is trying at the moment 
>>>> (which isn't going to work as Windows doesn't understand SSH).
>>>>
>>>> Hope this helps,
>>>>
>>>> Jon
>>>>
>>>> On Monday, June 22, 2015 at 12:46:56 PM UTC+1, Guillaume Querso wrote:
>>>>>
>>>>> Hello, i am running ansible 1.9.1 on a Ubuntu server 14.04.2, my 
>>>>> remote machine is a windows 7 sp1.
>>>>> i have the following files and error message, i don't understand where 
>>>>> the issue is.. 
>>>>>
>>>>> /etc/ansible/group_vars/windows.yml
>>>>>
>>>>> ansible_ssh_user: AnsibleUser
>>>>> ansible_ssh_pass: ansiblepass
>>>>> ansible_ssh_port: 5986
>>>>> ansible_connection: winrm
>>>>>
>>>>> /etc/ansible/winplaybook.yml
>>>>>
>>>>>- hosts: WIN-F6531IBP8HG tasks:
>>>>>   - name: unarchive unarchive: src=/tmp/hello.txt.zip 
>>>>>   dest=C:\Users\Querso\Desktop
>>>>>
>>>>> /etc/ansible/hosts
>>>>>
>>>>> WIN-F6531IBP8HG
>>>>>
>>>>> i have python 2.7.6 and i have the following error message:
>>>>> ansible-playbook /etc/ansible/winplaybook.yml -i WIN-F6531IBP8HG,
>>>>>
>>>>> PLAY [WIN-F6531IBP8HG] 
>>>>> 
>>>>>
>>>>> GATHERING FACTS 
>>>>> *** 
>>>>> fatal: [WIN-F6531IBP8HG] => SSH Error: Permission denied 
>>>>> (publickey,password,keyboard-interactive).
>>>>> while connecting to 192.168.79.133:22
>>>>> It is sometimes useful to re-run the command using -, which prints 
>>>>> SSH debug output to help diagnose the issue.
>>>>>
>>>>> TASK: [unarchive] 
>>>>> * 
>>>>> FATAL: no hosts matched or all hosts have already failed -- aborting
>>>>>
>>>>> PLAY RECAP 
>>>>>  
>>>>> to retry, use: --limit @/home/guillaume/winplaybook.retry
>>>>>
>>>>> WIN-F6531IBP8HG : ok=0 changed=0 unreachable=1 failed=0
>>>>>
>>>>> if i try to ping windows:
>>>>> ansible WIN-F6531IBP8HG -m win_ping
>>>>> WIN-F6531IBP8HG | FAILED => SSH Error: Permission denied 
>>>>> (publickey,password,keyboard-interactive).
>>>>> while connecting to 192.168.79.133:22
>>>>> It is sometimes useful to re-run the command using -, which prints 
>>>>> SSH debug output to help diagnose the issue.
>>>>>
>>>>> thanks for your 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/c9cccb0a-cb0c-496f-8a05-92f41a858bb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: connection with windows

2015-06-23 Thread J Hawkesworth
Maybe try different web browser to download the hotfix?
You either need the hotfix or Windows Management Framework 4.0 as far as I 
can tell.
Jon

On Tuesday, June 23, 2015 at 9:54:31 AM UTC+1, Guillaume Querso wrote:
>
> thank you for your answer, indeed it is not a windows package but sadly it 
> didn't solved my problem...
>
> Le mardi 23 juin 2015 00:48:03 UTC+1, Trond Hindenes a écrit :
>>
>> On a side note: To me it looks like you're trying to use the "unarchive" 
>> module on a windows node. That won't work. You need to use a module listed 
>> in "Windows modules": 
>> http://docs.ansible.com/list_of_windows_modules.html
>>
>> On Monday, June 22, 2015 at 5:22:50 PM UTC+2, J Hawkesworth wrote:
>>>
>>> It is a bug in windows management framework which incorrectly sets the 
>>> amount of memory available to processes connected via winrm - its really 
>>> outside Ansible's domain.
>>>
>>> If you can't install the hotfix another way to get round it is to 
>>> install windows managment framework 4, which doesn't have this particular 
>>> bug (and has the advantage of giving you powershell 4.0 which has a number 
>>> of useful extra features over powershell 3.0).
>>>
>>> Hope this helps
>>>
>>> Jon
>>>
>>> On Monday, June 22, 2015 at 3:17:29 PM UTC+1, Guillaume Querso wrote:
>>>>
>>>> i can't install the hotfix, i am stuck on the terms ans conditions 
>>>> page. 
>>>> is this bug related to ansible-playbook because i can make a ping but 
>>>> not run my playbook?
>>>>
>>>> Le lundi 22 juin 2015 14:50:22 UTC+1, J Hawkesworth a écrit :
>>>>>
>>>>> Looks like you have hit the windows management framework 3.0 bug 
>>>>> described in the blue box here:
>>>>>
>>>>> http://docs.ansible.com/intro_windows.html#windows-system-prep
>>>>>
>>>>> Since win_ping is working for you now, you just need to install the 
>>>>> hotfix to get up and running:
>>>>>
>>>>> http://support.microsoft.com/kb/2842230
>>>>>
>>>>> Jon
>>>>>
>>>>> On Monday, June 22, 2015 at 1:56:30 PM UTC+1, Guillaume Querso wrote:
>>>>>>
>>>>>> i have done this as said in my edit but it is not working for the 
>>>>>> playbook. do i have anything else to do to make it run properly? 
>>>>>>
>>>>>> Le lundi 22 juin 2015 13:48:43 UTC+1, J Hawkesworth a écrit :
>>>>>>>
>>>>>>> Looks like you just need to add your server into a group called 
>>>>>>> windows - the example here shows the group 
>>>>>>> http://docs.ansible.com/intro_windows.html#inventory
>>>>>>>
>>>>>>> So your inventory file needs to look like this:
>>>>>>>
>>>>>>> [windows]
>>>>>>> WIN-F6531IBP8HG
>>>>>>>
>>>>>>> The group vars will then take effect for your host and ansible will 
>>>>>>> know to connect via winrm instead of ssh, which it is trying at the 
>>>>>>> moment 
>>>>>>> (which isn't going to work as Windows doesn't understand SSH).
>>>>>>>
>>>>>>> Hope this helps,
>>>>>>>
>>>>>>> Jon
>>>>>>>
>>>>>>> On Monday, June 22, 2015 at 12:46:56 PM UTC+1, Guillaume Querso 
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hello, i am running ansible 1.9.1 on a Ubuntu server 14.04.2, my 
>>>>>>>> remote machine is a windows 7 sp1.
>>>>>>>> i have the following files and error message, i don't understand 
>>>>>>>> where the issue is.. 
>>>>>>>>
>>>>>>>> /etc/ansible/group_vars/windows.yml
>>>>>>>>
>>>>>>>> ansible_ssh_user: AnsibleUser
>>>>>>>> ansible_ssh_pass: ansiblepass
>>>>>>>> ansible_ssh_port: 5986
>>>>>>>> ansible_connection: winrm
>>>>>>>>
>>>>>>>> /etc/ansible/winplaybook.yml
>>>>>>>>
>>>>>>>>- hosts: WIN-F6531IBP8HG tasks:
>>>>&

  1   2   3   4   5   6   7   8   9   >