[ansible-project] Re: ansible windows raw module no response?

2016-08-01 Thread 'J Hawkesworth' via Ansible Project
An optional configurable timeout would be nice, but I have some tasks that 
run for over 60 minutes so I would not want a short default.

Can you use Remote Desktop to check if your program is well perhaps?

On Monday, August 1, 2016 at 2:02:45 PM UTC+1, fcx...@gmail.com wrote:
>
>  Thanks for your answer.I am not sure whether my program is well.But I 
> think ansible should close the task if the task exec too long.
>
> 在 2016年7月28日星期四 UTC+8上午7:34:49,J Hawkesworth写道:
>>
>> If it is always running then may be you need to set up whatever the 
>> run.bat does as a windows service.  
>> You can install nssm.exe and use win_nssm module to install programs as 
>> services, and then use the win_service module to start and stop them.
>>
>> You can use fetch module against windows machines if you just want to 
>> fetch log files when you run your playbook too.
>>
>> There are lots of programs around that can collect log files and forward 
>> them to another machine for processing. Two that I have heard of, but not 
>> used are NXLOG and Elastic Filebeat.
>>
>> Hope this helps,
>>
>> Jon
>>
>>
>>
>> On Wednesday, July 27, 2016 at 5:28:56 PM UTC+1, fcx...@gmail.com wrote:
>>>
>>> I just want to run my bat by raw module,like 
>>> - name: exec run.bat
>>>  raw: C:\run.bat
>>>
>>> The bat is about a program that get logs,so it will be always 
>>> running,like Daemon. When I exec ansible-playbook,the task can't go on.How 
>>> can I do?
>>>
>>

-- 
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/0d96f5ec-a180-4dce-adc3-3eb0189062a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible executes task regardless of conditional

2016-08-01 Thread 'J Hawkesworth' via Ansible Project
This isn't a pattern I use but I just wonder if you need to ensure that the 
list of hosts you are creating is held as a list

set_fact:
   my_group: "{{ just_created | list }}"

hosts: "{{ my_group }}"
or possibly even

On Monday, August 1, 2016 at 4:04:37 PM UTC+1, Trond Hindenes wrote:
>
> As far as I can see, weird things start happening when using a variable as 
> a target for hosts.
> If I do:   hosts: just_created things look good, but if I capture that 
> value in a variable instead, things fall to pieces:
>
> hosts: "{{ my_group }}"
>

-- 
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/d9fe7707-d562-4428-97c1-269ec5257de5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Why a progress over when ansible exec all tasks on windows?

2016-08-01 Thread 'J Hawkesworth' via Ansible Project
I think that is just the way windows remoting works - when you log out it 
kills any processes you have created (similar to when you log out of a 
remote desktop window, rather than just disconnect).

It is definitely possible to get your java jar program to run if you set it 
up to run as a windows service.

There is probably more than one way to do this but one way is to install 
nssm - downloadable from here: https://nssm.cc/download and then use 
win_nssm module to set up your java program to run as a service.  Depending 
on what your java jar does it may need to run as a specific user.

I hope this helps.

Jon

On Monday, August 1, 2016 at 2:02:46 PM UTC+1, fcx...@gmail.com wrote:
>
> ansible 2.2.0
> I use raw module to run a bat,and the bat exec a jar,the jar will always 
> run because it's a monitoring program。But when ansible exec the taks 
> over,the jar will also over,why?
>

-- 
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/88451597-4092-464e-acab-e27c7512d793%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Issue with Ansible

2016-08-01 Thread GBANE FETIGUE
thanks done 

