Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

roles

ANSIBLE VERSION

2.4.2.0

OS / ENVIRONMENT

Mac OS X

SUMMARY

ansible role's dependency is called only once although it is called twice with defferent parameters.

STEPS TO REPRODUCE

roles/foo/meta/main.yml

---
dependencies:
- role: hello
name: "{{key}}"

roles/hello/tasks/main.yml

---
- debug:
var: name

playbook.yml

---
- hosts: localhost
roles:
- role: foo
key: foo
- role: foo
key: bar

EXPECTED RESULTS

When the playbook is run, the role hello is called twice because roles foo and hello are called twice with different parameters.

http://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html#role-duplication-and-execution

PLAY [localhost] *****************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************
ok: [localhost]

TASK [hello : debug] *************************************************************************************************************
ok: [localhost] => {
"name": "foo"
}

TASK [hello : debug] *************************************************************************************************************
ok: [localhost] => {
"name": "bar"
}

PLAY RECAP ***********************************************************************************************************************
localhost : ok=3 changed=0 unreachable=0 failed=0

ACTUAL RESULTS

The role hello is called only once.

PLAY [localhost] *****************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************
ok: [localhost]

TASK [hello : debug] *************************************************************************************************************
ok: [localhost] => {
"name": "foo"
}

PLAY RECAP ***********************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0

Issue 2:
os_stack will attempt an update if the stack is present. When it does the update HOT parameters are not applied.

ISSUE TYPE

Bug Report

COMPONENT NAME

os_stack

ANSIBLE VERSION

ansible 2.2.2.0
config file =
configured module search path = Default w/o overrides

SUMMARY

STEPS TO REPRODUCE

create a Heat Template (hot) yaml file with parameters

Run play to create stack

Run play again and

** if the parameter was mandatory you get a 400 bad request

** if the parameter has a default it will use this instead

- name: create stack
register: stack_create
os_stack:
name: test-stack
state: present
template: "../heat/teststack.yaml"
parameters:
default_net: 7acd9647-4b84-4edd-b618-123f6cb82c3f
server_flavor: m1.medium

heat_template_version: 2015-10-15

parameters:
server_flavor:
type: string
description: size of the server instances

default_net:
type: string
description: Id of default-net
default: 7acd9647-4b84-4edd-b618-123f6cb82c3f
...

EXPECTED RESULTS

Stack update with parameters

ACTUAL RESULTS

Debug shows the parameters, but they appear to be omitted from the API call. Below is 400 because there was no default for server_flavor

fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"api_timeout": null,
"auth": null,
"auth_type": null,
"availability_zone": null,
"cacert": null,
"cert": null,
"cloud": null,
"endpoint_type": "public",
"environment": null,
"key": null,
"name": "test-stack",
"parameters": {
"default_net": "7acd9647-4b84-4edd-b618-123f6cb82c3f",
"server_flavor": "m1.medium"
},
"region_name": null,
"rollback": false,
"state": "present",
"template": "../heat/teststack.yaml",
"timeout": 3600,
"verify": true,
"wait": true
},
"module_name": "os_stack"
},
"msg": "(400) Client Error: Bad Request

** if the parameter has a default it will use this instead

If server_flavour has the following the instances will resize

default: m1.small