Re: [ansible-project] enumerate elasticache/redis instances

2014-06-06 Thread Michael DeHaan
While there are probably other suggestions people would offer up, I'd probably consider tagging your redis machines redis, that way it will automatically make a group of them, and they will be easier to manage. On Mon, Jun 2, 2014 at 2:09 PM, Damjan Georgievski gdam...@gmail.com wrote:

Re: [ansible-project] Re: lookup syntax (or client/server install)

2014-06-06 Thread Michael DeHaan
From then on, it seems to me impossible to contact any other machine than what is declared on the 'hosts' line. You can start another play in the same playbook that talks to a different host group. On Tue, Jun 3, 2014 at 6:10 AM, Makimoto Marakatti makim...@gmail.com wrote: Hi Thanks for

Re: [ansible-project] How to use roles from the command line?

2014-06-06 Thread Michael DeHaan
Methodological issue, not practical: it feels dirty to edit a file between the test and the application. I wouldn't look at it this way. To edit the role, perhaps, likely, yes. But the idea that a playbook is simply mapping roles to hosts -- and keeping playbooks at top level very simple --

Re: [ansible-project] Re: Conditional variable assignments

2014-06-06 Thread Michael DeHaan
I personally strongly dislike seeing Jinja2 conditionals in top level playbooks (too much like line noise), so I'd do this to keep it cleaner: - shell: foo register: x - shell: bar register: y - shell: baz register: z - set_fact: a={{ z }} - set_fact: a={{ y }} when: x On Tue, Jun

Re: [ansible-project] Re: Are Roles enough?

2014-06-06 Thread Michael DeHaan
On Tue, Jun 3, 2014 at 1:37 AM, john@caradvice.com.au wrote: Yes. I'm only new to ansible but am seriously struggling. The playbooks I can get my head around but the roles are proving very painful. I thought the idea might be to switch features on/off for each host via variables? Would

Re: [ansible-project] Re: Are Roles enough?

2014-06-06 Thread Michael DeHaan
Both profiles and states are roles, but I separate them into two roles directories. I then use role dependencies between profiles and states (and states and states). A playbook simply ties hosts to profile roles. A few thing I ran into: * I needed to use a trick to make sure each state

Re: [ansible-project] A couple errors recently cropped up

2014-06-06 Thread Michael DeHaan
What about a with_pipe ? Did you check both the templates and the playbooks? It seems to be in a template. On Tue, Jun 3, 2014 at 3:03 PM, Daniel W. Ottey d...@bluefrogs.us wrote: I copied some code from some place (which previously worked). My code does not have the word pipe anywhere.

Re: [ansible-project] syntax-check triggers vars_prompt

2014-06-06 Thread Michael DeHaan
It's definitely not by design, though not too many people do you use vars_prompt since it limits interactivity. On Wed, Jun 4, 2014 at 9:47 AM, James Cammarata jcammar...@ansible.com wrote: I don't believe so, I'd open a github issue for this so we can keep track of it. On Tue, Jun 3,

Re: [ansible-project] syntax-check triggers vars_prompt

2014-06-06 Thread Michael DeHaan
s/limits/requires/ On Fri, Jun 6, 2014 at 8:29 AM, Michael DeHaan mich...@ansible.com wrote: It's definitely not by design, though not too many people do you use vars_prompt since it limits interactivity. On Wed, Jun 4, 2014 at 9:47 AM, James Cammarata jcammar...@ansible.com wrote: I

Re: [ansible-project] Question about roles, handlers, variables, and scope

2014-06-06 Thread Michael DeHaan
So it shouldn't be merged into a global list, but should be valid only for that include. On Wed, Jun 4, 2014 at 10:32 AM, James Cammarata jcammar...@ansible.com wrote: As far as I can tell, variables passed in as params to includes have never been merged into the global list of variables

Re: [ansible-project] Best practice for recording Ansible provisioning runs

2014-06-06 Thread Michael DeHaan
Ansible Tower contains some very nice logging of job history you may be interested in: http://www.ansible.com/tower This is probably the easiest way to go because you don't have to build it yourself, but there's still a searchable REST API to access everything. On Wed, Jun 4, 2014 at 5:20

Re: [ansible-project] Reusing inventory config

