Excerpts from Michael DeHaan's message of 2014-08-20 08:51:01 -0400:
> With a simple list, you can do stuff like:
>
> - shell: echo {{ item }}
> with_items: alist_that_may_be_undefined | default([])
I'm fairly sure this works also:
- shell: echo {{ item }}
with_subelements:
- some_
Excerpts from Tiglath's message of 2014-08-12 23:08:48 -0400:
> Is the verbatim name still available (in another variable?) after assigning
> a value to ansible_ssh_host ?
'inventory_hostname' should always refer to the primary name in the
hosts file.
--
Morgan Hamill
--
You received this messa
Excerpts from AJ Daws's message of 2014-08-08 17:30:33 -0400:
> Michael, no need to apologize, you've already helped a lot, thank you!
>
> One thing that would really help here and is general enough I'm sure it
> would find use elsewhere as well is to have the template module capable of
> outp
Excerpts from Michael DeHaan's message of 2014-07-30 07:51:22 -0400:
> The general situation is that change detection on a tree of 5000 files
> would be remarkably slow. People think they want that, they do not.
Just though I'd point out that there is a pull request for this:
https://github.com/a
Excerpts from Steffen Prince's message of 2014-07-25 03:24:19 -0400:
> Pros and cons of module argument syntax styles?
>
> INI style
>
> - module: >
> key1=val1
> key2=val2
> key3=val3
> key4=val4
>
>
> yaml style
>
> - module:
> key1: val1
> key2: val2
> k
Excerpts from Michael DeHaan's message of 2014-07-18 09:21:53 -0400:
> The lookup plugin will return empty string, not None, if that env is not
> found.
>
> However that is still False in Python. That's curious and may be related
> to how "default" is implemented. Will have to try that.
Jinja
Excerpts from Michael DeHaan's message of 2014-07-15 11:37:33 -0400:
> Can you share more about what the proposed syntax might be for this flag
> (such as an example playbook line?)
That's actually where I run into trouble; the filesystem module's
arguments and their semantics don't leave a lot of
I have need of this.
Should I add this ability to the existing `filesystem` module, or do
folks think it ought to be a separate module?
--
Morgan
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receivi
Excerpts from Dmitry Makovey's message of 2014-07-08 18:49:22 -0400:
> Hi everybody,
>
> http://docs.ansible.com/playbooks_tags.html mentions several ways to use
> tags, one of which is:
>
> - { role: A, tags: [t1, t2] }
This doesn't do what you think it does. It applies tags 't1' and 't2'
to
Excerpts from Oliver Heinz's message of 2014-06-13 04:58:32 -0400:
> But there is no smart way to decide which tasks to run based on facts -
> just because the YAML syntax checker raises an error because a variable is
> not defined (yet) and thus a play that is perfectly valid at runtime is
> co
Excerpts from James Cammarata's message of 2014-06-07 21:14:41 -0400:
> We are planning on doing this at some point in the (hopefully near) future,
> for both yum and apt.
Not entirely on-topic, but it's a "thing" of mine:
Thank you all *so much* for having functioning distribution packages
from
This was submitted quite a while ago, perhaps it could be merged?
--
Morgan Hamill
--
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...
Excerpts from Dmitry Makovey's message of 2014-06-04 18:17:04 -0400:
> Winning combination turned out to be:
>
> ( groups['A']+groups['B'] ) | unique
>
> I do like how simple it looks vs
>
> ( groups['A']|union (groups['B']))| unique
Just FYI, the 'unique filter in the latter form is redundant
For what it's worth, I simply follow this rule: if data needs to be
accessed from outside a role, then it should go in inventory somewhere
(e.g., group_vars/foo or group_vars/all/foo).
My 2ยข.
--
Morgan Hamill
--
You received this message because you are subscribed to the Google Groups
"Ansible
Excerpts from Brian Coca's message of 2014-04-30 10:49:17 -0400:
> "{{ lookup('file', 'keys/ssh.' + item.username + '.pub') }}"
I'd add that, in the general case, you'll want to do:
{{ lookup('file', 'keys/ssh.' ~ item.username ~'.pub') }}
Using the tilde concatenation operator casts values
Not positive if this will work, but try:
Excerpts from Kesten Broughton's message of 2014-04-24 10:06:13 -0400:
> template.yml
> {{ parentvar.childvar.subvar1 }}
> {{ parentvar.childvar.get('subvar2', 'default for subvar2') }}
--
Morgan Hamill
--
You received this message because you are subscri
Excerpts from Bryan Larsen's message of 2014-04-02 08:42:55 -0400:
> The problem with this is that Redis often rewrites its configuration files;
> for example when a new master is elected.
I haven't actually used Ansible to set up Redis, but I have run into
software that does this, and I would no
Excerpts from Adam Bozanich's message of 2014-03-31 21:50:25 -0400:
> I had wanted to be able to pass an entire dict by name into a role, but
> apparently that isn't possible.
I *believe* recent versions of Ansible will allow:
- { role: my role, myrolevars: "{{ some_dict_defined_elsewhere }}
Excerpts from Matt Coddington's message of 2014-03-25 14:15:18 -0400:
> > > {% for host in groups['uat4-webapp']|sort %}
> > > BalancerMember ajp://{{ hostvars[host].webapp_ip }}:8009 loadfactor=20
> > > {% endfor %}
> > >
> > > The "webapp_ip" variable is calculated like this in a group_vars file:
Excerpts from Matt Coddington's message of 2014-03-24 22:58:50 -0400:
> Using Ansible 1.5.3
>
> I'm having some trouble with a situation where I have a variable that I'd
> like to use in a template that uses "hostvars" but the variable in question
> is calculated from facts.
>
> I have a template
Excerpts from Philippe Eveque's message of 2014-03-19 12:14:31 -0400:
> lineinfile: >
> dest=/etc/hosts.deny
> state=present
> regexp="^ALL:\s+ALL"
> line="ALL: ALL"
Thought I'd add how I handle this:
lineinfile:
dest: /etc/host.deny
state: present
regexp:
Excerpts from Adam Heath's message of 2014-02-05 13:24:48 -0500:
> root@urk:~# apt-file search bin/a2x
> asciidoc: /usr/bin/a2x
>
> And "yum search asciidoc" comes up with results.
>
> Does rpm.spec have a way to list a series of build dependencies? I'm a
> Debian guy, and that would be done th
Excerpts from Michael DeHaan's message of 2014-01-29 09:48:25 -0500:
> Technically, Ursula LeGuinn used it first -- though I still haven't read
> that particular book from her just yet.
Ahh, right, I forgot that she got to it first.
> I am quite a fan of Ender's game though, and that's what I nam
Excerpts from Michael DeHaan's message of 2014-01-28 21:08:17 -0500:
> When we started the company, Ansible wasn't quite available, so we named
> the company AnsibleWorks. We've finally arranged things so it was possible
> to change that, and have done so,and we're pretty excited about being able
Excerpts from BrianAI's message of 2013-12-03 06:08:08 -0500:
> Yes, that much I knew / figured after reading and experimenting.
>
> So other that using that as a variable to call in the cron.yaml file
> (which I think you referred to as a messy hack), is there anyway to
> achieve the desired resu
Excerpts from Michael DeHaan's message of 2013-12-02 16:15:56 -0500:
> This is overkill btw.
>
> Just do type='dict' in the argument_spec, Ansible knows what to do and
> will take a dict or key=value strings inside the option.
Right, should have specified: the code I posted is what allows the
str
Third option, which I've done in a module for my own use: have an
"extra_yum_flags" option which can take a dictionary as an argument:
- yum:
state: installed
name: mypkg
extra_yum_flags:
foo: bar
bam: baz
red_hat: is an operating system
I
Excerpts from Michael DeHaan's message of 2013-12-01 08:56:27 -0500:
> "Okay, what about making ansible run any queued up handlers just before
> exiting, even if it exits due to an error condition in a playbook?"
>
> Yep, that's what I was thinking of this morning.
>
> I still think we *may* want
Michaels' answer is better in most cases, but there is another way which
I occasionally use for simple things. In a vars file, do:
foo: "{{ 'bar' if ansible_architecture == 'i386' else 'zoo' }}"
Only thing to watch out for is that the jinja2 expression must always
evaluate to *something*, so
Excerpts from Matt Jaynes's message of 2013-11-27 13:58:10 -0500:
> Been googling around for the idempotent memo you mentioned - anyone have a
> link? (or maybe it was a joke and I'm a little clueless?) :)
See, it's clear that this mailing list is not nearly idempotent enough!
It should be obviou
Excerpts from James Tanner's message of 2013-11-22 09:31:37 -0500:
> This already exists =)
>
> https://github.com/ansible/ansible/pull/4758
This is the best kind of surprise!
--
Morgan Hamill
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
Thanks so much for all the input, folks.
Excerpts from Serge van Ginderachter's message of 2013-11-21 14:24:15 -0500:
> Also at my current gig, playbooks and roles are very specific, and not
> something I would share as to specific. Once I'd write things I would want
> to share, I defiitely would
Howdy folks,
I was hoping to get some tips on how best to organize variables in
Ansible. Right now, I don't have hard-and-fast rules, but I'm generally
sticking to the following patterns:
* 'group_vars/all' contains any variables which I will need to access
over and over, such as domain-le
Serge's response is fine but I believe you can also just do:
> - { include: tasks/repo_server.yml, when: listen_ips }
Python lists have a truthiness of False when empty.
--
Morgan Hamill
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To un
34 matches
Mail list logo