default collection support (#61415)

* default collection support

* playbooks run from inside a registered collection will set that collection as the first item in the search order (as will all non-collection roles)
* this allows easy migration of runme.sh style playbook/role integration tests to collections without the playbooks/roles needing to know the name of their enclosing collection

* ignore bogus sanity error

* filed #61460

* fixed task unit test failure

* don't append an empty collections list to the ds

* ignore leftover local_action in mod_args ds action parsing

* fix async_extra_data test to not require ssh and bogus locale

* disable default collection test under Windows

* ensure collection location FS code is always bytes

* add changelog
This commit is contained in:
Matt Davis
2019-08-28 16:31:40 -07:00
committed by GitHub
parent caa5abdfc9
commit 7d1a981b61
22 changed files with 278 additions and 64 deletions
@@ -1,4 +1 @@
needs/ssh
shippable/posix/group3
skip/freebsd
skip/osx
@@ -1 +0,0 @@
localhost ansible_connection=ssh ansible_python_interpreter="{{ ansible_playbook_python }}"
@@ -0,0 +1,15 @@
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
def main():
print("junk_before_module_output")
print(json.dumps(dict(changed=False, source='user')))
print("junk_after_module_output")
if __name__ == '__main__':
main()
@@ -2,8 +2,6 @@
set -eux
# Verify that extra data before module JSON output during async call is ignored.
ANSIBLE_DEBUG=0 LC_ALL=bogus ansible-playbook test_async.yml -i inventory -v "$@"
# Verify that the warning exists by examining debug output.
ANSIBLE_DEBUG=1 LC_ALL=bogus ansible-playbook test_async.yml -i inventory -v "$@" \
| grep 'bash: warning: setlocale: LC_ALL: cannot change locale (bogus)' > /dev/null
# Verify that extra data before module JSON output during async call is ignored, and that the warning exists.
ANSIBLE_DEBUG=0 ansible-playbook -i ../../inventory test_async.yml -v "$@" \
| grep 'junk after the JSON data: junk_after_module_output'
@@ -1,9 +1,9 @@
- hosts: localhost
- hosts: testhost
gather_facts: false
tasks:
# make sure non-JSON data before module output is ignored
- name: async ping with invalid locale via ssh
ping:
- name: async ping wrapped in extra junk
junkping:
async: 10
poll: 1
register: result