Re: [ansible-project] Random cows!!!!

2014-10-06 Thread Brian Coca
Still my proudest contribution to OSS. -- 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, se

Re: [ansible-project] Random cows!!!!

2014-10-06 Thread Michael DeHaan
Due to some "interesting" in this one, I considered removing ansible cow selection and going to a pure-python cowsay implementation at one point in time :) This of course would mean everyone would get cows, which I think helps the world become a happier place. Don't worry, I've no plans to do eit

[ansible-project] Random cows!!!!

2014-10-06 Thread Guy Matz
export ANSIBLE_COW_SELECTION='random' You're welcome! -- 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 t

[ansible-project] Re: How access dictionary in a jinja2 template?

2014-10-06 Thread skr989
Works for me now. I over worked on this and ignored the basics. Thanks Guy Matz. On Monday, October 6, 2014 12:06:32 PM UTC-5, skr...@gmail.com wrote: > > I am trying to come up with a play book to install cassandra. Here each > node has a calculated token (not a random hash) and is unique. So,

[ansible-project] 'command with_items creates' syntax

2014-10-06 Thread Todd Sampson
I'm trying to generate pgp keys. Can't find anything with Ansible to do it so I'm using Linux commands. If the keys are already generated, I don't want them to be generated again. So, I need to use 'creates'. I found this site: https://u.osu.edu/hasnan.1/2013/12/16/ansible-run-multiple-com

Re: [ansible-project] How do I shuffle/randomize long lists of hosts please?

2014-10-06 Thread Eric Wedaa
YES! I'll even beta test the darn thing, that's how important this is to us :-) Of course, now I need to learn while loops... >>Ericw On Monday, October 6, 2014 1:05:46 PM UTC-4, Brian Coca wrote: > > So I'v been thinking of a new play parameter for a while, sort:, which > will sor

Re: [ansible-project] How access dictionary in a jinja2 template?

2014-10-06 Thread Guy Matz
Perhaps I'm not understanding what you're after, but this worked for me: initial_token: {{ tokens[inventory_hostname] }} On Mon, Oct 6, 2014 at 1:06 PM, wrote: > I am trying to come up with a play book to install cassandra. Here each > node has a calculated token (not a random hash) and is uniq

[ansible-project] shell commands and escaping characters

2014-10-06 Thread Peter Palmieri
I'm pulling data from EC2 instance metadata (from an IAM instance profile). The shell commands are: curl http://169.254.169.254/latest/meta-data/iam/security-credentials/PullCredentials > creds.txt access=`cat /home/ubuntu/creds.txt | grep "AccessKeyId" | cut -d':' -f2 | tr -d ' '

[ansible-project] ignore_errors does not take variable

2014-10-06 Thread Yasir Saleem
Hi, I was trying to use ignore_errors to take a variable, but it fails. Here is example play for ignore error not working: - hosts: jump remote_user: deploy gather_facts: yes tasks: - set_fact: test_err=yes - debug: var=test_err ignore_errors: "{{ test_err }}" output was:

[ansible-project] How access dictionary in a jinja2 template?

2014-10-06 Thread skr989
I am trying to come up with a play book to install cassandra. Here each node has a calculated token (not a random hash) and is unique. So, I have defined a dictionary in the vars/cassandra_variables.yml as below. The IPs 192.168.56.x happen to be the ansible_inventory hosts which are defined in

Re: [ansible-project] How do I shuffle/randomize long lists of hosts please?

2014-10-06 Thread Brian Coca
So I'v been thinking of a new play parameter for a while, sort:, which will sort the host selection according to inventory(default)|r_inventory|alpha|r_alpha|numeric|r_numeric|random This would sort hosts for processing depending on this parameter. -- Brian Coca Stultorum infinitus est numerus

Re: [ansible-project] How do I shuffle/randomize long lists of hosts please?

2014-10-06 Thread Eric Wedaa
We can have multiple VMs on a blade, for instance MANY guests on an esxi blade, or multiple LPARs on a p-blade. Each of these VMs don't consume a lot of CPU/Networking. We have tested 100 VMs on a single blade successfully. Not that they were doing a lot, but were available. Reality is more

Re: [ansible-project] Reading a JSON file, adding to it and then saving it

