Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

azure_rm_deployment

ANSIBLE VERSION

2.3.1.0

CONFIGURATION

nope

OS / ENVIRONMENT

macOS Sierra

SUMMARY

The azure_rm_resourcegroup module deletes the tags of the Resource Group it is deployed to.

STEPS TO REPRODUCE

Download the example ARM templates to the local ansible directory.

Run the following playbook.

- name: Create infra
hosts: localhost
gather_facts: False

tasks:

- name: Create resource group
azure_rm_resourcegroup:
name: foobar
location: westeurope
tags:
team: myteam
tier: mytier
register: reg_rg

#
# after this task the tags *do* exist on the Resource Group
#

- name: Deploy Docker registry
azure_rm_deployment:
deployment_name: registry
resource_group_name: '{{ reg_rg.state.name }}'
location: '{{ reg_rg.state.location }}'
template: "{{ lookup('file', './azuredeploy.json') }}"
parameters: "{{ lookup('file', './azuredeploy.parameters.json') }}"
wait_for_deployment_completion: False

#
# after this task they *don't*
#

EXPECTED RESULTS

The tags already present on the Resource Group are persisted.

ACTUAL RESULTS

All tags are deleted.

The output of the azure_rm_deployment task shows:

azure_rm_resourcegroup task

"invocation": {
"module_args": {
...
"tags": {
"team": "myteam",
"tier": "mytier"
}

azure_rm_deployment task

"invocation": {
"module_args": {
...
"resource_group_name": "foobar",
"tags": null

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

package

ANSIBLE VERSION

ansible 2.3.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.13 (default, May 10 2017, 20:04:28) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)]

CONFIGURATION

No special configs in the scope of this bug.

OS / ENVIRONMENT

Ansible is ran from Fedora 25/26, managing hosts on Fedora 25/26 and Debian.

SUMMARY

When I used Ansible 2.2 I used group_vars to have common software package lists which I then used with the module 'package' to install them on RPM and DEB based systems. That way I didn't have to duplicate any package lists for the modules 'dnf' and 'apt' and also didn't have to administrate separate lists.

Now since 2.3 this has changed. It now checks these packages one-by-one when using these vars with the 'with_items' iteration function. I think this commit is responsible for this new behavior. This kind of makes the 'package' module unfit now to be used as a universal module for all supported package managers... Please revert this change and fix whatever problems the expansion of variables creates, because disabling a feature isn't a fix in my opinion (nor a feature).

STEPS TO REPRODUCE

Create a group_var for a role and include e.g. the following.

ansible_dependencies_fedora:
- python-dnf
- libselinux-python
- libsemanage-python
- policycoreutils-python

Then use this variable in the appropriate role and expand it with the 'with_items' function within the 'package' module.

- name: install ansible dependencies
package: name={{ item }} state=present
with_items:
- "{{ ansible_dependencies_fedora }}"
when: ansible_distribution == "Fedora"
tags:
- setup_ansible
- install_packages

EXPECTED RESULTS

In Ansible 2.2 this worked fine and this is desirable because the advantage of using variable expansion with a universal module for package management is to use a single set of packages for multiple systems with different package dependency solvers.

ACTUAL RESULTS

It iterates the items one-by-one instead of treating the expansion as one entire set of items. It's working fine when e.g. using the module 'dnf', but of course stating the explicit module for every package dependency solver results in duplication of this list. Which defeats the purpose of having a universal package module.

I've reverted the change of commit c005ae3 manually on my system. Now everything works again as expected, please make this work again as it did in Ansible 2.2!