Re: [ansible-project] Extract IPv6 link-local address from facts

2013-12-30 Thread Anand Buddhdev
Hi Kahlil, Thank you for this tip. It works! So you mentioned that with Jinja 2.7 this is easier. I already have Jinja 2.7.1. What feature of this version can I use to avoid this hack? Regards, Anand On Monday, 30 December 2013 00:49:00 UTC+1, Kahlil Hodgson wrote: There will be cleaner

Re: [ansible-project] Error while adding variables and comparing them with another variable in 'when'

2013-12-30 Thread boochi shiva
Hi, Created a generic playbook to reproduce the error Playbook: --- - hosts: local gather_facts: false vars: a: '0' b: '0' c: '0' tasks: - name: echo 1 command: echo 1 register: a - name: echo 2 command:

[ansible-project] Non-idempotence on template - reports changed each time - perhaps a problem with md5sum

2013-12-30 Thread Christian Jensen
I am having a small problem. I am running Vagrant and am writing out a small configuration file using a template. Each time I run it, the result shows changed. I looked at the source to see what might get me to that point and all I could see is that the md5 might be different... except each

[ansible-project] Error while evaluating conditional with and

2013-12-30 Thread Joost Cassee
Hi, This is probably a very silly mistake on my part, but I cannot seem to get con-/disjunctions working in when statements. See this setup: hosts: --- localhost --- playbook.yml: --- --- - hosts: localhost gather_facts: no connection: local vars: - a: yes b: yes tasks: -

Re: [ansible-project] List of Ansible default variables

2013-12-30 Thread Matt Martz
Here are the ones that I can recall and easily find in the source: vars always_run changed_when delegate_to failed_when ignore_errors inventory_dir playbook_dir register The vars variable, is a dictionary, that contains all of the above vars as key/value pairs. inventory_file

Re: [ansible-project] Error while evaluating conditional with and

2013-12-30 Thread Matt Martz
The problem is with the way you set your 'vars' up.  You probably want: vars:     a: yes     b: yes Starting a line with a '-' tells it that you are defining a list.  However in this specific case, it just ignores the definition of 'b'.  So due to your vars not actually being defined you get

Re: [ansible-project] Non-idempotence on template - reports changed each time - perhaps a problem with md5sum

2013-12-30 Thread Michael DeHaan
Yep, the template module is definitely reporting changed correctly, because we would have heard about this 1000x over by now if it were not :) --Michael On Mon, Dec 30, 2013 at 9:20 AM, Matt Martz m...@sivel.net wrote: It may be helpful to see the rest of your play, however, I ran into an

Re: [ansible-project] Error while evaluating conditional with and

2013-12-30 Thread Michael DeHaan
when in doubt, the debug statement is useful! - debug: var=a - debug: var=b On Mon, Dec 30, 2013 at 10:39 AM, Matt Martz m...@sivel.net wrote: The problem is with the way you set your 'vars' up. You probably want: vars: a: yes b: yes Starting a line with a '-' tells it that

Re: [ansible-project] List of Ansible default variables

2013-12-30 Thread Michael DeHaan
Matt's answer above is slightly incorrect. Things like always_run and such are keywords, not variables that are usable in scripts. http://ansibleworks.com/docs/playbooks_variables.html#magic-variables-and-how-to-access-information-about-other-hosts (The statement about their being other

Re: [ansible-project] What's the correct way to reboot a server?

2013-12-30 Thread Michael DeHaan
wait_for has a delay parameter so you can wait a given number of seconds before checking for port uptime. This is generally what I'd suggest. On Sun, Dec 29, 2013 at 10:49 AM, Geoff Oakham g.goo...@mbl.ca wrote: Hi everyone, I'm new to Ansible and I've been exploring it with Vagrant to

[ansible-project] Have some free time? How about trying out some roles on Galaxy and rating them?

2013-12-30 Thread Michael DeHaan
http://galaxy.ansibleworks.com/ Galaxy is designed to surface the best roles by having a comprehensive system of ratings and reviews. I think right now people haven't had a lot of time to dig in, but perhaps you would like to review a few roles? https://galaxy.ansibleworks.com/explore From each

[ansible-project] Re: playbook is pending when I execute reboot command. How to avoid the pending?

