Re: [ansible-project] Access register array defined in one host group from another host group

2014-08-26 Thread Imran Khan
You mean hostvars[groups['localhost']|first.new_ips Doesn't work! On Monday, August 25, 2014 10:37:57 PM UTC-7, Henry Finucane wrote: Probably something like hostvars[groups['webservers']|first].new_ips On Mon, Aug 25, 2014 at 10:35 PM, Imran Khan khan.im...@gmail.com javascript: wrote:

Re: [ansible-project] Access register array defined in one host group from another host group

2014-08-26 Thread Imran Khan
{{hostvars[groups['localhost'].new_ips.results.stdout}} Gives the following error: One or more undefined variables: 'dict object' has no attribute 'localhost' On Monday, August 25, 2014 10:37:57 PM UTC-7, Henry Finucane wrote: Probably something like

Re: [ansible-project] Access register array defined in one host group from another host group

2014-08-26 Thread Henry Finucane
You know what- I answered your title, not your question. If you don't want to have to try and persist things between plays, you might have more luck with something like this: - hosts: myhosts tasks: - shell: echo things local_action: true register: new_ips - shell: echo other

Re: [ansible-project] Access register array defined in one host group from another host group

2014-08-26 Thread Imran Khan
haha.okay! I did not want to post my whole playbook as it might get confusing. I really do appreciate your help though. Here is a sizeable chunk of the playbook which might make things easy (or difficult) to understand :) #$ cat khan.yml --- - hosts: localhost gather_facts: False

[ansible-project] Use items from task condition in template

2014-08-26 Thread Sergei Antipov
Hello. Please tell me how I can use items from task condition in template. Or other method, how I can decide my probled. goal: I have a template for /etc/network/interfaces file. I want to set up bond interface, which contains the parameter slaves XXX XXX XXX, where XXX - name of interface. I

[ansible-project] Ansible Galaxy better GFM support

2014-08-26 Thread Takeshi Yaegashi
Hello project, Recently I've made my first submission in Ansible Galaxy: https://galaxy.ansible.com/list#/roles/1475 Unfortunately the page above failed to render the module option table in README.md. It's written in raw HTML, but looks correct on GitHub:

Re: [ansible-project] Re: [Ansible to Windows] IndexError: tuple index out of range

2014-08-26 Thread Chris Church
The IndexError traceback was fixed by https://github.com/ansible/ansible/commit/07f12539eee2faac5fe831cd31f1f0a5d3e7e661, and I just pushed a fix for running windows modules from playbooks ( https://github.com/ansible/ansible/commit/57dee4545b3c34d1e66943def8d5e45ee95d66bd ). The winrm

Re: [ansible-project] Ansible Galaxy better GFM support

2014-08-26 Thread Michael DeHaan
Perhaps -- it's been requested before. Right now we're using all of our resources on the ansible core project since I think that does the most good, though the time will come in the future where we add more upgrades, this will likely be one of them, provided there are good Python libraries for

Re: [ansible-project] Best practices for using Ansible with and without Vagrant

2014-08-26 Thread Jeff Geerling
Nice script, I hadn't seen that until now, but will likely start using it for a few of my setups. Just wanted to chime in and say that for 99% of the infrastructure I manage, I just have on Git repo for both dev and production (and a few that have config for dev + test + production). I usually

[ansible-project] Parentheses in lineinfile line argument

2014-08-26 Thread Matteo Ceccarello
Hi all! I'm trying to use the lineinfile module to configure NFS exports and I need to put parentheses in my line argument. If I do something like this - name: Export the NFS directory for root lineinfile: dest=/etc/exports regexp='/root/nfs' line='/root/nfs

Re: [ansible-project] apt module reporting changes when there are none

2014-08-26 Thread Jeff Geerling
That was exactly the problem; the `libz-dev` package was causing the false 'changed' status. $ aptitude search libz-dev v libz-dev- v libz-dev:i386

Re: [ansible-project] Best practices for using Ansible with and without Vagrant

2014-08-26 Thread kesten broughton
For this particular problem (calling on every vm) i use a trick i found online: only include the ansible provision call in the last vm in the Vagrantfile in is provider section. On Thursday, June 6, 2013 8:11:54 AM UTC-5, Peter Petrov wrote: On Thursday, June 6, 2013 12:51:46 PM UTC+3, Gilles

Re: [ansible-project] remote_user specified in play available to roles in the play

2014-08-26 Thread Brian Coca
Not sure what you mean. When set at play level, all tasks by default will use that remote_user. you can override on specific tasks with different remote_user.​ Of course unless hostvars override with ansible_ssh_user -- You received this message because you are subscribed to the Google Groups

[ansible-project] Re: how to debug random errors on win_msi Windows module?

2014-08-26 Thread Damon Overboe
That's exactly what I did to get your changes into the mainline, so I'm doing that again. You want me to post feedback (if I have any) in this thread or on the pull request? On Tuesday, August 26, 2014 5:25:46 PM UTC-5, Trond Hindenes wrote: Me too. I would just grab the file manually and

Re: [ansible-project] Parentheses in lineinfile line argument

2014-08-26 Thread Michael DeHaan
Lineinfile doesn't have any particular handling of a parenthesis. I don't think I see a bug in the above, but it can be hard to use. I recommend templates for 99.% of all use cases, above lineinfile. Please do confirm your ansible version if you don't mind... On Tue, Aug 26, 2014 at 9:57

Re: [ansible-project] Where to put a custom lookup plugin?

2014-08-26 Thread Michael DeHaan
Note that lookup plugins will get executed once per host, it may be better to download it once from s3 and then load it via a lookup plugin to avoid s3 hammering. You could really put the file anywhere you want, though something outside of your git directory seems wise, or otherwise configure

[ansible-project] Re: how to debug random errors on win_msi Windows module?

2014-08-26 Thread Damon Overboe
There it is, finally!!! This is still using the win_msi, I'll switch to the win_package now. I'm not sure why but I just wasn't going to be happy until I broke it. changed: [node1.domain.com] Traceback (most recent call last): File

[ansible-project] Re: how to debug random errors on win_msi Windows module?

2014-08-26 Thread Trond Hindenes
Nice, So, Chris just tipped me about this ansible.cfg setting: [defaults] keep_remote_files = 1 Stick that in your /ansible/etc/ansible.cfg and re-run your playbook with -vvv All those temp paths Ansible uses for powershell files will now be left on your windows system. Each folder basically

Re: [ansible-project] How can I create a path variable containing a timestamp?

2014-08-26 Thread Michael DeHaan
Yep. The trick would be to set it via set_fact... set_fact: var: {{ lookup('pipe', 'foo') }} And then refer to it consistently from one host via hostvars, or not care that it was different. On Tue, Aug 26, 2014 at 12:17 PM, Tomasz Kontusz tomasz.kont...@gmail.com wrote: Wouldn't the value

Re: [ansible-project] using ansible to deploy war to stage/qa env

2014-08-26 Thread Michael DeHaan
No, you *cannot* do what Tomas says above and then still target -i inventory as one common infrastructure. instead, do this. Inside your inventory/production put all hosts under a group named production Inside your inventory/stage, put all hosts under a group named stage. On Tue, Aug 26,

Re: [ansible-project] apt module reporting changes when there are none

2014-08-26 Thread Michael DeHaan
Perhaps there's a log to tail? On Tue, Aug 26, 2014 at 1:42 PM, Jeff Geerling geerling...@gmail.com wrote: Short of adding in some regular expressions to detect whether there were changes in the apt stdout, I'm not sure of a way that you could do this easily—and without introducing a host

Re: [ansible-project] setup module slow when connecting to host with ohai installed

2014-08-26 Thread Michael DeHaan
Looks like no. You could uninstall ohai :) On Tue, Aug 26, 2014 at 2:43 PM, kesten broughton kesten.brough...@gmail.com wrote: Did this ever make it into trunk? I've hit a case where I'd like to be able to disable the automatic ohai fact-gathering. On Monday, March 17, 2014 11:55:07

