Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

ec2_group integration test

ANSIBLE VERSION

2.5

CONFIGURATION

N/A

OS / ENVIRONMENT

Shippable

SUMMARY

Unstable integration test ec2_group:

https://app.shippable.com/github/ansible/ansible/runs/54397/66/tests

STEPS TO REPRODUCE

Run test on Shippable.

EXPECTED RESULTS

Tests pass.

ACTUAL RESULTS

Tests are unstable or fail.

test/integration/targets/ec2_group/tasks/main.yml:908 / [localhost] amazon: ec2_group : assert that rule descriptions were modified (expected changed=true) that=[u'result.changed', u'result.ip_permissions_egress|length == 1']

failure: rc=0

{
"assertion": "result.ip_permissions_egress|length == 1",
"changed": false,
"evaluated_to": false,
"failed": true
}

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

core

ANSIBLE VERSION

ansible 2.1.0.0 (detached HEAD 5954a82dd6) last updated 2016/05/16 15:32:52 (GMT +300)
lib/ansible/modules/core: (detached HEAD ce79e7c72d) last updated 2016/05/14 22:47:32 (GMT +300)
lib/ansible/modules/extras: (detached HEAD 156a8cd0b3) last updated 2016/05/14 22:47:32 (GMT +300)
config file = /Users/hkariti/repo/bigpanda/playbooks/ansible.cfg
configured module search path = ['library']

CONFIGURATION

no_cows=True

OS / ENVIRONMENT

N/A

SUMMARY

Suppose we have a role with variables in the vars/ dir and that also includes other tasks files from tasks/.

When passing argument to roles the following can happen:

If the role is used directly, the passed value is used correctly.

If the role is a dependency to another role, and the variable is passed to the second role, the variable will be overridden in main.yml, but not on any included files.

Any other calls to the second role with different parameters will not run, as they are detected as duplicated runs.

STEPS TO REPRODUCE

roles/parent/vars/main.yml:

myvar: default

roles/parent/tasks/main.yml:

- name: from main
debug: var=myvar

- include: other.yml

roles/parent/tasks/other.yml:

- name: from include
debug: var=myvar

roles/child1/meta/main.yml:

dependencies:
- { role: parent, myvar: child_override }

roles/child2/meta/main.yml:

dependencies:
- { role: parent }

cases.yml:

- hosts: localhost
roles:
# These work as intended:
# - { role: parent, myvar: play_override } # Case 1
# - child1 # Case 1 again, now used directly as dependency
# These don't work:
- { role: child2, myvar: play_override } # Case 2, var is overriden outside include only
- { role: child2, myvar: play_override2} # Case 3, won't run at all

EXPECTED RESULTS

TASK [parent : from main] ******************************************************
ok: [localhost] => {
"myvar": "play_override"
}

TASK [parent : myvar in include] ***********************************************
ok: [localhost] => {
"myvar": "play_override"
}

TASK [parent : from main] ******************************************************
ok: [localhost] => {
"myvar": "play_override2"
}

TASK [parent : myvar in include] ***********************************************
ok: [localhost] => {
"myvar": "play_override2"
}

ACTUAL RESULTS

TASK [parent : from main] ******************************************************
ok: [localhost] => {
"myvar": "play_override"
}

TASK [parent : myvar in include] ***********************************************
ok: [localhost] => {
"myvar": "default"
}