On Monday, August 1, 2016 at 9:17:46 PM UTC-4, Stephen Granger wrote:
>
> Are you using the uri module mentioned previously? if the failure is an 
> ansible task error, you can use the ignore_errors statement in your task
>
> - name: get url
>   uri:
> ...snip...
>   ignore_errors: true
>
>
> On 1 August 2016 at 17:35, GBANE FETIGUE  
> wrote:
>
>> Thanks, it works but failed running I used the status code 302 but I got 
>> the response how can I skip the failure?   
>>
>>
>> On Monday, August 1, 2016 at 3:41:45 PM UTC-4, Kai Stian Olstad wrote:
>>>
>>> On 01. aug. 2016 20:47, GBANE FETIGUE wrote: 
>>> > Here is the full response 
>>> >  "deployment.stdout": "Apache 
>>> > Tomcat/8.0.26 - Error reportH1 
>>> > 
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
>>>  
>>>
>>> > H2 
>>> > 
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
>>>  
>>>
>>> > H3 
>>> > 
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
>>>  
>>>
>>> > BODY 
>>> > 
>>> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B 
>>> > 
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} 
>>> > P 
>>> > 
>>> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
>>>  
>>>
>>> > {color : black;}A.name {color : black;}.line {height: 1px; 
>>> > background-color: #525D76; border: none;} 
>>> HTTP 
>>> > Status 500 - org.codehaus.jackson.JsonParseException: Unexpected 
>>> character 
>>> > ('' (code 34)): was expecting a colon to separate field name and 
>>> > valuetype Exception 
>>> > reportmessage 
>>> org.codehaus.jackson.JsonParseException: 
>>> > Unexpected character ('' (code 34)): was expecting a colon to 
>>> > separate field name and valuedescription The 
>>> server 
>>> > encountered an internal error that prevented it from fulfilling this 
>>> > 
>>> request.exceptionjavax.servlet.ServletException: 
>>> > org.codehaus.jackson.JsonParseException: Unexpected character 
>>> ('' 
>>> > (code 34)): was expecting a colon to separate field name and value\n 
>>> at 
>>> > [Source: org.apache.catalina.connector.CoyoteInputStream@89b14a5; 
>>> line: 1, 
>>> > column: 
>>> > 
>>> 

[ansible-project] Re: ansible 2.1 setup fails with this module requires key=value arguments (['<>'])

2016-08-01 Thread Adam Grant
Hi Roman,
I believe you are seeing this:

FAILED! => {"changed": false, "failed": true, "msg": "this module requires 
key=value arguments (['<>'])"}

because those 2 servers are sourcing local out-of-date ansible.egg files 
(in their easy-install.pth)? It was the case for me.

This seems to be creating a namespace collision for Ansible 2.1 lib imports 
when the remote python interpreter is initialized to run python code 
remotely. 

-Adam

On Thursday, July 28, 2016 at 11:32:43 AM UTC-7, Roman Gaufman wrote:
>
> Hi Greg,
>
> I'm experiencing the same thing on 2 servers, rest are fine. I can ssh to 
> them and I cannot see anything obviously wrong:
>
> TASK [setup] 
> ***
>
> fatal: [0ca87760df7de0fe2d36]: FAILED! => {"changed": false, "failed": 
> true, "msg": "this module requires key=value arguments 
> (['<>'])"}
>
> fatal: [33ac8c46007794dee1a6]: FAILED! => {"changed": false, "failed": 
> true, "msg": "this module requires key=value arguments 
> (['<>'])"}
>
> to retry, use: --limit @timeboxes.retry
>
>
> I resolved the problem by moving this file out of the way:
>
>
> sudo mv /usr/local/lib/python2.7/dist-packages/easy-install.pth 
> /usr/local/lib/python2.7/dist-packages/easy-install.pth.backup
>
>
> Very strange.
>
>
>
> On Monday, June 6, 2016 at 8:13:39 PM UTC+1, Greg Fausak wrote:
>>
>>
>> In the last 24 hours I looked all over for this.
>>
>> If I install *anything* with python setup.py install I get a failure.
>>
>> The hint was the output in the setup.py process:
>>
>> Adding psycopg2 2.6 to easy-install.pth file
>>  /usr/local/lib/python2.7/dist-packages/easy-install.pth
>>
>> I realized I didn't know what that meant, so I started looking around a 
>> little.  It turns out there is a file called easy-install.pth that is read 
>> by python at a very low level.  The contents of my file after Ansible 
>> stopped working (after my setup.py):
>>
>> import sys; sys.__plen = len(sys.path)
>>
>> ./cmdb_utils-0.0.4-py2.7.egg
>>
>> ./argparse_config-0.5.1-py2.7.egg
>>
>> /usr/lib/python2.7/dist-packages
>>
>> import sys; new = sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p = 
>> getattr(sys, '__egginsert', 0); sys.path[p:p] = new; sys.__egginsert = p + 
>> len(new)
>>
>>
>> And the contents of the file before I do a setup.py:
>>
>>
>> If I edit the file and remove this line:
>>
>>
>> /usr/lib/python2.7/dist-packages
>>
>>
>> Then ansible works again.
>>
>>
>> It has something to do with the order of my apt-gets and my python 
>> setup.py installs.  II haven't been able to figure out exactly how to 
>> recreate it.
>>
>>
>> -g
>>
>>
>>
>>
>>
>>
>> On Monday, June 6, 2016 at 7:54:38 AM UTC-5, Greg Fausak wrote:
>>>
>>> I am migrating to 2.1 from 1.9.  I ran into a few issues, but it has 
>>> been fairly painless. I've run across this, and I have narrowed it down to 
>>> exactly how to recreate it.  Once I get in this state ansible is not usable 
>>> anymore.
>>>
>>> I've got a playbook, target is ubuntu 15.10, source is mac osx.  i am 
>>> using vagrant to setup a vm.  then i ssh in modifying the ansible.cfg:
>>>
>>> [default]
>>>
>>> nocows = yes
>>>
>>> retry_files_enabled = False
>>>
>>> remote_user = vagrant
>>>
>>> deprecation_warnings = False
>>>
>>> host_key_checking = False
>>>
>>> force_handlers = True
>>>
>>> #allow_world_readable_tmpfiles = True
>>>
>>> hostfile = /Users/c0faulo/git/vagrant/hosts
>>>
>>>
>>> [ssh_connection]
>>>
>>> ssh_args = -F 
>>> /Users/c0faulo/git/vagrant/machines/blank/.vagrant_ssh_config -o 
>>> ControlMaster=auto -o ControlPersist=30m
>>>
>>> scp_if_ssh = True
>>>
>>> control_path = ~/.ssh/ansible-%%r@%%h:%%p
>>>
>>>
>>> If it matters, here is my .vagrant_ssh_config file:
>>>
>>>
>>> Host default
>>>
>>>   HostName 127.0.0.1
>>>
>>>   User vagrant
>>>
>>>   Port 
>>>
>>>   UserKnownHostsFile /dev/null
>>>
>>>   StrictHostKeyChecking no
>>>
>>>   PasswordAuthentication no
>>>
>>>   IdentityFile 
>>> "/Users/c0faulo/git/vagrant/machines/blank/.vagrant/machines/default/virtualbox/private_key"
>>>
>>>   IdentitiesOnly yes
>>>
>>>   LogLevel FATAL
>>>
>>>
>>>
>>> Everything works in the playbook.  When I try to run the playbook again 
>>> I get this error.  By binary search I found the line that messes up my 
>>> ansible connection:
>>>
>>>
>>> I have several repos from my accounts that I install, then I run a 
>>> command (usually python setup.py install) in that repo.  Here is the task:
>>>
>>>
>>> - name: install repos
>>>
>>>   become: yes
>>>
>>>   become_user: "{{item.user}}"
>>>
>>>   shell: "( cd ~{{login}}/git/{{item.repo}}; {{item.install}})"
>>>
>>>   with_items:
>>>
>>> "{{ repos }}"
>>>
>>>
>>> and my repos dictionary:
>>>
>>>
>>>   vars:
>>>
>>> repos:
>>>
>>>   - repo: "gen_yaml"
>>>
>>> org: "VCP"
>>>
>>> install: "echo nothing to do"
>>>
>>> #install: "python setup.py install"
>>>
>>> user: "root"
>>>
>>> url: 

Re: [ansible-project] Re: Issue with Ansible

2016-08-01 Thread Stephen Granger
Are you using the uri module mentioned previously? if the failure is an
ansible task error, you can use the ignore_errors statement in your task

- name: get url
  uri:
...snip...
  ignore_errors: true


On 1 August 2016 at 17:35, GBANE FETIGUE  wrote:

> Thanks, it works but failed running I used the status code 302 but I got
> the response how can I skip the failure?
>
>
> On Monday, August 1, 2016 at 3:41:45 PM UTC-4, Kai Stian Olstad wrote:
>>
>> On 01. aug. 2016 20:47, GBANE FETIGUE wrote:
>> > Here is the full response
>> >  "deployment.stdout": "Apache
>> > Tomcat/8.0.26 - Error reportH1
>> >
>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
>>
>> > H2
>> >
>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
>>
>> > H3
>> >
>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
>>
>> > BODY
>> >
>> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
>> >
>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
>> > P
>> >
>> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
>>
>> > {color : black;}A.name {color : black;}.line {height: 1px;
>> > background-color: #525D76; border: none;} HTTP
>> > Status 500 - org.codehaus.jackson.JsonParseException: Unexpected
>> character
>> > ('' (code 34)): was expecting a colon to separate field name and
>> > valuetype Exception
>> > reportmessage org.codehaus.jackson.JsonParseException:
>> > Unexpected character ('' (code 34)): was expecting a colon to
>> > separate field name and valuedescription The
>> server
>> > encountered an internal error that prevented it from fulfilling this
>> >
>> request.exceptionjavax.servlet.ServletException:
>> > org.codehaus.jackson.JsonParseException: Unexpected character (''
>> > (code 34)): was expecting a colon to separate field name and value\n at
>> > [Source: org.apache.catalina.connector.CoyoteInputStream@89b14a5;
>> line: 1,
>> > column:
>> >
>> 

Re: [ansible-project] Re: Issue with Ansible

2016-08-01 Thread GBANE FETIGUE
Thanks, it works but failed running I used the status code 302 but I got 
the response how can I skip the failure?   


On Monday, August 1, 2016 at 3:41:45 PM UTC-4, Kai Stian Olstad wrote:
>
> On 01. aug. 2016 20:47, GBANE FETIGUE wrote: 
> > Here is the full response 
> >  "deployment.stdout": "Apache 
> > Tomcat/8.0.26 - Error reportH1 
> > 
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
>  
>
> > H2 
> > 
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
>  
>
> > H3 
> > 
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
>  
>
> > BODY 
> > 
> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B 
> > 
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} 
> > P 
> > 
> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
>  
>
> > {color : black;}A.name {color : black;}.line {height: 1px; 
> > background-color: #525D76; border: none;} HTTP 
> > Status 500 - org.codehaus.jackson.JsonParseException: Unexpected 
> character 
> > ('' (code 34)): was expecting a colon to separate field name and 
> > valuetype Exception 
> > reportmessage org.codehaus.jackson.JsonParseException: 
> > Unexpected character ('' (code 34)): was expecting a colon to 
> > separate field name and valuedescription The server 
> > encountered an internal error that prevented it from fulfilling this 
> > 
> request.exceptionjavax.servlet.ServletException: 
> > org.codehaus.jackson.JsonParseException: Unexpected character ('' 
> > (code 34)): was expecting a colon to separate field name and value\n at 
> > [Source: org.apache.catalina.connector.CoyoteInputStream@89b14a5; line: 
> 1, 
> > column: 
> > 
> 

[ansible-project] Re: Linode Module: StackScripts?

2016-08-01 Thread Jonathan Duncan

On Wednesday, July 27, 2016 at 12:19:28 PM UTC-6, Jonathan Duncan wrote:
>
> It appears that in the linode module there is no mechanism currently in 
> place for specifying a stackscript for the linode to use. Is this something 
> in the works? Seems like a pretty significant missing feature.
>

Decided to just fix it myself. Pull request 
here: https://github.com/ansible/ansible-modules-core/pull/4297

-- 
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/07e951cd-a540-4236-8143-13f341a09d03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Issue with Ansible

2016-08-01 Thread Alex Leonhardt
Hi,

Without trying to sound too direct (or even rude), have you read the
message returned at all or are you relying on the people here doing that
for you?

Tomcat returned:
HTTP Status 500 - org.codehaus.jackson.JsonParseException: Unexpected
character ('' (code 34)): was expecting a colon to separate field
name and valuetype Exception
reportmessage org.codehaus.jackson.JsonParseException:
Unexpected character ('' (code 34)): was expecting a colon to
separate field name and value

I'll be muting this thread now as it's not got much to do with
Ansible, but with basic troubleshooting of your own application.

Hope it helps though!


On Monday, 1 August 2016, Kai Stian Olstad 
wrote:

> On 01. aug. 2016 20:47, GBANE FETIGUE wrote:
>
>> Here is the full response
>>  "deployment.stdout": "Apache
>> Tomcat/8.0.26 - Error reportH1
>>
>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
>> H2
>>
>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
>> H3
>>
>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
>> BODY
>> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
>> B
>>
>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
>> P
>>
>> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
>> {color : black;}A.name {color : black;}.line {height: 1px;
>> background-color: #525D76; border: none;} HTTP
>> Status 500 - org.codehaus.jackson.JsonParseException: Unexpected character
>> ('' (code 34)): was expecting a colon to separate field name and
>> valuetype Exception
>> reportmessage org.codehaus.jackson.JsonParseException:
>> Unexpected character ('' (code 34)): was expecting a colon to
>> separate field name and valuedescription The server
>> encountered an internal error that prevented it from fulfilling this
>>
>> request.exceptionjavax.servlet.ServletException:
>> org.codehaus.jackson.JsonParseException: Unexpected character (''
>> (code 34)): was expecting a colon to separate field name and value\n at
>> [Source: org.apache.catalina.connector.CoyoteInputStream@89b14a5; line:
>> 1,
>> column:
>>
>> 

[ansible-project] Re: WinRM timeout for VMWare Tools Install

2016-08-01 Thread Matt Davis
Ansible 2.2 is scheduled to ship with async support for Windows (I'm 
putting the finishing touches on it now), which would be the right solution 
to this if you're unable to otherwise defer the NIC bounce. 

-Matt

On Friday, July 29, 2016 at 4:10:03 PM UTC-7, Matt Betts wrote:
>
> I've got a basic task to install VMWare tools on a Windows VM and when it 
> installs it looks to cause a temporary network disconnection whilst it 
> updates the NIC drivers. During this time WinRM looks to be timing out and 
> throwing an error. VMWare tools is successfully installing though. Is 
> anyone else using Ansible to install VMWare tools on Windows?
>
> Traceback (most recent call last):
>   File 
> "/usr/lib/python2.7/site-packages/ansible-2.2.0-py2.7.egg/ansible/plugins/connection/winrm.py",
>  
> line 270, in exec_command
> result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True)
>   File 
> "/usr/lib/python2.7/site-packages/ansible-2.2.0-py2.7.egg/ansible/plugins/connection/winrm.py",
>  
> line 215, in _winrm_exec
> response = Response(self.protocol.get_command_output(self.shell_id, 
> command_id))
>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 333, in 
> get_command_output
> self._raw_get_command_output(shell_id, command_id)
>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 352, in 
> _raw_get_command_output
> res = self.send_message(xmltodict.unparse(req))
>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 207, in 
> send_message
> return self.transport.send_message(message)
>   File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 173, in 
> send_message
> response = self.session.send(prepared_request, 
> timeout=self.read_timeout_sec)
>   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 585, 
> in send
> r = adapter.send(request, **kwargs)
>   File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 479, 
> in send
> raise ReadTimeout(e, request=request)
> ReadTimeout: HTTPSConnectionPool(host='LABSTC2WINVT675.labs.corp', 
> port=5986): Read timed out. (read timeout=30)
> fatal: [LABSTC2WINVT675.labs.corp]: UNREACHABLE! => {"changed": false, 
> "msg": "failed to exec cmd PowerShell -NoProfile -NonInteractive 
> -ExecutionPolicy Unrestricted -EncodedCommand 
> UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgBUAHIAeQAKAHsACgAmACAAJwBDADoAXABVAHMAZQByAHMAXABhAF8AdQBzAGUAcgBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADYAOQA4ADMAMwA1ADQANAAuADAAMQAtADIANgA0ADEANAA4ADEAOQAwADQAOAAzADIAOABcAHcAaQBuAF8AcABhAGMAawBhAGcAZQAuAHAAcwAxACcACgB9AAoAQwBhAHQAYwBoAAoAewAKACQAXwBvAGIAagAgAD0AIABAAHsAIABmAGEAaQBsAGUAZAAgAD0AIAAkAHQAcgB1AGUAIAB9AAoASQBmACAAKAAkAF8ALgBFAHgAYwBlAHAAdABpAG8AbgAuAEcAZQB0AFQAeQBwAGUAKQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAbQBzAGcAJwAsACAAJABfAC4ARQB4AGMAZQBwAHQAaQBvAG4ALgBNAGUAcwBzAGEAZwBlACkACgB9AAoARQBsAHMAZQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAbQBzAGcAJwAsACAAJABfAC4AVABvAFMAdAByAGkAbgBnACgAKQApAAoAfQAKAEkAZgAgACgAJABfAC4ASQBuAHYAbwBjAGEAdABpAG8AbgBJAG4AZgBvAC4AUABvAHMAaQB0AGkAbwBuAE0AZQBzAHMAYQBnAGUAKQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAZQB4AGMAZQBwAHQAaQBvAG4AJwAsACAAJABfAC4ASQBuAHYAbwBjAGEAdABpAG8AbgBJAG4AZgBvAC4AUABvAHMAaQB0AGkAbwBuAE0AZQBzAHMAYQBnAGUAKQAKAH0ACgBFAGwAcwBlAEkAZgAgACgAJABfAC4AUwBjAHIAaQBwAHQAUwB0AGEAYwBrAFQAcgBhAGMAZQApAAoAewAKACQAXwBvAGIAagAuAEEAZABkACgAJwBlAHgAYwBlAHAAdABpAG8AbgAnACwAIAAkAF8ALgBTAGMAcgBpAHAAdABTAHQAYQBjAGsAVAByAGEAYwBlACkACgB9AAoAVAByAHkACgB7AAoAJABfAG8AYgBqAC4AQQBkAGQAKAAnAGUAcgByAG8AcgBfAHIAZQBjAG8AcgBkACcALAAgACgAJABfACAAfAAgAEMAbwBuAHYAZQByAHQAVABvAC0ASgBzAG8AbgAgAHwAIABDAG8AbgB2AGUAcgB0AEYAcgBvAG0ALQBKAHMAbwBuACkAKQAKAH0ACgBDAGEAdABjAGgACgB7AAoAfQAKAEUAYwBoAG8AIAAkAF8AbwBiAGoAIAB8ACAAQwBvAG4AdgBlAHIAdABUAG8ALQBKAHMAbwBuACAALQBDAG8AbQBwAHIAZQBzAHMAIAAtAEQAZQBwAHQAaAAgADkAOQAKAEUAeABpAHQAIAAxAAoAfQAKAEYAaQBuAGEAbABsAHkAIAB7ACAAUgBlAG0AbwB2AGUALQBJAHQAZQBtACAAIgBDADoAXABVAHMAZQByAHMAXABhAF8AdQBzAGUAcgBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADYAOQA4ADMAMwA1ADQANAAuADAAMQAtADIANgA0ADEANAA4ADEAOQAwADQAOAAzADIAOAAiACAALQBGAG8AcgBjAGUAIAAtAFIAZQBjAHUAcgBzAGUAIAAtAEUAcgByAG8AcgBBAGMAdABpAG8AbgAgAFMAaQBsAGUAbgB0AGwAeQBDAG8AbgB0AGkAbgB1AGUAIAB9AA==",
>  
> "unreachable": 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/0cfa4574-ac92-4f64-b89c-c996aa9e03df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows playbooks causes cryptographic, windows remote management services to crash

2016-08-01 Thread Matt Davis
I've heard one other report of this happening a few weeks ago (but was via 
Ansible support and I didn't know who the customer was- maybe it was also 
you?)

The services in question share the winrm host process, so not surprising 
that they're the ones going down. 

pywinrm 0.2.0 could definitely help some with this, as the HTTP(S) 
connections are reused for the various winrm calls within a task, where 
0.1.1 and lower get a new connection for every winrm operation.

Let us know if it keeps up- it'd definitely be a Microsoft issue (winrm 
service shouldn't crash. Ever.), but we might be able to short-circuit the 
official support loop and get you in touch with the right folks directly.

-Matt

On Thursday, July 28, 2016 at 7:17:03 AM UTC-7, Michael Perzel wrote:
>
> Since upgrading to ansible 2.0 my windows playbooks have been failing with 
> the following error. This error has been seen when running setup, 
> win_template, script tasks. The easiest way to repeat it is to have 
> multiple simultaneous runs of ansible affecting the same host. If we re-run 
> the exact same playbook after a failure they almost always succeed.
>
> Traceback (most recent call last):
>   File 
> "/usr/lib/python2.6/site-packages/ansible/plugins/connection/winrm.py", 
> line 240, in exec_command
> result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True)
>   File 
> "/usr/lib/python2.6/site-packages/ansible/plugins/connection/winrm.py", 
> line 208, in _winrm_exec
> self.protocol.cleanup_command(self.shell_id, command_id)
>   File 
> "/usr/lib/python2.6/site-packages/awx/lib/site-packages/winrm/protocol.py", 
> line 290, in cleanup_command
> rs = self.send_message(xmltodict.unparse(rq))
>   File 
> "/usr/lib/python2.6/site-packages/awx/lib/site-packages/winrm/protocol.py", 
> line 193, in send_message
> return self.transport.send_message(message)
>   File 
> "/usr/lib/python2.6/site-packages/awx/lib/site-packages/winrm/transport.py", 
> line 136, in send_message
> raise WinRMTransportError('http', error_message)
> WinRMTransportError: 500 WinRMTransport. Bad HTTP response returned from 
> server.  Code 500
> fatal: [hostname]: FAILED! => {"failed": true, "msg": "failed to exec cmd 
> PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted 
> -EncodedCommand reallylongencodedcommand=="}
>
> If we capture the tcp traffic on the windows side we see the SYN packets 
> arriving so we know the issue isn't at the network level. The packets are 
> reaching the windows box.  If we run a netstat while the playbook is 
> running we notice there are a bunch of connections then all of a sudden 
> there are none for a bit and then we are back listening. Using the windows 
> event log if you compare the timeline of when netstat shows no listeners 
> and cryptographic services, dns client services, workstation service, 
> network location service, windows remote management crash they match up 
> perfectly. After the services crash, windows restarts them automatically 
> and the ansible playbooks start working again.  We've been having this 
> issue on windows server 2012 boxes with 8gb ram and 4 cpus. We've been able 
> to reproduce it with a completely vanilla server 2012 box (no antivirus or 
> other 3rd party software installed on it). I'm at a complete loss on how to 
> fix this.
>
> Has anyone else seen this behavior? I haven't found anything similar in 
> the issue tracker or in google searches.
>
>
>

-- 
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/98967d6d-4a01-4466-a9a7-29a4293ebb02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to create a dynamic group using group_by and register a custom variable name

2016-08-01 Thread GANA SAGAR

0down votefavorite 


How to create variable group based on ip address-range in ansible inventory 
groups ? I have two groups of servers in different location. I want to 
create the two groups based on their IP range (two ranges for two 
locations) . I already  have groups based on distribution, prod, dev, test, 
qa ,dr in my host inventory. I know I can create a thr grouping using 
group_by. But How do I call them ? and How to assign a custom variable name 
to them ? 

- hosts: all
  tasks:
- group_by: key=network_{{ ansible_default_ipv4.network }}

But how do I call them ? and How to assign a custom 
variable name to them ? Is there a way that I 
could create a group once and store all the hosts in a 
 static inventory file. ?

-- 
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/ab981f6a-72c2-4df2-a514-79664f97572e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: with_dict expects a dict - when evaluating a variable in ansible 2.0+

2016-08-01 Thread 'Florian B' via Ansible Project
The solution is to address the variable like this (vars['variableName']):

- name: Loop
  command: echo {{ item.key }}
  with_dict: "{{ vars[input|lower|regex_replace(' ','')] }}"



Am Dienstag, 31. Mai 2016 14:12:52 UTC+2 schrieb Florian B:
>
> Hi everyone,
>
> I'm trying to get this example to work with ansible 2.0+. It does work 
> correctly with 1.9.
>
> - hosts: localhost
>   vars:
>
>
> input: "top"
>
>
> base: 
>   ? a
>   ? b
>
>
> top: 
>   << : *base
>   ? c
>   ? d
>
> peak: 
>   << : *top
>   ? e
>   ? f
>
>   tasks:
> - debug: var="{{ input|lower|regex_replace(' ','') }}"
>
>
> - name: Loop
>   command: echo {{ item.key }}
>   with_dict: "{{ input|lower|regex_replace(' ','') }}"
>
> In short, I want to merge the dicts base, top and peak and then loop over 
> all key/value pairs in the corresponding dictionary, depending on the input 
> another function produces (strings).
>
> With ansible 2.0 I get the following error:
>  % ansible --version
> ansible 2.0.0.2 (stable-2.0.0.1 7de237c5a1) last updated 2016/03/15 
> 11:07:49 (GMT +200)
>   lib/ansible/modules/core: (detached HEAD ce6619bf5d) last updated 
> 2016/03/15 11:07:51 (GMT +200)
>   lib/ansible/modules/extras: (detached HEAD 29af26884e) last updated 
> 2016/03/15 11:07:51 (GMT +200)
>   config file = /home/fbuchmeier/.ansible.cfg
>   configured module search path = Default w/o overrides 
>
>  % ansible-playbook -c local with_dict.yml
>  [WARNING]: provided hosts list is empty, only localhost is available
>
>
>
>
> PLAY 
> ***
>
>
> TASK [setup] 
> ***
> ok: [localhost]
>
>
> TASK [debug] 
> ***
> ok: [localhost] => {
> "top": {
> "a": null, 
> "b": null, 
> "c": null, 
> "d": null
> }
> }
>
>
> TASK [Loop] 
> 
> fatal: [localhost]: FAILED! => {"failed": true, "msg": "ERROR! with_dict 
> expects a dict"}
>
>
> PLAY RECAP 
> *
> localhost  : ok=2changed=0unreachable=0failed=
> 1
>
> In ansible 1.9 I get my desired result:
>  % ansible --version
> ansible 1.9.6 (detached HEAD 10a38a7652) last updated 2016/04/29 15:14:07 
> (GMT +200)
>   lib/ansible/modules/core: (detached HEAD 6972d0a291) last updated 
> 2016/04/29 15:14:13 (GMT +200)
>   lib/ansible/modules/extras: (detached HEAD 2c073442b0) last updated 
> 2016/04/29 15:14:13 (GMT +200)
>   configured module search path = None
>  
> % ansible-playbook -i environments/localhost  -c local with_dict.yml
>
>
> PLAY [localhost] 
> ** 
>
>
> GATHERING FACTS 
> *** 
> ok: [localhost]
>
>
> TASK: [debug var="{{ input|lower|regex_replace(' ','') }}"] 
> *** 
> ok: [localhost] => {
> "var": {
> "top": {
> "a": null,
> "b": null,
> "c": null,
> "d": null
> }
> }
> }
>
>
> TASK: [Loop] 
> ** 
> changed: [localhost] => (item={'key': 'a', 'value': None})
> changed: [localhost] => (item={'key': 'c', 'value': None})
> changed: [localhost] => (item={'key': 'b', 'value': None})
> changed: [localhost] => (item={'key': 'd', 'value': None})
>
>
> PLAY RECAP 
>  
> localhost  : ok=3changed=1unreachable=0failed=
> 0
>
> Do you have any idea how I can get this to work?
>
> Thank you very much,
>
> Florian.
>

-- 
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/d60725d2-5edc-4949-9c27-224e6f51d7c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Issue with Ansible

2016-08-01 Thread Kai Stian Olstad

On 01. aug. 2016 20:47, GBANE FETIGUE wrote:

Here is the full response
 "deployment.stdout": "Apache
Tomcat/8.0.26 - Error reportH1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
{color : black;}A.name {color : black;}.line {height: 1px;
background-color: #525D76; border: none;} HTTP
Status 500 - org.codehaus.jackson.JsonParseException: Unexpected character
('' (code 34)): was expecting a colon to separate field name and
valuetype Exception
reportmessage org.codehaus.jackson.JsonParseException:
Unexpected character ('' (code 34)): was expecting a colon to
separate field name and valuedescription The server
encountered an internal error that prevented it from fulfilling this
request.exceptionjavax.servlet.ServletException:
org.codehaus.jackson.JsonParseException: Unexpected character (''
(code 34)): was expecting a colon to separate field name and value\n at
[Source: org.apache.catalina.connector.CoyoteInputStream@89b14a5; line: 1,
column:

Re: [ansible-project] Re: Issue with Ansible

2016-08-01 Thread GBANE FETIGUE

Here is the full response 
 "deployment.stdout": "Apache 
Tomcat/8.0.26 - Error reportH1 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
 
H2 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
 
H3 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
 
BODY 
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} 
P 
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
 
{color : black;}A.name {color : black;}.line {height: 1px; 
background-color: #525D76; border: none;} HTTP 
Status 500 - org.codehaus.jackson.JsonParseException: Unexpected character 
('' (code 34)): was expecting a colon to separate field name and 
valuetype Exception 
reportmessage org.codehaus.jackson.JsonParseException: 
Unexpected character ('' (code 34)): was expecting a colon to 
separate field name and valuedescription The server 
encountered an internal error that prevented it from fulfilling this 
request.exceptionjavax.servlet.ServletException: 
org.codehaus.jackson.JsonParseException: Unexpected character ('' 
(code 34)): was expecting a colon to separate field name and value\n at 
[Source: org.apache.catalina.connector.CoyoteInputStream@89b14a5; line: 1, 
column: 

[ansible-project] How to define a base_dir var so you can use {{ base_dir }}/playbooks etc?

2016-08-01 Thread Patrick Laimbock

Hi,

Ansible 2.1.1.0.

Situation: Tim and Bob both deploy servers. Tim checks out the central 
ansible git repo to /home/tim/ansible while Bob checks it out to 
/home/bob/ansible. No special ansible.cfg is used by either.


Problem: paths differ (/home/tim/ansible vs /home/bob/ansible) so you 
can not use static paths in the playbooks etc.


Question: how do you solve that? How do you specify something like a 
base_dir variable which is read early on so that all static paths can be 
replaced.




$ grep base_dir /home/tim/ansible/inventory/group_vars/all
base_dir: "{{ lookup('pipe', 'git rev-parse --show-toplevel') }}"

In Tim's case base_dir should be "/home/tim/ansible".

$ cat /home/tim/ansible/vars/global_vars.yml

roles: "{{ base_dir}}/roles"
handlersdir: "{{ base_dir }}/handlers"
tasksdir: "{{ base_dir }}/tasks"
playbooksdir: "{{ base_dir }}/playbooks"
includedir: "{{ base_dir }}/playbooks/include"
manualdir: "{{ base_dir }}/playbooks/manual"
varsdir: "{{ base_dir }}/vars"


$ cat /home/tim/ansible/playbooks/groups/dns

- name: setup dns servers
  hosts: dns
  user: root
  gather_facts: True

  vars_files:
- "{{ base_dir }}/vars/global_vars.yml


  roles:
- base
- dns



TIA,
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/a0237410-67f9-a3ee-12ef-9577d7cb286e%40laimbock.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows playbooks causes cryptographic, windows remote management services to crash

2016-08-01 Thread 'J Hawkesworth' via Ansible Project
I have run the ansible integration tests against a Server 2016 Tech Preview 
5 build, which runs Powershell 5 and WMF 5.0.  

The only issue I have encountered so far is with uninstalling windows 
features - it seems there's a new version of the cmdlet that unininstalls 
features and seems to fail without an interactive user (not tested 
thoroughly yet so could be wrong about interactive user).

Jon

On Monday, August 1, 2016 at 4:30:04 PM UTC+1, Michael Perzel wrote:
>
> Thanks I'll give 0.2.0 a try.
>
> We are running S2012R2 and powershell version 4.
>
> PS C:\Windows\system32> $PSVersionTable.PSVersion
>
> Major  Minor  Build  Revision
> -  -  -  
> 4  0  -1 -1
>
> We are looking at powershell 5 for other reasons. Have you tried it out 
> with ansible?
>
> Michael
>
> On Monday, August 1, 2016 at 7:15:02 AM UTC-5, J Hawkesworth wrote:
>>
>> Might be worth trying pywinrm 0.2.0 - even if its just because its much 
>> quicker than 0.1.1
>>
>> However I don't think that by itself it will fix your problem though.
>>
>> Looking again the machines I'm running are actually S2012 R2 not S2012 
>> and are mostly 2cpu 4Gb virtual machines.
>>
>> If yours are S2012 not S2012R2 its worth checking the powershell and WMF 
>> version.  WMF 3.0 had a bug in it that meant it would fail to run almost 
>> anything but the most trivial winrm command - if so upgrading to WMF4.0 / 
>> powershell 4.0 is thoroughly recommended.
>>
>> Jon
>>
>>
>> On Friday, July 29, 2016 at 8:06:28 PM UTC+1, Michael Perzel wrote:
>>>
>>> No I haven't upgrade pywinrm. Running 0.1.1.
>>>
>>> > pip show pywinrm
>>> DEPRECATION: Python 2.6 is no longer supported by the Python core team, 
>>> please upgrade your Python. A future version of pip will drop support for 
>>> Python 2.6
>>> ---
>>> Metadata-Version: 1.0
>>> Name: pywinrm
>>> Version: 0.1.1
>>> Summary: Python library for Windows Remote Management
>>> Home-page: http://github.com/diyan/pywinrm/
>>> Author: Alexey Diyan
>>> Author-email: alexey...@gmail.com
>>> License: MIT license
>>> Location: /usr/lib/python2.6/site-packages
>>> Requires: xmltodict, isodate
>>> Classifiers:
>>>   Development Status :: 4 - Beta
>>>   Environment :: Console
>>>   Intended Audience :: Developers
>>>   Intended Audience :: System Administrators
>>>   Natural Language :: English
>>>   License :: OSI Approved :: MIT License
>>>   Programming Language :: Python
>>>   Programming Language :: Python :: 2
>>>   Programming Language :: Python :: 2.6
>>>   Programming Language :: Python :: 2.7
>>>   Programming Language :: Python :: 3
>>>   Programming Language :: Python :: 3.2
>>>   Programming Language :: Python :: 3.3
>>>   Programming Language :: Python :: Implementation :: PyPy
>>>   Topic :: Software Development :: Libraries :: Python Modules
>>>   Topic :: System :: Clustering
>>>   Topic :: System :: Distributed Computing
>>>   Topic :: System :: Systems Administration
>>> /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318:
>>>  
>>> SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject 
>>> Name Indication) extension to TLS is not available on this platform. This 
>>> may cause the server to present an incorrect TLS certificate, which can 
>>> cause validation failures. You can upgrade to a newer version of Python to 
>>> solve this. For more information, see 
>>> https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning
>>> .
>>>   SNIMissingWarning
>>> /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122:
>>>  
>>> InsecurePlatformWarning: A true SSLContext object is not available. This 
>>> prevents urllib3 from configuring SSL appropriately and may cause certain 
>>> SSL connections to fail. You can upgrade to a newer version of Python to 
>>> solve this. For more information, see 
>>> https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
>>> .
>>>   InsecurePlatformWarning
>>>
>>>
>>> On Friday, July 29, 2016 at 11:27:08 AM UTC-5, J Hawkesworth wrote:

 Not seen this myself and having been running 2.0.0.2 against our herd 
 of windows server 2012 boxes for months.

 Did you upgrade pywinrm to 0.2.0 by any chance?

 Also I spotted this bug report which sounds simliar to your case -  
 https://github.com/ansible/ansible/issues/16873 - although the stack 
 trace is not failing at the same point so could be something different.

 Jon

 On Thursday, July 28, 2016 at 3:19:45 PM UTC+1, Michael Perzel wrote:
>
> Forgot to mention we've also experimented with increasing the winrm 
> maxconcurrentusers, maxprocessespershell, maxshellsperuser settings but 
> haven’t seen any difference in behavior.
>
> >winrm get winrm/config/winrs
>
> Winrs
>
> AllowRemoteShellAccess = true
>
> IdleTimeout = 720
>
> MaxConcurrentUsers = 30

Re: [ansible-project] Module for describing availability zones?

2016-08-01 Thread Allen Sanabria
You can write a module or a simple filter that will give you the
availability zones in a region.
https://github.com/linuxdynasty/ld-ansible-filters/blob/master/filter_plugins/aws.py#L202
So you can do something like this
*zones: "{{ aws_region | zones() }}"*


​

On Mon, Aug 1, 2016 at 8:52 AM,  wrote:

> I'm not sure if I'm overlooking this or not, but is there a module from
> Ansible that will describe the availability zones in my AWS region?
>
> I typically use us-east-1 as my default region, which has 5 available
> availability zones (A,B, C, D, E), out of which I can only use 4.  I never
> know which ones are available to me when I stand up my VPC and create my
> subnets.
>
> So my desire is to simply describe availability zones with an ansible
> module, and NOT pass the aws cli ec2 describe-availability-zones through
> with a `command` in my role.
>
> Thank you.
>
> --
> 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/03da1b58-e9bd-40ea-959f-1c58bc5d635a%40googlegroups.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/CAH2deCa2fhFYSeRK55DvJ2gy3WJDNAMHj0k3ODPTFYvCa4dPpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Module for describing availability zones?

2016-08-01 Thread tom . moretto
I'm not sure if I'm overlooking this or not, but is there a module from 
Ansible that will describe the availability zones in my AWS region?

I typically use us-east-1 as my default region, which has 5 available 
availability zones (A,B, C, D, E), out of which I can only use 4.  I never 
know which ones are available to me when I stand up my VPC and create my 
subnets.

So my desire is to simply describe availability zones with an ansible 
module, and NOT pass the aws cli ec2 describe-availability-zones through 
with a `command` in my role.

Thank you.

-- 
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/03da1b58-e9bd-40ea-959f-1c58bc5d635a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows playbooks causes cryptographic, windows remote management services to crash

2016-08-01 Thread Michael Perzel
Thanks I'll give 0.2.0 a try.

We are running S2012R2 and powershell version 4.

PS C:\Windows\system32> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-  -  -  
4  0  -1 -1

We are looking at powershell 5 for other reasons. Have you tried it out 
with ansible?

Michael

On Monday, August 1, 2016 at 7:15:02 AM UTC-5, J Hawkesworth wrote:
>
> Might be worth trying pywinrm 0.2.0 - even if its just because its much 
> quicker than 0.1.1
>
> However I don't think that by itself it will fix your problem though.
>
> Looking again the machines I'm running are actually S2012 R2 not S2012 and 
> are mostly 2cpu 4Gb virtual machines.
>
> If yours are S2012 not S2012R2 its worth checking the powershell and WMF 
> version.  WMF 3.0 had a bug in it that meant it would fail to run almost 
> anything but the most trivial winrm command - if so upgrading to WMF4.0 / 
> powershell 4.0 is thoroughly recommended.
>
> Jon
>
>
> On Friday, July 29, 2016 at 8:06:28 PM UTC+1, Michael Perzel wrote:
>>
>> No I haven't upgrade pywinrm. Running 0.1.1.
>>
>> > pip show pywinrm
>> DEPRECATION: Python 2.6 is no longer supported by the Python core team, 
>> please upgrade your Python. A future version of pip will drop support for 
>> Python 2.6
>> ---
>> Metadata-Version: 1.0
>> Name: pywinrm
>> Version: 0.1.1
>> Summary: Python library for Windows Remote Management
>> Home-page: http://github.com/diyan/pywinrm/
>> Author: Alexey Diyan
>> Author-email: alexey...@gmail.com
>> License: MIT license
>> Location: /usr/lib/python2.6/site-packages
>> Requires: xmltodict, isodate
>> Classifiers:
>>   Development Status :: 4 - Beta
>>   Environment :: Console
>>   Intended Audience :: Developers
>>   Intended Audience :: System Administrators
>>   Natural Language :: English
>>   License :: OSI Approved :: MIT License
>>   Programming Language :: Python
>>   Programming Language :: Python :: 2
>>   Programming Language :: Python :: 2.6
>>   Programming Language :: Python :: 2.7
>>   Programming Language :: Python :: 3
>>   Programming Language :: Python :: 3.2
>>   Programming Language :: Python :: 3.3
>>   Programming Language :: Python :: Implementation :: PyPy
>>   Topic :: Software Development :: Libraries :: Python Modules
>>   Topic :: System :: Clustering
>>   Topic :: System :: Distributed Computing
>>   Topic :: System :: Systems Administration
>> /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318:
>>  
>> SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject 
>> Name Indication) extension to TLS is not available on this platform. This 
>> may cause the server to present an incorrect TLS certificate, which can 
>> cause validation failures. You can upgrade to a newer version of Python to 
>> solve this. For more information, see 
>> https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning
>> .
>>   SNIMissingWarning
>> /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122:
>>  
>> InsecurePlatformWarning: A true SSLContext object is not available. This 
>> prevents urllib3 from configuring SSL appropriately and may cause certain 
>> SSL connections to fail. You can upgrade to a newer version of Python to 
>> solve this. For more information, see 
>> https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
>> .
>>   InsecurePlatformWarning
>>
>>
>> On Friday, July 29, 2016 at 11:27:08 AM UTC-5, J Hawkesworth wrote:
>>>
>>> Not seen this myself and having been running 2.0.0.2 against our herd of 
>>> windows server 2012 boxes for months.
>>>
>>> Did you upgrade pywinrm to 0.2.0 by any chance?
>>>
>>> Also I spotted this bug report which sounds simliar to your case -  
>>> https://github.com/ansible/ansible/issues/16873 - although the stack 
>>> trace is not failing at the same point so could be something different.
>>>
>>> Jon
>>>
>>> On Thursday, July 28, 2016 at 3:19:45 PM UTC+1, Michael Perzel wrote:

 Forgot to mention we've also experimented with increasing the winrm 
 maxconcurrentusers, maxprocessespershell, maxshellsperuser settings but 
 haven’t seen any difference in behavior.

 >winrm get winrm/config/winrs

 Winrs

 AllowRemoteShellAccess = true

 IdleTimeout = 720

 MaxConcurrentUsers = 30

 MaxShellRunTime = 2147483647

 MaxProcessesPerShell = 25

 MaxMemoryPerShellMB = 1024

 MaxShellsPerUser = 30

 On Thursday, July 28, 2016 at 9:17:03 AM UTC-5, Michael Perzel wrote:
>
> Since upgrading to ansible 2.0 my windows playbooks have been failing 
> with the following error. This error has been seen when running setup, 
> win_template, script tasks. The easiest way to repeat it is to have 
> multiple simultaneous runs of ansible affecting the same host. If we 
> re-run 
> the exact same playbook after a 

[ansible-project] Openstack Dynamic Inventory Script

2016-08-01 Thread Govindaraj Venkatesan
Hi All,

I tried setting multiple group names using nova meta tag as below but 
couldn't get that working using openstack.py dynamic inventory script for 
openstack. Can you please suggest?

http://docs.ansible.com/ansible/intro_dynamic_inventory.html#example-openstack-external-inventory-script

$nova meta hostname set "group=mesos_masters"

$ansible -i inventory/openstack.py mesos_masters -m ping
b9d2e61e | SUCCESS => {
"changed": false,
"ping": "pong"
}

$nova meta hostname set "group=mesos_masters,consul_bootstrap"

$ansible -i inventory/openstack.py mesos_masters -m ping
 [WARNING]: provided hosts list is empty, only localhost is available

# STEPS TO REPRODUCE




# EXPECTED RESULTS
Should be able to run the playbook fetching the list of hosts

# ACTUAL RESULTS: provided hosts list is empty, only localhost is available

Please suggest. Thanks.

Thanks,

Govind

-- 
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/b079ff71-d794-458e-9bb0-1989f9346c2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible executes task regardless of conditional

2016-08-01 Thread Trond Hindenes
As far as I can see, weird things start happening when using a variable as 
a target for hosts.
If I do:   hosts: just_created things look good, but if I capture that 
value in a variable instead, things fall to pieces:

hosts: "{{ my_group }}"

-- 
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/eb396350-dc78-41c6-a712-bee9b3bb83c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Docker privileged containers

2016-08-01 Thread Alvaro Gil
Same here with `docker_container`, completely ignores `privileged: true`.

On Monday, September 8, 2014 at 6:38:52 PM UTC-3, Michael DeHaan wrote:
>
> Can you share the output of ansible --version ?
>
>
>
> On Mon, Sep 8, 2014 at 4:07 AM, Abed Halawi  > wrote:
>
>> I am using a playbook task to run a docker containers, it's running 
>> correctly except that it is not running with the `--privileged` option 
>> although I am choosing `privileged=yes`:
>>
>> - name: Launch Datadog monitoring agent
>>>   docker:
>>>   image: datadog/docker-dd-agent
>>>   privileged: yes
>>>   name: dd-agent
>>>   hostname: "{{datadog.hostname}}"
>>>   volumes:
>>>   - /var/run/docker.sock:/var/run/docker.sock
>>>   - /proc/mounts:/host/proc/mounts:ro
>>>   - /cgroup:/host/sys/fs/cgroup:ro
>>>   env: "API_KEY={{datadog.key}}"
>>>   tags: monitoring
>>
>>
>>
>> -- 
>> 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/97745d71-73cf-4d8e-907d-fb384f265268%40googlegroups.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/f2c149f2-02e1-4286-8a3d-01341f4ed693%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible executes task regardless of conditional

2016-08-01 Thread Trond Hindenes
I'm just getting more confused by this. I updated my Ansible version to run 
from devel, this gave me some more info which I totally cannot make sense 
of:
Here's the output running from devel:

TASK [deploy_azurevm : Add vm to inventory (Linux)] *
ERROR! the field 'hosts' has an invalid value, which appears to include a 
variable that is undefined. The error was: 'resource_group_name' is 
undefined

The error appears to have been in 
'/opt/ansible/playbooks/config.azure/resourcegroupdeployments/TrondTest/site.yml':
 
line 9, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Configure VM
  ^ here

The weird thing here, is that the error references the _next_ play in my 
playbook (that is, after the role has executed). Here's the whole playbook:
---
-   name: Deploy Test VM
hosts: localhost
tags:
- deploy
roles:
- { role: deploy_azurevm, vm_name: "{{ resource_group_prefix 
}}-trondtest", add_to_adhoc_group: "{{ resource_group_name }}" }

- name: Configure VM
  hosts: "{{ resource_group_name }}"
  roles:
- rikstv_basicconfig_azurevm

I don't know what's wrong, whether it's the logging or the execution but I 
cannot make any sense of 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/9cac3a2d-3cc9-4501-b7e7-ce7f189f1340%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible executes task regardless of conditional

2016-08-01 Thread Trond Hindenes
Hi all, 
I have this weird thing inside a role, hopefully someone can straighten me 
out:

My role is a custom made one, which performs Azure vm deployments, 
supporting both Linux and Windows. The last steps of the role are as 
follows:

- name: debug
  debug:
msg: "os_type: {{ os_type }} add_to_inventory: {{ add_to_inventory }}"

- name: Add vm to inventory (Windows)
  when: os_type == "Windows"
  add_host: 
ansible_host: "{{ vm_mgmt_ip }}"
name: "{{ vm_name }}"
groups: "{{ add_to_adhoc_group }}"
ansible_user: "{{ admin_username }}"
ansible_password: "{{ admin_password }}"
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore

- name: Add vm to inventory (Linux)
  when: os_type == "Linux" and add_to_adhoc_group is defined
  add_host: 
ansible_host: "{{ vm_mgmt_ip }}"
name: "{{ vm_name }}"
groups: "{{ add_to_adhoc_group }}"
ansible_user: "{{ admin_username }}"
ansible_ssh_pass: "{{ admin_password }}"
ansible_become: yes

My problem is that regardless of the OS, Ansible will execute the "linux" 
task, here is the output from a run deploying a Windows VM:
TASK [deploy_azurevm : debug] ***
ok: [localhost] => {
"msg": "os_type: Windows add_to_inventory: internal_ip"
}

TASK [deploy_azurevm : Add vm to inventory (Windows)] ***
changed: [localhost]

TASK [deploy_azurevm : Add vm to inventory (Linux)] *
ERROR! 'resource_group_name' is undefined

This used to work, but as I'm constantly updating both the role and the 
Ansible version I'm unable to track down exactly what changed. Has anyone 
seen something similar? 
Also, the fact that "resource_group_name" is undefined also seems strange 
to me, the role task shouldn't care about that variable at all. The only 
reference to it is how I pass in vars to the role:

---
-   name: Deploy Test VM
hosts: localhost
tags:
- deploy
roles:
- { role: deploy_azurevm, vm_name: "{{ resource_group_prefix 
}}-trondtest", add_to_adhoc_group: "{{ resource_group_name }}" }

Since it works on the Windows "version" of "Add vm to inventory" everything 
should be fine, no?

I'm baffled. Any pointers appreciated!

_Trond

-- 
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/738cf636-65cb-4a3d-924d-5797988cf30c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Using variable substitution with replace module and regex

2016-08-01 Thread Biswajit
Hi,

I have two register variable in a play and want to replace one with another 
in a play. 
___

 - name: Editing  the file 

  replace:

  dest=/some/path

  regexp=^"{{ result.stdout }}."

  replace="{{ result2.stdout }}."

  backup=yes




I want to replace occurrences of {{result.stdout }} with {{result2.stdout}} 
in a file. How can 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/d61ad0a6-2b00-4e13-bdc9-5864ab5d82ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: working on playbook to check file exists

2016-08-01 Thread Bill Carlson

Assuming that is your full playbook file, it needs more than tasks.

Sample of a working file, read up for explanation of each portion:

---
- hosts: system1,system2
  tasks:
- name: task1
  stat: path=something
  register: stat_something

There is also a method in a playbook that breaks tasks and other items into 
separate files in a directory structure, see the docs as mentioned.

-- 
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/f970447a-c709-440b-9a48-732d0da28633%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: How do I use multiple ansible versions on the same machine for different playbooks that require specific versions?

2016-08-01 Thread Mike Biancaniello
I would also suggest python virtual environments. 

Although, I have also used Docker images for running Ansible. I create a 
Docker image with 'ansible' as the ENTRYPOINT, then create a shell script 
to execute 'docker run -it --rm   []'. This will execute ansible inside the docker and use the 
playbooks that you put inside the image when you created 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/ff2d5f86-7bd8-4773-91b8-e94e711d1220%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Why a progress over when ansible exec all tasks on windows?

2016-08-01 Thread fcxjluo
ansible 2.2.0
I use raw module to run a bat,and the bat exec a jar,the jar will always 
run because it's a monitoring program。But when ansible exec the taks 
over,the jar will also over,why?

-- 
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/a5a62408-17a7-46f5-b141-360a022c2afc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Why the process over after completing tasks in windows?

2016-08-01 Thread fcxjluo
I use raw module 
'Start-Process -FilePath my.bat'

my.bat exec a process collect logs.But when the tasks over,the process will 
be also end.I believe the process can run no problem.

-- 
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/d9e2b20e-c55a-44c2-99a0-9079fe2d85ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible alternative to jq select

2016-08-01 Thread kenjis15
Hi,

I have command like this which picks up an element from a list of AWS 
hosted zones if hosted zone named "testinternal" is found in the list. If 
it finds it, extracts Id filed from that element.

aws route53 list-hosted-zones | jq '.HostedZones[] | select(.Name == 
"testinternal.")' | jq -r ".Id"


Is there an alternative to this in Ansible ? 


If any, then I would like to use it in conjunction with route53_facts module so 
that I do not need to rely on jq command.

-- 
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/188178c7-d240-41b8-8c93-f48915072c85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible windows raw module no response?

2016-08-01 Thread fcxjluo
 Thanks for your answer.I am not sure whether my program is well.But I 
think ansible should close the task if the task exec too long.

在 2016年7月28日星期四 UTC+8上午7:34:49,J Hawkesworth写道:
>
> If it is always running then may be you need to set up whatever the 
> run.bat does as a windows service.  
> You can install nssm.exe and use win_nssm module to install programs as 
> services, and then use the win_service module to start and stop them.
>
> You can use fetch module against windows machines if you just want to 
> fetch log files when you run your playbook too.
>
> There are lots of programs around that can collect log files and forward 
> them to another machine for processing. Two that I have heard of, but not 
> used are NXLOG and Elastic Filebeat.
>
> Hope this helps,
>
> Jon
>
>
>
> On Wednesday, July 27, 2016 at 5:28:56 PM UTC+1, fcx...@gmail.com wrote:
>>
>> I just want to run my bat by raw module,like 
>> - name: exec run.bat
>>  raw: C:\run.bat
>>
>> The bat is about a program that get logs,so it will be always 
>> running,like Daemon. When I exec ansible-playbook,the task can't go on.How 
>> can I do?
>>
>

-- 
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/45139a14-67ba-4636-bed6-3ba4ecee18c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Scalable Spark Clusters (RE: Matt, Do you want your weekends back?)

2016-08-01 Thread 'J Hawkesworth' via Ansible Project
Looks like there are several roles for installing Spark on Ansible Galaxy - 
probably a good starting point to see what others have done:

https://galaxy.ansible.com/list#/roles?page=1_size=10=spark



On Sunday, July 31, 2016 at 7:14:47 PM UTC+1, Matt Jude wrote:
>
> Good day,
>
>  
>
> I wonder if you can possibly be able to assist me I am looking for a way 
> to automate the newest versions of Apache Spark  in Ansible Tower 3 - the 
> objective is to eventually replace cloudera to handle the devil ops.
>
>  
>
>
> 
>
>  
>
> The above refers, I am currently on a project / educational path of 
> understanding the science behind Big Data and analytics. I am a well 
> competent systems engineer in in public and private proprietary cloud 
> environments, I would like to know your professional opinions on how to 
> release engineer Apache Spark 2.0.0 and Hadoop 2.7.2 clusters into the 
> public cloud possibly using using Apache Ignite.
>
>  
>
> I anticipate your response and assistance as I have a fellow student who 
> is counting on me for a viable solution by the close of the Weekend.
>
>  
>
> Thank you in advance,
>
>  
>
> Matt ✌
>
> *TheSolutionIsX.com*
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To 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/f8df8d53-0187-46b3-9e41-b194d48901a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows playbooks causes cryptographic, windows remote management services to crash

2016-08-01 Thread 'J Hawkesworth' via Ansible Project
Might be worth trying pywinrm 0.2.0 - even if its just because its much 
quicker than 0.1.1

However I don't think that by itself it will fix your problem though.

Looking again the machines I'm running are actually S2012 R2 not S2012 and 
are mostly 2cpu 4Gb virtual machines.

If yours are S2012 not S2012R2 its worth checking the powershell and WMF 
version.  WMF 3.0 had a bug in it that meant it would fail to run almost 
anything but the most trivial winrm command - if so upgrading to WMF4.0 / 
powershell 4.0 is thoroughly recommended.

Jon


On Friday, July 29, 2016 at 8:06:28 PM UTC+1, Michael Perzel wrote:
>
> No I haven't upgrade pywinrm. Running 0.1.1.
>
> > pip show pywinrm
> DEPRECATION: Python 2.6 is no longer supported by the Python core team, 
> please upgrade your Python. A future version of pip will drop support for 
> Python 2.6
> ---
> Metadata-Version: 1.0
> Name: pywinrm
> Version: 0.1.1
> Summary: Python library for Windows Remote Management
> Home-page: http://github.com/diyan/pywinrm/
> Author: Alexey Diyan
> Author-email: alexey...@gmail.com 
> License: MIT license
> Location: /usr/lib/python2.6/site-packages
> Requires: xmltodict, isodate
> Classifiers:
>   Development Status :: 4 - Beta
>   Environment :: Console
>   Intended Audience :: Developers
>   Intended Audience :: System Administrators
>   Natural Language :: English
>   License :: OSI Approved :: MIT License
>   Programming Language :: Python
>   Programming Language :: Python :: 2
>   Programming Language :: Python :: 2.6
>   Programming Language :: Python :: 2.7
>   Programming Language :: Python :: 3
>   Programming Language :: Python :: 3.2
>   Programming Language :: Python :: 3.3
>   Programming Language :: Python :: Implementation :: PyPy
>   Topic :: Software Development :: Libraries :: Python Modules
>   Topic :: System :: Clustering
>   Topic :: System :: Distributed Computing
>   Topic :: System :: Systems Administration
> /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318:
>  
> SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject 
> Name Indication) extension to TLS is not available on this platform. This 
> may cause the server to present an incorrect TLS certificate, which can 
> cause validation failures. You can upgrade to a newer version of Python to 
> solve this. For more information, see 
> https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
>   SNIMissingWarning
> /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122:
>  
> InsecurePlatformWarning: A true SSLContext object is not available. This 
> prevents urllib3 from configuring SSL appropriately and may cause certain 
> SSL connections to fail. You can upgrade to a newer version of Python to 
> solve this. For more information, see 
> https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
> .
>   InsecurePlatformWarning
>
>
> On Friday, July 29, 2016 at 11:27:08 AM UTC-5, J Hawkesworth wrote:
>>
>> Not seen this myself and having been running 2.0.0.2 against our herd of 
>> windows server 2012 boxes for months.
>>
>> Did you upgrade pywinrm to 0.2.0 by any chance?
>>
>> Also I spotted this bug report which sounds simliar to your case -  
>> https://github.com/ansible/ansible/issues/16873 - although the stack 
>> trace is not failing at the same point so could be something different.
>>
>> Jon
>>
>> On Thursday, July 28, 2016 at 3:19:45 PM UTC+1, Michael Perzel wrote:
>>>
>>> Forgot to mention we've also experimented with increasing the winrm 
>>> maxconcurrentusers, maxprocessespershell, maxshellsperuser settings but 
>>> haven’t seen any difference in behavior.
>>>
>>> >winrm get winrm/config/winrs
>>>
>>> Winrs
>>>
>>> AllowRemoteShellAccess = true
>>>
>>> IdleTimeout = 720
>>>
>>> MaxConcurrentUsers = 30
>>>
>>> MaxShellRunTime = 2147483647
>>>
>>> MaxProcessesPerShell = 25
>>>
>>> MaxMemoryPerShellMB = 1024
>>>
>>> MaxShellsPerUser = 30
>>>
>>> On Thursday, July 28, 2016 at 9:17:03 AM UTC-5, Michael Perzel wrote:

 Since upgrading to ansible 2.0 my windows playbooks have been failing 
 with the following error. This error has been seen when running setup, 
 win_template, script tasks. The easiest way to repeat it is to have 
 multiple simultaneous runs of ansible affecting the same host. If we 
 re-run 
 the exact same playbook after a failure they almost always succeed.

 Traceback (most recent call last):
   File 
 "/usr/lib/python2.6/site-packages/ansible/plugins/connection/winrm.py", 
 line 240, in exec_command
 result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], 
 from_exec=True)
   File 
 "/usr/lib/python2.6/site-packages/ansible/plugins/connection/winrm.py", 
 line 208, in _winrm_exec
 self.protocol.cleanup_command(self.shell_id, command_id)
   File 
 

[ansible-project] Re: WinRM timeout for VMWare Tools Install

2016-08-01 Thread 'J Hawkesworth' via Ansible Project
Not doing this but interested to do so.

Not quite the same but see this 
- 
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US=displayKC=1018377

I think if you can persuade it not to restart networking immediately, then 
you can use the win_reboot: action to restart after the vmware tools 
installation has run through.

Lets us know how you get on, I'm sure there are others who would be 
interested in this.

Jon



On Saturday, July 30, 2016 at 12:10:03 AM UTC+1, Matt Betts wrote:
>
> I've got a basic task to install VMWare tools on a Windows VM and when it 
> installs it looks to cause a temporary network disconnection whilst it 
> updates the NIC drivers. During this time WinRM looks to be timing out and 
> throwing an error. VMWare tools is successfully installing though. Is 
> anyone else using Ansible to install VMWare tools on Windows?
>
> Traceback (most recent call last):
>   File 
> "/usr/lib/python2.7/site-packages/ansible-2.2.0-py2.7.egg/ansible/plugins/connection/winrm.py",
>  
> line 270, in exec_command
> result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True)
>   File 
> "/usr/lib/python2.7/site-packages/ansible-2.2.0-py2.7.egg/ansible/plugins/connection/winrm.py",
>  
> line 215, in _winrm_exec
> response = Response(self.protocol.get_command_output(self.shell_id, 
> command_id))
>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 333, in 
> get_command_output
> self._raw_get_command_output(shell_id, command_id)
>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 352, in 
> _raw_get_command_output
> res = self.send_message(xmltodict.unparse(req))
>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 207, in 
> send_message
> return self.transport.send_message(message)
>   File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 173, in 
> send_message
> response = self.session.send(prepared_request, 
> timeout=self.read_timeout_sec)
>   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 585, 
> in send
> r = adapter.send(request, **kwargs)
>   File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 479, 
> in send
> raise ReadTimeout(e, request=request)
> ReadTimeout: HTTPSConnectionPool(host='LABSTC2WINVT675.labs.corp', 
> port=5986): Read timed out. (read timeout=30)
> fatal: [LABSTC2WINVT675.labs.corp]: UNREACHABLE! => {"changed": false, 
> "msg": "failed to exec cmd PowerShell -NoProfile -NonInteractive 
> -ExecutionPolicy Unrestricted -EncodedCommand 
> UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgBUAHIAeQAKAHsACgAmACAAJwBDADoAXABVAHMAZQByAHMAXABhAF8AdQBzAGUAcgBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADYAOQA4ADMAMwA1ADQANAAuADAAMQAtADIANgA0ADEANAA4ADEAOQAwADQAOAAzADIAOABcAHcAaQBuAF8AcABhAGMAawBhAGcAZQAuAHAAcwAxACcACgB9AAoAQwBhAHQAYwBoAAoAewAKACQAXwBvAGIAagAgAD0AIABAAHsAIABmAGEAaQBsAGUAZAAgAD0AIAAkAHQAcgB1AGUAIAB9AAoASQBmACAAKAAkAF8ALgBFAHgAYwBlAHAAdABpAG8AbgAuAEcAZQB0AFQAeQBwAGUAKQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAbQBzAGcAJwAsACAAJABfAC4ARQB4AGMAZQBwAHQAaQBvAG4ALgBNAGUAcwBzAGEAZwBlACkACgB9AAoARQBsAHMAZQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAbQBzAGcAJwAsACAAJABfAC4AVABvAFMAdAByAGkAbgBnACgAKQApAAoAfQAKAEkAZgAgACgAJABfAC4ASQBuAHYAbwBjAGEAdABpAG8AbgBJAG4AZgBvAC4AUABvAHMAaQB0AGkAbwBuAE0AZQBzAHMAYQBnAGUAKQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAZQB4AGMAZQBwAHQAaQBvAG4AJwAsACAAJABfAC4ASQBuAHYAbwBjAGEAdABpAG8AbgBJAG4AZgBvAC4AUABvAHMAaQB0AGkAbwBuAE0AZQBzAHMAYQBnAGUAKQAKAH0ACgBFAGwAcwBlAEkAZgAgACgAJABfAC4AUwBjAHIAaQBwAHQAUwB0AGEAYwBrAFQAcgBhAGMAZQApAAoAewAKACQAXwBvAGIAagAuAEEAZABkACgAJwBlAHgAYwBlAHAAdABpAG8AbgAnACwAIAAkAF8ALgBTAGMAcgBpAHAAdABTAHQAYQBjAGsAVAByAGEAYwBlACkACgB9AAoAVAByAHkACgB7AAoAJABfAG8AYgBqAC4AQQBkAGQAKAAnAGUAcgByAG8AcgBfAHIAZQBjAG8AcgBkACcALAAgACgAJABfACAAfAAgAEMAbwBuAHYAZQByAHQAVABvAC0ASgBzAG8AbgAgAHwAIABDAG8AbgB2AGUAcgB0AEYAcgBvAG0ALQBKAHMAbwBuACkAKQAKAH0ACgBDAGEAdABjAGgACgB7AAoAfQAKAEUAYwBoAG8AIAAkAF8AbwBiAGoAIAB8ACAAQwBvAG4AdgBlAHIAdABUAG8ALQBKAHMAbwBuACAALQBDAG8AbQBwAHIAZQBzAHMAIAAtAEQAZQBwAHQAaAAgADkAOQAKAEUAeABpAHQAIAAxAAoAfQAKAEYAaQBuAGEAbABsAHkAIAB7ACAAUgBlAG0AbwB2AGUALQBJAHQAZQBtACAAIgBDADoAXABVAHMAZQByAHMAXABhAF8AdQBzAGUAcgBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADYAOQA4ADMAMwA1ADQANAAuADAAMQAtADIANgA0ADEANAA4ADEAOQAwADQAOAAzADIAOAAiACAALQBGAG8AcgBjAGUAIAAtAFIAZQBjAHUAcgBzAGUAIAAtAEUAcgByAG8AcgBBAGMAdABpAG8AbgAgAFMAaQBsAGUAbgB0AGwAeQBDAG8AbgB0AGkAbgB1AGUAIAB9AA==",
>  
> "unreachable": 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 

[ansible-project] Re: How to check if the current user has write access to a given path ?

2016-08-01 Thread ishan jain
Directly it didn't help me. What i did is a 3 step process - create a 
folder with timestamp in name (for uniqueness), check if it was created and 
then delete it.

On Friday, 29 July 2016 00:02:40 UTC+5:30, Alli wrote:
>
> Would stat achieve this for you? 
>
> http://docs.ansible.com/ansible/stat_module.html
>
> On Thursday, 28 July 2016 21:36:56 UTC+12, ishan jain wrote:
>>
>> I am trying to check via Ansible that whether the user (being used to 
>> connect) has write access to a given path - both on *linux hosts and 
>> windows hosts*.
>>
>> I tried looking around but i could not get an easy way to do that. I 
>> might be getting wrong paths a lot, so the typical commands with raw module 
>> is not a good idea. So what i thought of is to create try and create a file 
>> in the path, possibly with the name as current epoch and later remove it.
>>
>> Anybody have a better idea on how to do this for windows and linux 
>> machines ?
>>
>

-- 
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/815f99ee-2856-4d00-abd6-293d0b2b026c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: No epoch or seconds in windows facts ? How can i generate unique strings ?

2016-08-01 Thread ishan jain
I used a windows command to get the date:

get-date -format dd-MM-_HH_mm_ss_fff

So, to make a unique folder in windows, use:

 mkdir $(get-date -format dd-MM-_HH_mm_ss_fff)

On Saturday, 30 July 2016 01:34:29 UTC+5:30, Joanna Delaporte wrote:
>
> Seconds are at the end of the iso8601 string.  I use the iso8601 for one 
> playbook where I need a unique string on volume snapshots. 
>
> On Thursday, July 28, 2016 at 8:13:13 AM UTC-5, ishan jain wrote:
>>
>> Here is a small part of windows facts:
>>
>> "ansible_facts": {
>> "ansible_architecture": "64-bit", 
>> "ansible_date_time": {
>> "date": "13.07.2016", 
>> "day": "13", 
>> "hour": "06", 
>> "iso8601": "2016-07-13T06:34:29", 
>> "minute": "34", 
>> "month": "07", 
>> "year": "2016"
>> }, 
>>
>> Unlike facts for linux hosts, this does not have epoch or even seconds 
>> info ? This is a bit strange for me. Is there a way i can force it to 
>> collect that ?
>>
>> What i am trying is to check if the current user has read/write access on 
>> certain drive. I was trying to create  a file with unique name on the 
>> location and for that i need some sort of unique string.
>>
>

-- 
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/a1dfd940-8535-4683-8f22-1c00d767e0aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.