Issue 1:
- name: debug
debug: msg="{{ [1,2,3]|reject('odd') }}"

Issue Type:

Can you help us out in labelling this by telling us what kind of ticket this this? You can say “Bug Report”, “Feature Idea”, “Feature Pull Request”, “New Module Pull Request”, “Bugfix Pull Request”, “Documentation Report”, or “Docs Pull Request”.

Ansible Version:

Let us know what version of Ansible you are using. Please supply the verbatim output from running “ansible --version”. If you're filing a ticket on a version of Ansible which is not the latest, we'd greatly appreciate it if you could retest on the latest version first. We don't expect you to test against the development branch most of the time, but we may ask for that if you have cycles. Thanks!

Environment:

What OS are you running Ansible from and what OS are you managing? Examples include RHEL 5/6, Centos 5/6, Ubuntu 12.04/13.10, *BSD, Solaris. If this is a generic feature request or it doesn’t apply, just say “N/A”. Not all tickets may be about operating system related things and we understand that.

Summary:

Please summarize your request in this space. You will earn bonus points for being succinct, but please add enough detail so we can understand the request. Thanks!

Steps To Reproduce:

If this is a bug ticket, please enter the steps you use to reproduce the problem in the space below. If this is a feature request, please enter the steps you would use to use the feature. If an example playbook is useful, please include a short reproducer inline, indented by four spaces. If a longer one is necessary, linking to one uploaded to gist.github.com would be great. Much appreciated!

Expected Results:

Please enter your expected results in this space. When running the steps supplied above in the previous section, what did you expect to happen? If showing example output, please indent your output by four spaces so it will render correctly in GitHub's viewer thingy.

Actual Results:

Please enter your actual results in this space. When running the steps supplied above, what actually happened? If you are showing example output, please indent your output by four spaces so it will render correctly in GitHub. Thanks again!

Issue 2:
Issue Type:

Bug Report

Ansible Version:

ansible 1.8 (devel)

Environment:

Ubuntu 12.04

Summary:

Some jinja filters (select_attr among others) return generators. It seems currently impossible to loop over these in playbooks. (also tested on ansible 1.6.3)

Steps To Reproduce:

run the following playbook

---
- hosts: 127.0.0.1
connection: local
vars:
stuff:
- my_attr: true
msg: 'pick me!'
- my_attr: true
msg: 'pick me too!'
- my_attr: false
msg: 'but do not pick me ...'
tasks:
# this works ...
- command: /bin/echo {{ item.msg }}
when: item.my_attr
with_items: stuff

# ... this works (note the explicit creation of a list) ...
- command: /bin/echo {{ item.msg }}
with_items: stuff|selectattr("my_attr")|list

# ... this doesn't (but it would be nice if it would ...)
- command: /bin/echo {{ item.msg }}
with_items: stuff|selectattr("my_attr")

Expected Results:

all tasks doing the same thing (echoing the first two messages)

Actual Results:

The third task fails with the the following error message:

fatal: [127.0.0.1] => One or more undefined variables: 'unicode object' has no attribute 'msg'