Try {{ item|int +1 }}
K
On 04/02/2014 5:58 AM, edrozenb...@gmail.com wrote:
Hello,
In certain cases it's useful to be able to add a number to the value of an
{{ item }} variable
For example when creating md (raid) devices, md0 for example is made up of
partitions sda1 and sdb1.
Hi Guillem.
This looks like a modeling problem: the project variables need to be
detached from the host/group variables.
Try something like:
# group_vars/all.yml
---
project:
test1:
domain: test1.com
#... other vars for project test1
test2:
domain: test2.com
# ...
try the YAML '' escaping mechanism (
http://yaml.org/spec/current.html#id2503232):
lineinfile:
dest={{deploy_root}}/{{instance}}/{{project}}/{{project}}/local_settings.py
regexp='^NAME'
line=NAME: {{db_name}},
The lines following the '' to be interpreted as a scalar and not a
Hi Peter,
The CR released version you mentioned is for version 5.3p1-94. I Just did a
quick google search and I believe you need a version 5.6 or better to get
ControlPersist, unless RedHat backports the feature. The 94 at the end of
the version suggests package has been modified at least 93
I use single-host roles for a couple of hosts. Sometimes a role only makes
sense if only one host has it at a time. I also find this useful when I
have to upgrade a whole server: I can build an test the new hardware using
the role (with a couple of key bits turned off), then cut over once I'm
exactly what the
differences are without having to infer it from a collection of examples.
On Tuesday, January 7, 2014 2:32:48 PM UTC-6, Kahlil Hodgson wrote:
Looks like you want to look up a package version by package name:
## Vars file
version_for_package:
foo: 1.1.19-1
bar: 3.11.0-6
I've never tried this but I would think you could just use the hosts
option in the the parent playbook?
Something like:
- hosts: all
roles:
- generate_groups # generates group1, group2, etc
- hosts: group1
roles:
- do_something_with_a_group
Otherwise you might try:
- hosts: all
. By all
means, do not use a hammer. -- IBM maintenance manual, 1925
On Thu, Jan 2, 2014 at 8:23 PM, Anand Buddhdev arh...@gmail.com wrote:
On Thursday, 2 January 2014 00:48:22 UTC+1, Kahlil Hodgson wrote:
Hi again Kahlil,
I branched my ansible setup, and patched jinja2 with the commit from
be a reason. By all
means, do not use a hammer. -- IBM maintenance manual, 1925
On Thu, Jan 2, 2014 at 10:48 AM, Kahlil Hodgson
kahlil.hodg...@dealmax.com.au wrote:
Hi Anand,
Looking at the documentation again, it seems I misinterpreted: i did
not realise that 'none' is a jinja test
:00 UTC+1, Kahlil Hodgson wrote:
There will be cleaner ways to do this once jinja2.7 becomes more
readily available, but for now you could probably simulate the above
loop with 'with_items' and a 'when' conditional:
tasks:
- name: ipv6 link local
debug: msg={{ item.address }}
when: item.scope
There will be cleaner ways to do this once jinja2.7 becomes more
readily available, but for now you could probably simulate the above
loop with 'with_items' and a 'when' conditional:
tasks:
- name: ipv6 link local
debug: msg={{ item.address }}
when: item.scope == 'link'
On 21 December 2013 02:29, RafaĆ Hajduk bleb...@gmail.com wrote:
What I understand as deployment is:
1. Upload new version of code (specified git branch) to /{timestamp}/
2. Replace current .htaccess with Deny from all
3. Change symlink /current/ to timestamp
4. Perfrom all SQL queries that
that in TEST2 that the jinja2 filter gets applied BEFORE the
ansible variable substitution,
but it appears that in TEST1 the jinja2 filter comes after, or is not being
applied somehow.
Peculiar.
kesten
On Tuesday, December 10, 2013 4:03:51 PM UTC-6, Kahlil Hodgson wrote:
On 11 December
How about
---
# assuming non-system user ids start at 500
- name: grab existing users for this host
shell: cat /etc/passwd | perl -ne -F: 'print $F[0] if $F[1] 499'
register: users
- name: lock unknown users
user: name={{ item }} password='!'
when: item not in known_users
with_items:
On 9 December 2013 07:18, Kahlil Hodgson kahlil.hodg...@dealmax.com.au wrote:
perl -ne -F: 'print $F[0] if $F[1] 499'
Oops, missing '-a' in perl oneliner. That should be
perl -ane -F: 'print $F[0] if $F[1] 499'
K
--
You received this message because you are subscribed to the Google
On 9 December 2013 07:22, Kahlil Hodgson kahlil.hodg...@dealmax.com.au wrote:
perl -ane -F: 'print $F[0] if $F[1] 499'
Arghhh! Not enough coffee. Got my index's wrong too. I should be
perl -ane -F: 'print $F[0],\n if $F[2] 499'
There is an open pull request for a 'capture' jinja
Serge's suggestion is more elegant, but if you are paranoid, you can
also add an early check to a task list:
---
- fail: msg=Don't accidentally run this on my mailserver
when: inventory_hostname == 'mailserver'
- ... other tasks
just in case you inadvertently include the task list without
, Kahlil Hodgson
kahlil.hodg...@dealmax.com.au wrote:
I wonder if merging could be handled explicitly with a jinja filter,
say, something like:
mysql: prod_mysql | merge(default_mysql)
That way the merging would be explicit and encapsulated in the playbook.
Kahlil (Kal) Hodgson
. Therefore,
if you can't get them together again, there must be a reason. By all
means, do not use a hammer. -- IBM maintenance manual, 1925
On 6 December 2013 18:18, Kahlil Hodgson kahlil.hodg...@dealmax.com.au wrote:
Er maybe?
Checkout my quick implementation at
https://github.com
Something like:
- name: temporary f-secure install script
copy: src=relative/path/to/local/f-secure-linux-security-9.20.2520
dest=/tmp/f-secure-linux-security-9.20.2520
- name: run f-secure installer
command: /tmp/f-secure-linux-security-9.20.2520 --command-line-only
--another-option
Awesome tip! Much better than the quotation hell that I've been using :-)
when 'frontendcluster1' in group_names
K
Kahlil (Kal) Hodgson GPG: C9A02289
Head of Technology (m) +61 (0) 4 2573 0382
DealMax Pty Ltd(w) +61 (0)
21 matches
Mail list logo