[ansible-project] Re: delegate_to and winrm is broken

2016-10-13 Thread Matt Davis
I suspect you may have an inventory or command issue that's reassigning localhost's connection type to winrm (you're not adding -c winrm, are you?) - this sample works fine for me on both 2.1.1 and devel. The connection: local is not necessary, and works fine for me with either local_action or

Re: [ansible-project] Visibility of facts/variables when using "become"

2016-10-13 Thread Brian Coca
The only difference with become, is the user the facts are gathered as. Without become, the login user gathers facts and if there are ones that require privileges that user lacks, those won't be populated. With become, you turn into another user and the same things apply, you can gather the facts

[ansible-project] delegate_to and winrm is broken

2016-10-13 Thread Stephen Bunn
It seems that it is impossible to run a local task when talking to windows hosts. This is pretty much a show stopper for my current use case of Ansbile. ansible version: ansible 2.1.1.0 using any of the following, all result in the same error - name: deploy some stuff hosts: somewindowshos

[ansible-project] Re: win_copy failing (timeout)

2016-10-13 Thread Matt Davis
Yeah, I never found a packaged Mac python that did the right thing. Recompiling Python against a compiled-by-me latest OpenSSL was the only way I got the issue to go away (I had also tweaked the default cipher list to "best practices" using IISCrypto, but that alone won't fix it with the Apple-

[ansible-project] Re: win_copy failing (timeout)

2016-10-13 Thread Peter Rebholz
Thanks for the info, Matt. I've tried a number of versions of OpenSSL without any luck: macOS El Capitan (where I originally had this problem) has Python 2.7.10 with OpenSSL 0.9.8zh FreeBSD 11.0-RELEASE has Python 2.7.12 with OpenSSL 1.0.2j FreeBSD 11.0-RELEASE with manual build of Python 2.7 (l

Re: [ansible-project] Module Paths for junos-eznc

2016-10-13 Thread Peter Sprygada
Are you attempting to run Ansible in a virtualenv? On Tue, Oct 11, 2016 at 3:16 PM, Zod wrote: > Trying to setup Ansible on Mac OS X 10.10.3 > Have ansible 2.1.1.0 python 2.7.12 > installed junos-eznc > Testing uploading a conf file to a juniper device and getting: > fatal: [srx]: FAILED! => {"c

[ansible-project] Re: Handle Host Unreachable cases or Test SSH Connectivity in yml playbook

2016-10-13 Thread 'Anas Theo' via Ansible Project
Hello Kai, Indeed, I can use ping to test the connectivity in all servers, hower the fatar error again can't be handled for example in a conditional form. What I request is to be able to handle this result "fatal: [sles_11]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the ho

[ansible-project] Re: Error: "ImportError: No module named grp" when running playbook against windows

2016-10-13 Thread Matt Davis
Running python modules on Windows isn't supported or tested (and in most cases just plain won't work)- would strongly suggest you find a win_ equivalent to whatever you're trying to do... On Thursday, October 13, 2016 at 11:17:53 AM UTC-7, Sam Brelsfoard wrote: > > I've seen a couple of other fo

Re: [ansible-project] Using with_subelements, cannot reference dict item's key (v 2.2.0)

2016-10-13 Thread Slavek Jurkowski
Thanks for the quick response. I think i’m going to just hack the name into the dict like so as i want to preserve the dict structure and this least bad way i see of doing that. My dict var is auto populated from another tool so it shouldn’t be hard for me to keep these in sync. Slavek > vars

Re: [ansible-project] Access dict key when using with_subelements

2016-10-13 Thread Slavek Jurkowski
Thanks for the reply. i agree..I just converted my dict in the same way..Just wanted to check if there was something better out there that anyone has found :P Slavek > On Oct 13, 2016, at 11:24 AM, Peter Thorson wrote: > > I have been using a horrible hacky workaround, specifically, adding th

[ansible-project] Error: "ImportError: No module named grp" when running playbook against windows

2016-10-13 Thread Sam Brelsfoard
I've seen a couple of other folks have this issue, but I've not found any answers/solutions. I have a playbook that runs fine from an ansible server (CentOS) to a Mac OSX node, however, when I run the same playbook against a Windows node I get an ImportError. Any thoughts? example: ansible-pl

Re: [ansible-project] Trying to delete a running app on Marathon by Ansible Playbook - Error

2016-10-13 Thread Dick Davies
Set a status_code: field to the value marathon returns, it looks like you are getting a 200 and ansible is expecting a 201. On 12 October 2016 at 17:00, Yogesh Darji wrote: > Hi, > > I deployed an app on Marathon with POST using uri module. My inventory file > has just localhost which I am using

Re: [ansible-project] Re: Using with_subelements, cannot reference dict item's key (v 2.2.0)

2016-10-13 Thread Joanna Delaporte
Slavek, I converted my dicts to lists. :P It didn't take too long with some snappy regex in vim. Joanna On Thu, Oct 13, 2016 at 9:06 AM, Slavek Jurkowski wrote: > Joanna, > > Did you find any solution to this? I'm facing the same issue and it sure > sucks! > > Thanks! > > > On Wednesday, June

[ansible-project] Re: win_copy failing (timeout)

2016-10-13 Thread Matt Davis
Every case I've seen of this issue has come down to a problem deep in an SSL/TLS implementation that causes the tunnel to get wedged. I've not dug in far enough with the packet sniffer/TLS debugging to be sure which side is the problem (Windows SChannel or OpenSSL), but on the machines I've seen

Re: [ansible-project] Dependencies between plays

2016-10-13 Thread Kai Stian Olstad
On 13. okt. 2016 02:50, Nikita Gubenko wrote: Hello, folks Is there any possible way to make plays depend on each other? E.g. in the example below do not start play2 if any of the hosts in play1 failed? --- # play 1 - hosts: rabbitmq gather_facts: no sudo: yes serial: 1 rol

[ansible-project] Re: java.lang.OutOfMemoryError: Metaspace error installing Atlassian JIRA using Ansible

2016-10-13 Thread Matt Davis
WinRM enforces a job memory quota (documented here ) that you'll probably need to adjust upward for a heavyweight installer like Jira. Also, if you're running Powershell 3.0, there's a hotfix that fixes that setting on some OSs, t

[ansible-project] Re: Access dict key when using with_subelements

2016-10-13 Thread Peter Thorson
I have been using a horrible hacky workaround, specifically, adding the key as a field to the dict element: vars: users: bob: name: bob authorized_keys: - "ssh-rsa a..." - "ssh-rsa b..." alice: name: alice authorized_keys: - "ssh-rsa c..."

[ansible-project] Re: Ansible unable to ping to windows host error Failed command was: PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand

2016-10-13 Thread Matt Davis
Usually when I've seen that error, it's because Powershell is not on the system path (ie, C:\Windows\System32\WindowsPowerShell\v1.0). Unfortunately the error message comes from a much higher level (a failure creating the tempdir), so the error message isn't specific to failures that might occur

Re: [ansible-project] Re: Slow Performance in setup of SLES 11 SP3 Remote Virtual Machines (100sec)

2016-10-13 Thread Kai Stian Olstad
On 13. okt. 2016 15:47, 'Anas Theo' via Ansible Project wrote: As I have described in the previous comment, the problem was due to DNS searching for a DNS server that has not been accessible from the hosts. For that reason, I have tried to setup for these hosts, only the variable that I was going

[ansible-project] Re: [Windows] Is there a way to install a single Windows Update by KB article ID?

2016-10-13 Thread Matt Davis
This functionality isn't currently implemented on win_updates. I've had a few people ask for it, and I might have time to implement it for 2.3, as it's not terribly difficult so long as we stick to "limit the update search/install to these KBs" and not "force install exactly these KBs". Unfort

Re: [ansible-project] using ansible on aws, then get the IP address of the aws instances.

2016-10-13 Thread Allen Sanabria
It depends on how you want to approach this. 1st approach: You can use the ec2.py inventory generator . 2nd approach: You can write Ansible Filters to get inventory dynamically during the same

Re: [ansible-project] Handle Host Unreachable cases or Test SSH Connectivity in yml playbook

2016-10-13 Thread Kai Stian Olstad
On 13. okt. 2016 15:42, 'Anas Theo' via Ansible Project wrote: As an alternative it could also be useful to test SSH connectivity through explicit commands in all remote hosts before executing the rest of the .yml file. Thanks for your help. If you have gather_facts as true and set "any_errors_

[ansible-project] ansible jinja template how can I get ip varible of aws instances

2016-10-13 Thread marcs345
I have 3 nodes neo4j databases ( all in AWS). I need to create config with jinja templates (neo4j-server.properties.j2) with diferent ip addr in option "elasticsearch.host_name=" How can I add to this config ip varible of 3 different internal ip from elastic search nodes which also in AWS ,

[ansible-project] Re: Access dict key when using with_subelements

2016-10-13 Thread Slavek Jurkowski
Hi Peter, Did you find a solution to this? I'm facing the same issue and it sure sucks! Thanks On Wednesday, April 6, 2016 at 5:47:01 PM UTC-5, Peter Thorson wrote: > > when using with_dict, item.key retrieves the dict key and item.value > retrieves the value. > > however, when using with_sub

[ansible-project] Module Paths for junos-eznc

2016-10-13 Thread Zod
Trying to setup Ansible on Mac OS X 10.10.3 Have ansible 2.1.1.0 python 2.7.12 installed junos-eznc Testing uploading a conf file to a juniper device and getting: fatal: [srx]: FAILED! => {"changed": false, "failed": true, "msg": "junos-eznc >= 1.2.2 is required for this module"} I did install

[ansible-project] Re: Using with_subelements, cannot reference dict item's key (v 2.2.0)

2016-10-13 Thread Slavek Jurkowski
Joanna, Did you find any solution to this? I'm facing the same issue and it sure sucks! Thanks! On Wednesday, June 29, 2016 at 1:43:39 PM UTC-5, Joanna Delaporte wrote: > > Here's my version: ansible 2.2.0 (devel 87928ff56b) last updated > 2016/06/22 13:32:23 (GMT -500) > > I'm not sure if thi

[ansible-project] using ansible on aws, then get the IP address of the aws instances.

2016-10-13 Thread 'John Smith' via Ansible Project
I have an ansible playbook that starts up some aws instances. once they are up I can see the instances have public ip and private ip. is there a way I can programmatically get the ip addresses from outside aws cliud instead of of having to look at the aws console ? I want my application (tea

[ansible-project] RDS instance snapshot and restore

2016-10-13 Thread Tony
Hi All, I am trying to create a playbook intend to create an RDS MySQL snapshot and then create a restore form the snapshot. I used the aws cli locally and it works but don't know how to translate the commands in a ansible playbook. In my understanding Ansiblee use ssh but I can't ssh the rds in

[ansible-project] Visibility of facts/variables when using "become"

2016-10-13 Thread thokari81
Hi, I ran into the issue that I wanted to include a role based on a fact. Specifically, I wanted the firewall role (configuring iptables) to not be included when the playbook is run locally against a Vagrant VM. I noticed that the facts are not available (= empty string) when I do it like that,

[ansible-project] Dependencies between plays

2016-10-13 Thread Nikita Gubenko
Hello, folks Is there any possible way to make plays depend on each other? E.g. in the example below do not start play2 if any of the hosts in play1 failed? --- # play 1 - hosts: rabbitmq gather_facts: no sudo: yes serial: 1 roles: - rabbitmq # play 2 - hosts: we

[ansible-project] Re: win_copy failing (timeout)

2016-10-13 Thread Peter Rebholz
I'm also running into this issue and spent some time troubleshooting. In my case, the host I'm pushing the file to is on a separate network without incoming access to where we host the files, thus the proposed workaround of using `get_url` does not work. In my troubleshooting, I've found out th

[ansible-project] Re: setting up new control from source - getting 'FAILED => winrm is not installed' targeting existing Win clients

2016-10-13 Thread kavincts
Hi Damon, Exactly i am facing the same issue; Could you please let me know how to copy the below package to which location? Regards, Kavin On Friday, August 29, 2014 at 1:58:31 AM UTC+5:30, Damon Overboe wrote: > > OK it is a python problem on my new host, I just don't know / remember > what I

[ansible-project] Trying to delete a running app on Marathon by Ansible Playbook - Error

2016-10-13 Thread Yogesh Darji
Hi, I deployed an app on Marathon with POST using uri module. My inventory file has just localhost which I am using to execute my playbooks. I have written a playbook to delete that app, it will successfully delete the app, but the only problem which I am facing is that I am getting below er

[ansible-project] Ansible unable to ping to windows host error Failed command was: PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand

2016-10-13 Thread arnabsc74
Hi When run this ansible command " ansible windows -m win_ping" I am getting the below error , please can anyone help to fix this issue 10.51.239.192 | UNREACHABLE! => { "changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenti

[ansible-project] List tasks for a play in a callback plugin

2016-10-13 Thread Daniel Matsson
Hi! I'm trying to create a callback plugin where I would like to get a list with all tasks that will be running before they are actually executed. I'm able to get a list with all plays using playbook.get_plays() but if I try to get tasks for each play (play.get_tasks()) it just returns an empty

[ansible-project] java.lang.OutOfMemoryError: Metaspace error installing Atlassian JIRA using Ansible

2016-10-13 Thread Jim Reprogle
Greetings. I realize that much of this is going to sound crazy and a little noob-ish, but... I'm playing with Ansible for the first time, and I'm trying to automate the installation of a JIRA server (on Windows, mind you). I went through all the rigmarole of enabling WinRM with a self-signed cer

Re: [ansible-project] Updateing a password in Grub.conf file using Ansible and Replace

2016-10-13 Thread Kai Stian Olstad
On 13. okt. 2016 14:04, Alan Harkleroad wrote: Yes the hash starts with a $ and includes / as well. I dont follow what you mean by escaping them. Escaping is also documented here https://docs.python.org/2/library/re.html#regular-expression-syntax But it's a back slash (\) in front of a regexp

[ansible-project] Re: Slow Performance in setup of SLES 11 SP3 Remote Virtual Machines (100sec)

2016-10-13 Thread 'Anas Theo' via Ansible Project
As I have described in the previous comment, the problem was due to DNS searching for a DNS server that has not been accessible from the hosts. For that reason, I have tried to setup for these hosts, only the variable that I was going to use, using filter options like "filter=ansible_hostname" .

[ansible-project] Handle Host Unreachable cases or Test SSH Connectivity in yml playbook

2016-10-13 Thread 'Anas Theo' via Ansible Project
Hello, Is there any easy way to handle "host unreachable" cases in order to debug in a log file the problematic situation ? As an alternative it could also be useful to test SSH connectivity through explicit commands in all remote hosts before executing the rest of the .yml file. Thanks for you

[ansible-project] Re: Variable substitution while file lookup

2016-10-13 Thread ankur . cool
Ok i found an answer. {{ lookup('template', 'cluster_policies.j2') }} this works fine On Thursday, October 13, 2016 at 6:33:41 PM UTC+5:30, ankur...@gmail.com wrote: > > Hi, > > I am loading a file using lookup eg "{{ lookup('file', > 'cluster_policies.json') | from_json }}" > > Now my file clu

[ansible-project] Variable substitution while file lookup

2016-10-13 Thread ankur . cool
Hi, I am loading a file using lookup eg "{{ lookup('file', 'cluster_policies.json') | from_json }}" Now my file cluster_policies.json contains some ansible variables that I need to substitute. Any idea how can it be done? Thanks -- You received this message because you are subscribed to the

Re: [ansible-project] Re: Connecting to Windows host fails

2016-10-13 Thread JayB
What configuration does it need for PowerShell? -- 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

Re: [ansible-project] Updateing a password in Grub.conf file using Ansible and Replace

2016-10-13 Thread Alan Harkleroad
Yes the hash starts with a $ and includes / as well. I dont follow what you mean by escaping them. Here is an example hash. So how would I have it read that as one character string and swap it with the new hash $1$adjkielw$B./Hu9VCs96Zxc3mkVQ35. On Wednesday, October 12, 2016 at 3:58:25 PM

Re: [ansible-project] Re: Connecting to Windows host fails

2016-10-13 Thread JayB
No, It didn't work. I already tried that last week. Any other option? On Monday, 10 October 2016 12:53:05 UTC+5:30, J Hawkesworth wrote: > > Did adding > > ansible_winrm_server_cert_validation: ignore > > Fix this for you? > > Jon > On Friday, October 7, 2016 at 4:27:23 PM UTC+1, Aidan Gustard wro