2013-12-30 Thread Mathias Bogaert
Here's how I do it: https://github.com/analytically/hadoop-ansible/blob/master/roles/2_aggregated_links/tasks/main.yml On Sunday, 29 December 2013 14:16:59 UTC, @volanja wrote: Hi Rella. Please refer to it. It is old thread that talking about reboot.

Re: [ansible-project] Atomic deployments

2013-12-30 Thread Stan Lemon
Which is more preferable, local_action or delegate_to then - does it matter at all? With regards to sudo... I'm sure this is a noob question... but right now I've been running my play books with the sudo flag, but the local operations I did not want to run with sudo, ergo the sudo:false. I

Re: [ansible-project] Atomic deployments

2013-12-30 Thread Michael DeHaan
The issue is that if you have a play that runs across 50 hosts and you delegate 50 steps to localhost they will all use a different timestamp because it was told to register 50 different versions of that variable. -e to Ansible is the --extra-vars flag. ansible-playbook foo.yml -e

Re: [ansible-project] Atomic deployments

2013-12-30 Thread Stan Lemon
A, that makes sense!  That’s a great suggestion, thank you! On December 30, 2013 at 5:45:33 PM, Michael DeHaan (mich...@ansibleworks.com) wrote: The issue is that if you have a play that runs across 50 hosts and you delegate 50 steps to localhost they will all use a different timestamp

Re: [ansible-project] Atomic deployments

2013-12-30 Thread Brian Coca
I normally have 3 plays for my deployment playbook. - hosts: localhost tasks: - notify start (mail/jabber/irc) - checkout from repo - generate unique ids for release (git rev-parse --short HEAD) - build stuff - create deployment package And then a deploy play: - hosts: targets

Re: [ansible-project] Variables and ec2 deployments

2013-12-30 Thread Greg Andrews
Peter Gehres wrote: For instances launched in EC2-Classic, a private IP address is associated with the instance until it is stopped or terminated. Notice stopped and terminated are listed, but rebooted is not. I have rebooted EC2-Classic instances and not lost the private/public addresses.

[ansible-project] symlinks vs directories

2013-12-30 Thread David Reagan
I have a task that creates a directory. On one server, that directory already exists, but is a symlink. So ansible says the task failed when it runs. The message: msg: refusing to convert between link and directory for None. Is there a way to tell ansible that a symlink is ok for that task? Or

[ansible-project] public service announcement to digital ocean users

2013-12-30 Thread Michael DeHaan
This is not explicitly Ansible related (we'll be making a code change because of it) but is worth sharing as I know there are a lot of Digital Ocean users out there who may have not seen this report: https://digitalocean.com/blog_posts/transparency-regarding-data-security It turns out digital

[ansible-project] Re: symlinks vs directories

2013-12-30 Thread David Reagan
With some help from IRC, I ended up checking for the paths with the stat module. Sadly, the only way that worked was to make 2 tasks per path. Glad I only had a few to check... On Monday, December 30, 2013 3:47:08 PM UTC-8, David Reagan wrote: I have a task that creates a directory. On one

[ansible-project] Re: public service announcement to digital ocean users

2013-12-30 Thread Michael DeHaan
I've applied a change in Ansible at 99616d0c80b0b11211a1ed8fba160af7f79e9409 and hope to see a change in dopy as well. Meanwhile, I'd welcome feedback about whether this warrants continued inclusion in Ansible, as I do view inclusion on the cloud sidebar as something close to advocacy, and simply

Re: [ansible-project] Bug - RDS ansible module cannot change security_group if rds instance within VPC

2013-12-30 Thread Mohan Krishnan
Don't mean to bug (pun intended) - but I am pretty keen on getting a fix for this in. What do you think would be the best way forward ? If you feel the concern I raise is not really valid, I am fine creating a pull request for a diff that solely supresses any subnet value when doing a

Re: [ansible-project] Extract IPv6 link-local address from facts

2013-12-30 Thread Kahlil Hodgson
Glad that helps. In Jinja2.7 you have the following filters that can be used to traverse or extract parts of lists: select selectattr reject rejectattr map so I believe that following would work {{ ansible_em1.ipv6 | selectattr('scope', 'local') | first | attr('address') }} just off the top