Re: [ansible-project] Re: ansible-pull dynamic roles

2014-08-26 Thread Michael DeHaan
Ansible-pull isnt a requirement, but using a push based method seems to be difficult with our environment which has over 400 roles, and 2000+ servers We have some users (admittedly somewhat more heterogenous to you) pushing to 5000 nodes with one box. You will be able to increase --forks to

Re: [ansible-project] idea: s3 module to auto detect content type and set as metadata

2014-08-26 Thread Michael DeHaan
We'd be open to a pull request on this subject I guess. Would it run file against the tool to figure out the type? This doesn't map 100% to MIME types, so curious how you'd go about it. Extensions shouldn't be made to be significant, IMHO. That's a little old-school-windowsey. On Tue, Aug

Re: [ansible-project] set_fact support for list of dictionaries?

2014-08-26 Thread Michael DeHaan
You're replying to an old thread from July which was a little long, so I'm not sure what this inquiry was about. Is this related to this odd set_fact behavior I'm encountering with ansible 1.7.1? Could use some help clarifying what the pronoun this refers to. Sorry, internets make this hard

Re: [ansible-project] Help with force-handlers

2014-08-26 Thread Michael DeHaan
Not sure what's up wih the HTML copy/paste, but it's hard to collapse and skim over. If you called a fail task, and that group is reduced to size=0, Ansible is done. You should avoid calling a fail task if you want a handler to run later on that host, or make sure those tasks have a failed_when:

