Issue 1:
Issue Type:

Bug Report, Documentation Report

Ansible Version:

1.7.1

Environment:

N/A

Summary:

There appears to be a regression in the ability to set and override default arguments to modules requiring complex arguments.

According to https://github.com/ansible/ansible-examples/blob/master/language_features/complex_args.yml, we should be able to pass default parameters to modules. In fact, it shows an example of overriding the default fact locally, which no longer works either. Even in 1.7.0, adding an override (e.g. "ec2: region=us-west-1") results in the following error:

msg: duplicate parameter: region (value=us-west-1)

Steps To Reproduce:

The following works in 1.7.0, but not in 1.7.1, as shown by the output below:

# in file: test.yml
- hosts: localhost
connection: local
gather_facts: False
vars:
default:
region: us-east-1
instance_type: m3.medium
image: ami-d2ff23ba
tasks:
- name: Provision hosts
ec2:
args: default

Expected Results:

$ sudo pip install ansible==1.7.0
$ ansible-playbook test.yml

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

TASK: [Provision hosts] *******************************************************
changed: [127.0.0.1]

PLAY RECAP ********************************************************************
127.0.0.1 : ok=1 changed=1 unreachable=0 failed=0

Actual Results:

$ sudo pip install ansible==1.7.1
[...]
$ ap test.yml

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

TASK: [Provision hosts] *******************************************************
ERROR: args must be a dictionary, received default (<type 'str'>

Possibly related to #6244; see #6244 (comment)

Issue 2:
ISSUE TYPE

bug report

COMPONENT NAME

copy module

ANSIBLE VERSION

2.0.0.2

CONFIGURATION

forks = 15

roles_path = ./roles

host_key_checking = False

OS / ENVIRONMENT

Mac OS X 10.11.1 (15B42)

Python 2.7.10

SUMMARY

While trying to copy directories remotely on target machine from src=/srv/repo/ops/server/conf/ to dst=/srv/server/conf/ (both exist on remote machine) , using copy module with "remote_src=yes" flag, end up with error:

failed: [x.x.x.x] => (item={u'dstfile': u'/srv/server/conf/', u'srcfile': u'/srv/repo/ops/server/conf/'}) => {"failed": true, "invocation": {"module_args": {"backup": false, "content": null, "delimiter": null, "dest": "/srv/server/conf/", "directory_mode": null, "follow": false, "force": true, "group": null, "mode": null, "original_basename": null, "owner": null, "regexp": null, "remote_src": true, "selevel": null, "serole": null, "setype": null, "seuser": null, "src": "/srv/repo/ops/server/conf/", "validate": null}}, "item": {"dstfile": "/srv/server/conf/", "srcfile": "/srv/repo/ops/server/conf/"}, "msg": "attempted to take checksum of directory: /srv/repo/ops/server/conf/"}

STEPS TO REPRODUCE

Create directories on remote machine using ansible file module :

src dir : /srv/repo/ops/server/conf/ // put some test files here

dst dir: /srv/server/conf/

Try to copy content from src to dst using copy module with remote_src=1, example:

- name: Copy config files for services
copy: src={{ item.srcfile }} dest={{ item.dstfile }} remote_src=yes
with_items:
- { srcfile: "/srv/repo/ops/server/conf/", dstfile: "/srv/server/conf/" }

EXPECTED RESULTS

Content from /srv/repo/ops/server/conf/ should be propagated to /srv/server/conf/

ACTUAL RESULTS

failed with below error:

failed: [x.x.x.x] => (item={u'dstfile': u'/srv/server/conf/', u'srcfile': u'/srv/repo/ops/server/conf/'}) => {"failed": true, "invocation": {"module_args": {"backup": false, "content": null, "delimiter": null, "dest": "/srv/server/conf/", "directory_mode": null, "follow": false, "force": true, "group": null, "mode": null, "original_basename": null, "owner": null, "regexp": null, "remote_src": true, "selevel": null, "serole": null, "setype": null, "seuser": null, "src": "/srv/repo/ops/server/conf/", "validate": null}}, "item": {"dstfile": "/srv/server/conf/", "srcfile": "/srv/repo/ops/server/conf/"}, "msg": "attempted to take checksum of directory: /srv/repo/ops/server/conf/"}

Copied from original issue: ansible/ansible-modules-core#2875