2014-06-06 Thread Michael DeHaan
Don't do all:vars, use a group_vars/all file instead. Not only is it cleaner for a static inventory, but it's usable with dynamic ones as well. On Thu, Jun 5, 2014 at 3:05 AM, Dick Davies d...@hellooperator.net wrote: I do the per environment inventories too (partly because they're

Re: [ansible-project] with_items and array concatenation?

2014-06-06 Thread Michael DeHaan
The first problem here is not about sets or unions or anything. The issue is with_items wants a single list to walk over, not a list of two lists. So with_items: variable_ame works as does with_items: - dog - cat - fish With hard coded strings But if you want to walk two lists,

Re: [ansible-project] Re: FreeBSD support

2014-06-06 Thread Michael DeHaan
Please file a ticket in github so we can remember to update the docs. Thanks! On Thu, Jun 5, 2014 at 6:03 AM, Fred frederik.nn...@gmail.com wrote: The user module's documentation points us to an example in the github examples directory.. there's nothing like that in ansible-examples, but

Re: [ansible-project] Best practice for referring to other host IPs

2014-06-06 Thread Michael DeHaan
We've discussed fact caching options in the past. There may be some in the future. Until now, talk to the hosts first. On Thu, Jun 5, 2014 at 11:14 AM, Dick Davies d...@hellooperator.net wrote: Is there an option to use the FQDNs in the inventory itself then? If they resolve then you

Re: [ansible-project] GCE service account: RSA key format is not supported

2014-06-06 Thread Michael DeHaan
I don't know about this one, maybe some of the GCE folks involved with the module can chime in. A traceback is very much a bug, so please make sure one is filed and we can get Eric Johnsons's attention on it on GitHub. On Thu, Jun 5, 2014 at 12:13 PM, Michael W. Lucas

[ansible-project] Ansible, validate a custom configuration file

2014-06-06 Thread Valentino Gagliardi
Hello there already asked on IRC with no luck. In Ansible It is possibile to pass a custom filename to validate='' rather than %s? I need to validate a main conf file which is not the templated one. While this works fine but is not the intended behavior because it validate only {{

Re: [ansible-devel] Re: [ansible-project] Slow ansible-playbook start up with vaults (and possible solution)

2014-06-06 Thread Michael DeHaan
I'm open to the idea of parse_yaml_from_file caching small files in memory if vault decoded. On Thu, Jun 5, 2014 at 2:33 PM, Serge van Ginderachter se...@vanginderachter.be wrote: I have a couple of patches in queue that might help on this (though not the core issue if the extra time is

Re: [ansible-project] Breaking a loop

2014-06-06 Thread Michael DeHaan
Serge is correct in the above. The registration of a loop variable results in a list being stored. On Thu, Jun 5, 2014 at 2:36 PM, Serge van Ginderachter se...@vanginderachter.be wrote: On 5 June 2014 18:20, James Cammarata jcammar...@ansible.com wrote: That's odd, the task should fail

Re: [ansible-project] Setting dir vs file permissions with file recurse=yes

2014-06-06 Thread Michael DeHaan
We welcome improvements via pull request. Just click the edit link on any page of the docs in the upper right for a link to the GitHub page. If it's a module, the docs are embedded in the module source. On Thu, Jun 5, 2014 at 2:53 PM, Paul Sokolovsky pmis...@gmail.com wrote: Hello, On

Re: [ansible-project] idempotentcy using ec2_vpc ??

2014-06-06 Thread Michael DeHaan
curious if anyone has figured out a way to have idempotency when creating a VPC using this module Idempotency is one of my least favorite words, because it's used in so many different ways by different people to mean many different things :) Just to be sure, what is the above code block doing

Re: [ansible-project] Ansible, validate a custom configuration file

2014-06-06 Thread Brian Coca
validate is intended to do so on the file you are copying/templating BEFORE it is put into place. It does not work for 'multi file configs' as the main file will not be pointing to the tmpfile that you are processing, which defeats the purpose of the whole thing. If you want to validate existing

Re: [ansible-project] Lack of response to pull requests

2014-06-06 Thread Michael DeHaan
Hi everyone, Yes, we're busy! Ansible was one of the top projects last year for number of Open Source Contributors on GitHub - #5 behind such projects as Rails, Angular.js, and Homebrew. There are a LOT of pull requests incoming. We are going to prioritize based on fixing the bugs and issues

Re: [ansible-project] idempotentcy using ec2_vpc ??

2014-06-06 Thread Gregory K. Spranger
yeah -- i re-read what i wrote and cringed a little -- sorry about that .. let me explain better what i am hoping for .. #1 in my example play, it creates a VPC just fine .. problem is, if i run it again -- with no changes to the code -- it will create a new VPC with the same options .. i guess i

Re: [ansible-project] Reusing inventory config

2014-06-06 Thread Dick Davies
Yeah we're about to try some of the cloud providers, I know this is going to bite us. problem with group_vars/all is that it's 'in the tree' - I'm trying to find a way to have preprod_hosts and production_hosts contain everything environment-specific, so we can ensure roles/ group_vars/ etc.

Re: [ansible-project] Re: Doing a diff between two device's facts

2014-06-06 Thread Brent Langston
On Thu, Jun 5, 2014 at 7:52 PM, Jason Edelman jedelm...@gmail.com wrote: Have an alternative solution working now. secrets don't make friends! mind closing the loop by sharing what you came up with? Brent -- You received this message because you are subscribed to the

[ansible-project] Re: GCE service account: RSA key format is not supported

2014-06-06 Thread Eric Johnson
Hi Michael (Lucas), First, I'd suggest deleting that service account and creating new one since I believe you've shared a bit too much information. :) As for the traceback, I'm not sure what you're getting that error. It looks like you've done everything to get set up just fine. I've never

[ansible-project] Variable undefined after set_fact

2014-06-06 Thread Nathan Robertson
I am either missing something simple or ran into a bug. I have a playbook that passes variable to a role as follows: roles: - { role: test_role, var1: 'some string', var2: {{ some_var }}, var3: {{ some_var2 }} } Now both some_var and some_var2 are set (verified with a debug before

Re: [ansible-project] idempotentcy using ec2_vpc ??

2014-06-06 Thread Nathan Howell
You'll want to add resource_tags... and read the comments for them in the documentation. :-) Nathan On Friday, 6 June 2014 06:06:21 UTC-7, Gregory Spranger wrote: yeah -- i re-read what i wrote and cringed a little -- sorry about that .. let me explain better what i am hoping for .. #1

Re: [ansible-project] idempotentcy using ec2_vpc ??

2014-06-06 Thread Gregory K. Spranger
RTFM my bad On Fri, Jun 6, 2014 at 2:04 PM, Nathan Howell nathan.how...@gmail.com wrote: You'll want to add resource_tags... and read the comments for them in the documentation. :-) Nathan On Friday, 6 June 2014 06:06:21 UTC-7, Gregory Spranger wrote: yeah -- i re-read what i wrote and

Re: [ansible-project] A couple errors recently cropped up

2014-06-06 Thread Matt Martz
datestamp: {{ lookup('pipe', 'date +%Y%m%d-%H%M%S') }} That should be the updated syntax for what you are trying to do. On Fri, Jun 6, 2014 at 2:18 PM, Daniel Ottey otte...@bluefrogs.us wrote: Thanks all. I was finally able to narrow the error down to this variable file

Re: [ansible-project] A couple errors recently cropped up

2014-06-06 Thread Daniel W. Ottey
Thanks Mark. Unfortunately that still did not work for me. Here is the new error (I wish the ansible errors were a little more straight-forward) GATHERING FACTS *** fatal: [labadmin.lab.boomi.com] = Traceback (most recent call last):

Re: [ansible-project] A couple errors recently cropped up

2014-06-06 Thread Brian Coca
it seems like you are doing a lookup with pipe and the program you are calling cannot be found. -- Brian Coca Stultorum infinitus est numerus 0111011100100110010101101110001001110111011000010110011101010010011100110110110101110111001001110111 Pedo mellon a

[ansible-project] Are Roles enough?

2014-06-06 Thread Joachim Friberg
I have it as simple as this; Playbooks \ server1.yml \ server2.yml \ roles/ldap \ roles/Apache... And so on, its very simple and its easy to manager :-) -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop

Re: [ansible-project] Re: Are Roles enough?

2014-06-06 Thread Joost Cassee
Hi Michael and others, It could be me explaining wrong, or I could be off the path, but let me try again. My site playbook is basically only used to tie roles to host groups. Those roles are specific for our infrastructure, e.g. setting up our frontend server, backend server, etc. I call those

[ansible-project] Re: Variable undefined after set_fact

2014-06-06 Thread Nathan Robertson
So I found part of the problem. First the set_fact only seemed to work when using the second format in the documentation - set_fact: var2: something when: var2 is not defined second I found that if the set_fact runs in a role once and you run that role multiple times with different

[ansible-project] what is the standard Ansible rolling-deploy with continuous integration testing workflow?

2014-06-06 Thread Gallagher Polyn
Hey all, Happily (and with help from folks on this forum) I am able to do rolling deploys a la the lamp_haproxy example https://github.com/ansible/ansible-examples/tree/master/lamp_haproxy on all of the providers covered by Ansible's cloud modules: rackspace, aws, do, linode and gce -- yay!