Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

pause

ANSIBLE VERSION

ansible 2.5.0 (devel ca115b0a8e) last updated 2017/10/25 09:12:08 (GMT -400)
config file = /home/rteague/git/clusters/aws-c1/ansible.cfg
configured module search path = [u'/home/rteague/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /home/rteague/git/clusters/aws-c2/ansible/lib/ansible
executable location = /home/rteague/git/clusters/aws-c2/ansible/bin/ansible
python version = 2.7.13 (default, Sep 5 2017, 08:53:59) [GCC 7.1.1 20170622 (Red Hat 7.1.1-3)]

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

When using the pause module, the execution of the playbook will hang if running the playbook as a background process.

STEPS TO REPRODUCE

# test.yml
---
- name: Test Playbook
hosts: localhost
connection: local
gather_facts: false

tasks:
- pause:
seconds: 2

EXPECTED RESULTS

$ ansible-playbook -i localhost, test.yml > ansible-test.log &
[1] 31739

[1] + 31739 done ansible-playbook -i localhost, test.yml > ansible-test.log

ACTUAL RESULTS

$ ansible-playbook -i localhost, test.yml > ansible-test.log &
[1] 19407

[1] + 19407 suspended (tty output) ansible-playbook -i localhost, test.yml > ansible-test.log
$ tail ansible-test.log

PLAY [Test Playbook] ***************************************************************************************************************

TASK [pause] ***********************************************************************************************************************
Wednesday 25 October 2017 09:06:09 -0400 (0:00:00.062) 0:00:00.062 *****
Pausing for 2 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)

$ jobs
[1] + suspended (tty output) ansible-playbook -i localhost, test.yml > ansible-test.log

$ fg
[1] + 19407 continued ansible-playbook -i localhost, test.yml > ansible-test.log

$ tail ansible-test.log
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
ok: [localhost]

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

Wednesday 25 October 2017 09:08:11 -0400 (0:02:01.558) 0:02:01.620 *****
===============================================================================
pause --------------------------------------------------------------------------------------------------------------------- 121.56s
Playbook run took 0 days, 0 hours, 2 minutes, 1 seconds

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

copy module

ANSIBLE VERSION

ansible 2.4.2.0
config file = /opt/ansible/local/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible
python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

CONFIGURATION

OS / ENVIRONMENT

CentOS Linux release 7.4.1708 (Core)

SUMMARY

A copy task using with_items to copy both files and directories (recursively) to a given dest is causing the directory to be nested "within itself" somehow.

STEPS TO REPRODUCE

- name: copy a file and directory (with contents)
copy:
src: "{{ item }}"
dest: "/tmp/{{ item }}"
with_items:
- testfile
- testdir

EXPECTED RESULTS

Both testfile and testdir should be copied to the dest path. Contents of the directory should be copied recursively.

ACTUAL RESULTS

testfile gets copied OK. testdir gets copied to the destination as testdir/testdir.

# tree /tmp
/tmp
├── testdir
│ └── testdir
│ └── testfile2
└── testfile

Output of verbose log of the directory copy:

changed: [XXX] => (item=testdir) => {
"changed": true,
"checksum": "6d5bed3c88d0350e17b0049cc4e6d54445572e8c",
"dest": "/tmp/testdir/testdir/testfile2",
"diff": [],
"gid": 0,
"group": "root",
"invocation": {
"module_args": {
"attributes": null,
"backup": false,
"content": null,
"delimiter": null,
"dest": "/tmp/testdir/testdir/testfile2",
"directory_mode": null,
"follow": false,
"force": true,
"group": null,
"local_follow": null,
"mode": null,
"original_basename": "testdir/testfile2",
"owner": null,
"regexp": null,
"remote_src": null,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": "/root/.ansible/tmp/ansible-tmp-1519257514.0-81246969639144/source",
"unsafe_writes": null,
"validate": null
}
},
"item": "testdir",
"md5sum": "f38f27da8d7262b45996a2d5193f1e25",
"mode": "0644",
"owner": "root",
"secontext": "unconfined_u:object_r:admin_home_t:s0",
"size": 910,
"src": "/root/.ansible/tmp/ansible-tmp-1519257514.0-81246969639144/source",
"state": "file",
"uid": 0
}

In the above output, original_basename looks correct; however, dest seems malformed.