Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

Inventory

ANSIBLE VERSION

$ ansible-playbook --version
ansible-playbook 2.4.0.0
config file = /home/shrews/.ansible.cfg
configured module search path = ['/home/shrews/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/shrews/Devel/git/openstack-infra/zuul/.tox/py35/lib/python3.6/site-packages/ansible
executable location = /home/shrews/Devel/git/openstack-infra/zuul/.tox/py35/bin/ansible-playbook
python version = 3.6.2 (default, Aug 11 2017, 11:59:59) [GCC 7.1.1 20170622 (Red Hat 7.1.1-3)]

CONFIGURATION

$ ansible-config dump --only-changed
[DEPRECATION WARNING]: [defaults]hostfile option, The key is misleading as it can also be a list of hosts, a directory or a list of paths . This feature will be removed in version 2.8. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.

Set hostsfile to a hosts.yaml file.

OS / ENVIRONMENT

Fedora 26

SUMMARY

Behavior of 'all' (at least in a YAML host inventory file) seems to have changed.

STEPS TO REPRODUCE

hosts.yaml:

all:
hosts:
controller:
ansible_host: localhost
ansible_connection: local
localhost:
ansible_connection: local

Example playbook:

---
- hosts: all
name: Foo
tasks:
- name: Bar
shell: |
echo "Hello World"

EXPECTED RESULTS

Expected results (generated from Ansible 2.3):

$ ansible-playbook ~/a.yaml

PLAY [Foo] *********************************************************************

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

TASK [Bar] *********************************************************************
changed: [controller]
changed: [localhost]

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

ACTUAL RESULTS

$ ansible-playbook -vvv ~/a.yaml
ansible-playbook 2.4.0.0
config file = /home/shrews/.ansible.cfg
configured module search path = ['/home/shrews/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/shrews/Devel/git/openstack-infra/zuul/.tox/py35/lib/python3.6/site-packages/ansible
executable location = /home/shrews/Devel/git/openstack-infra/zuul/.tox/py35/bin/ansible-playbook
python version = 3.6.2 (default, Aug 11 2017, 11:59:59) [GCC 7.1.1 20170622 (Red Hat 7.1.1-3)]
Using /home/shrews/.ansible.cfg as config file
[DEPRECATION WARNING]: [defaults]hostfile option, The key is misleading as it can also be a list of hosts, a directory or a list of paths . This feature will be removed in version 2.8. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

[WARNING]: No inventory was parsed, only implicit localhost is available

[WARNING]: Could not match supplied host pattern, ignoring: all

[WARNING]: provided hosts list is empty, only localhost is available

PLAYBOOK: a.yaml *****************************************************************************************************************************************************************************************************************
1 plays in /home/shrews/a.yaml

PLAY [Foo] ***********************************************************************************************************************************************************************************************************************
skipping: no hosts matched

PLAY RECAP ***************************************************************************************************

Issue 2:
ISSUE TYPE

B ug Report

Docs Report

COMPONENT NAME

import_playbook

ANSIBLE VERSION

ansible 2.3.2.0
config file = /home/foo/.ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.13 (default, May 8 2017, 12:47:14) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]

CONFIGURATION

Bog standard. Set inventory path.

OS / ENVIRONMENT

RHEL6

SUMMARY

The documentation at (http://docs.ansible.com/ansible/latest/playbooks_reuse_includes.html) for import_playbook shows what seems to be invalid YAML.

---
import_playbook: webservers.yml
import_playbook: databases.yml

Sure enough, trying a simple example like this fails, with:

[WARNING]: While constructing a mapping from /data0/tenadarts/ansible/playbooks/configure.yml, line 2, column 1, found a duplicate dict key (import_playbook). Using last defined value only.

Followed by,

ERROR! playbooks must be a list of plays

STEPS TO REPRODUCE

Create two playbooks, test1.yml and test2.yml

---
- hosts: linux
tasks:
- ping: {}

Create a playbook, pb.yml

---
import_playbook: test1.yml
import_playbook: test2.yml

Run:

ansible-playbook pb.yml

This results in the ERROR! Playbooks must be a list of plays above.

Trying to guess at the required structure, I also tried:

---
- import_playbook: test1.yml
- import_playbook: test2.yml

This yields: ERROR! 'import_playbook' is not a valid attribute for a Play

EXPECTED RESULTS

The two playbooks are imported then executed.

ACTUAL RESULTS

Various syntax errors.