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
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:
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
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:
-
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
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
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
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
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
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
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
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.
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
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
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
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
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.
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
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
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
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
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
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
23 matches
Mail list logo