2014-10-06 Thread Mark McCoy
Rather than doing this in a single logstash config file, I would suggest using a templated version of this file. For every log file that you want logstash to monitor, you can drop a separate file into /etc/logstash/conf.d/ and it will pick them all up (if you are using the default setting for logst

Re: [ansible-project] Outputting stdout/stderr as it comes in

2014-10-06 Thread Wes Hayutin
Hey Mike! Hope all is well, wondering if there any updates on outputting stdout/stderr ? Thanks! On Thursday, 4 July 2013 08:03:38 UTC-4, Michael DeHaan wrote: > > Async mode could be upgraded to capture intermediate stdout/stderr as it > comes in, possibly. > > I don't want this done for non-a

[ansible-project] Re: How to have each node get a different variable from an array

2014-10-06 Thread skr989
Hello, Replying to an old thread but this is relevant to what I am trying to do. I have defined the tokens as a dictionary in the vars_file as below. tokens: 192.168.56.1: 0 192.168.56.2: 56713727820156410577229101238628035242 192.168.56.3: 113427455640312821154458202477256070485 192.16

[ansible-project] Docker issues

2014-10-06 Thread techblog
Hello, I'm running into issues with the docker module on ansible 1.7.2 (I also tried to 1.8). I'm trying to use docker on a VM I have provisioned in EC2. The relevant part of my playbook looks like this: - hosts: daas_daas_management user: ec2-user sudo: yes tasks: - name: Install doc

Re: [ansible-project] Outputting stdout/stderr as it comes in

2014-10-06 Thread Wes Hayutin
nvrmind.. I see your comments in another thread.. and you pointed to http://docs.ansible.com/playbooks_async.html thanks On Thursday, 4 July 2013 08:03:38 UTC-4, Michael DeHaan wrote: > > Async mode could be upgraded to capture intermediate stdout/stderr as it > comes in, possibly. > > I don't

Re: [ansible-project] GovCloud on EC2

2014-10-06 Thread James Cammarata
Hi Sam, We recently added this region to the list supported for the common AWS code, so it will be included in Ansible 1.8. Which file are you editing for the AWS_REGIONS? It is possible that some of the modules are still using a hard-coded list rather than the common code. On Fri, Oct 3, 2014 a

Re: [ansible-project] Module Copy-Does not handle sparse files properly

2014-10-06 Thread Eric Wedaa
I just think a note needs to be made in the documentation about it, and call it good. >>Ericw On Monday, October 6, 2014 8:30:35 AM UTC-4, Michael DeHaan wrote: > > Yeah I don't think we need to add specific sparse file handling to Ansible. > > Ansible basically does a scp/sftp, so if those tool

Re: [ansible-project] Are extra_vars accessible in plugins?

2014-10-06 Thread Michael DeHaan
Inventory scripts are different from say, lookup plugins and action plugins. Inventory plugins get executed outside of variable processing and cannot get these things, but can read environment variables and the like. On Mon, Oct 6, 2014 at 10:02 AM, Guy Matz wrote: > Hi! Anyone know if it's

[ansible-project] Are extra_vars accessible in plugins?

2014-10-06 Thread Guy Matz
Hi! Anyone know if it's possible to access extra_vars from a plugin? For example, let's say I wanted to write an ec2 inventory plugin that could grab hosts for all regions, or as specified in an extra_vars variable . . . Thanks a lot, Guy -- You received this message because you are subscribed

Re: [ansible-project] issues with yum

2014-10-06 Thread Dmitry Sukhodoyev
I trying to install several packages from local machine, which missed in any repos. Obviously my code will not work, so which is correct way to do it without setting up my own repos? May be is there a way to prepare second list with pathnames and extensions from file_packages list by ansible to

Re: [ansible-project] How can I do multiple tests within a single when: statement

2014-10-06 Thread Michael DeHaan
Jinja2 basically uses mostly-like-Python comparisons, so it's a lot simpler. And this is what the "when" in Ansible uses to evaluate statements. We try to not overwhelm folks with all of the Jinja2, in fact, overuse of Jinja2 in Ansible playbooks is something of a problem in user-land. Rather, t

Re: [ansible-project] How do I shuffle/randomize long lists of hosts please?

2014-10-06 Thread Michael DeHaan
"Changing the setting to random and the fork value to 40 gives me a reasonable chance that all 40 forks will be more or less equally distributed. With more than 40 blades, it's a good bet only one fork per blade" So this seems to imply you have more than one VM running on a given blade (and not t

Re: [ansible-project] Whether to reopen issue.

2014-10-06 Thread Michael DeHaan
It's uncertain if we are going to cut a 1.7.3 release at this time. When/if we do, we typically backport issues from the devel branch that make sense. On Mon, Oct 6, 2014 at 7:05 AM, Joseph Price wrote: > Howdy! > > I opened an issue for a behaviour change between 1.7.1 & 1.7.2: > https://git

Re: [ansible-project] Module Copy-Does not handle sparse files properly

2014-10-06 Thread Michael DeHaan
Yeah I don't think we need to add specific sparse file handling to Ansible. Ansible basically does a scp/sftp, so if those tools understand sparse files, it may be a matter of passing a flag or something, and we'd be open to patches for something like that I guess, if it were automatically detecta

Re: [ansible-project] ansible 1.7.2 with multiline variables using the copy mod's 'content' directive

2014-10-06 Thread Michael DeHaan
I'm not positive it's going away, but you can use conditionals in a template, technically, if that helps you out. On Sun, Oct 5, 2014 at 7:41 PM, Alexandr Kurilin wrote: > Assuming copy content goes away, is there any way to simplify the template > module? Right now if I want to copy a PEM cer

Re: [ansible-project] issues with yum

2014-10-06 Thread Michael DeHaan
Using "with_items" with yum will result in it joining package names with a "," and grouping things into one transaction. As such, when you use "with_items", you can't concatenate strings in the parameter name yum: name={{ item }} state=installed with_items: package_list Assuming you're using a p

[ansible-project] Whether to reopen issue.

2014-10-06 Thread Joseph Price
Howdy! I opened an issue for a behaviour change between 1.7.1 & 1.7.2: https://github.com/ansible/ansible/issues/9171 I'm pretty sure it's fixed in devel though I seem to have confused myself with git bisect trying to figure out why. My question is whether you would like this issue reopened in

[ansible-project] Reading a JSON file, adding to it and then saving it

2014-10-06 Thread Mark Gavalda
Hi, I'm trying to add lines to the Logstash Forwarder config file, which looks like this right now: { "network": { "servers": [ "1.2.3.4:5000" ], "timeout": 15, "ssl ca": "/etc/pki/tls/certs/logstash-forwarder.crt" }, "files": [ { "paths": [ "/logs/access.log"

[ansible-project] issues with yum

2014-10-06 Thread Dmitry Sukhodoyev
hello. where is my mistake? yumtest: --- - hosts: test vars: generic_pkg_extension: "rpm" generic_temp_dir: "/var/tmp" file_packages: - "daemontools-0.76-112memphis.x86_64" - "libevent-1.4.13-500.el6.x86_64" - "nginx-1.2.8-2.el6.x86_64" tasks: - name: "uploading packages fr