[ansible-project] Re: 'Connection' object has no attribute 'shell' when attempting to establish an accelerated connection

2014-08-26 Thread Bryan Beaudreault
Seeing this same issue. Is there a better fix? On Tuesday, July 15, 2014 10:54:38 AM UTC-4, David Karnowski wrote: I received the below error when trying to run a playbook. I'm running your latest dev Ansible pulled from github (1.7). I'm new to Ansible and am setting it up on my PC for

[ansible-project] Re: how to debug random errors on win_msi Windows module?

2014-08-26 Thread Damon Overboe
Awesome I'll give that as shot. The biggest thing I wanted to know was how to catch the output so I can at least try to debug it or ask for help, so that'll be huge. I'm off for the night tonight but I'll be testing out win_package tomorrow for sure. I'll let you know how it goes. On Tuesday,

Re: [ansible-project] idea: s3 module to auto detect content type and set as metadata

2014-08-26 Thread Drake Wilson
On 26/08/14 18:00, Michael DeHaan wrote: Extensions shouldn't be made to be significant, IMHO. That's a little old-school-windowsey. That's still in very widespread use, and not only in Windows-based environments, and it's vastly more robust than trying to deal in potentially-colliding

Re: [ansible-project] Ansible's docker module volumes option is a mystery (to me)

2014-08-26 Thread James Cammarata
I merged in support for specifying :ro/:rw a few weeks ago, and it was included in the 1.7.1 release. On Tue, Aug 26, 2014 at 2:26 PM, Steven Truong djatlan...@gmail.com wrote: TASK: [echo $myhome] ** ok: [localhost] = { myhome: {

Re: [ansible-project] Symbolic file modes now supported in relevant modules

2014-08-26 Thread Michael DeHaan
Seeing James did not reply to this one, just wanted to follow up. We've discussed this a bit online, and decided the file modules need more examples showing how this would be specified. I find the = a bit confusing following an equals, but : might make things more quotey, I think we can live

Re: [ansible-project] set_fact support for list of dictionaries?

2014-08-26 Thread Michael DeHaan
It's not the least bit screwy. If you are doing key=value stuff all on one line, Ansible doesn't know what is a string or not. Jinja2 templating happens before values are past. You are correct in that the long form set_fact does hold types nicely, and is what you want. On Tue, Aug 26, 2014

Re: [ansible-project] set_fact support for list of dictionaries?

2014-08-26 Thread Michael DeHaan
Also you actually mean this (note spacing): - set_fact: directories: {{ directories_output.stdout_lines }} This is because directories is not a parameter to the task, it's passed to the set_fact module. On Tue, Aug 26, 2014 at 9:08 PM, Michael DeHaan mich...@ansible.com wrote: It's

Re: [ansible-project] Use items from task condition in template

2014-08-26 Thread Sergei Antipov
example: - name: create /etc/network/intefaces file template: src=xxx dest=xxx with_items: ansible_interfaces when: item | match(eth*) and in template I need: slaves eth0 eth1 eth2 ethX вторник, 26 августа 2014 г., 19:47:21 UTC+7 пользователь Michael DeHaan написал: I'm not sure

Re: [ansible-project] Symbolic file modes now supported in relevant modules

2014-08-26 Thread James Cammarata
Sticky bits and setuid/setgid all work as expected currently: o+t (sticky bit) g+s (setgid) u+s (setuid) The all target also works: a=rw As does specifying multiple targets with one operation: ugo=rw ugo+x The special X mode even works, which is handy for targeting directories only in