Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix collection adjacent loading with --playbook-dir #56194

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
6 participants
@bcoca
Copy link
Member

commented May 7, 2019

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

collections

@AlanCoding

This comment has been minimized.

Copy link
Member

commented May 7, 2019

ansible-inventory -i my_inventory.yml --list --export --playbook-dir=.
{
    "_meta": {
        "hostvars": {
            "my_host": {}
        }
    },
    "all": {
        "children": [
            "ungrouped"
        ]
    },
    "ungrouped": {
        "hosts": [
            "my_host"
        ]
    }
}

with https://github.com/chrismeyersfsu/ansible-examples/tree/master/collections_hello_world

failed with devel

@AlanCoding

This comment has been minimized.

Copy link
Member

commented May 7, 2019

To be clear, since there is not yet a documented reference behavior on github:

ansible-inventory -i my_inventory.yml --list --export --playbook-dir=.
 [WARNING]:  * Failed to parse /Users/alancoding/Documents/repos/ansible-examples/collections_hello_world/my_inventory.yml with auto plugin: inventory config
'/Users/alancoding/Documents/repos/ansible-examples/collections_hello_world/my_inventory.yml' specifies unknown plugin 'redhat.cmeyers.my_inventory'

 [WARNING]:  * Failed to parse /Users/alancoding/Documents/repos/ansible-examples/collections_hello_world/my_inventory.yml with yaml plugin: Plugin configuration YAML file, not YAML
inventory

 [WARNING]:  * Failed to parse /Users/alancoding/Documents/repos/ansible-examples/collections_hello_world/my_inventory.yml with ini plugin: Invalid host pattern 'plugin:' supplied,
ending in ':' is not allowed, this character is reserved to provide a port.

 [WARNING]: Unable to parse /Users/alancoding/Documents/repos/ansible-examples/collections_hello_world/my_inventory.yml as an inventory source

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

{
    "_meta": {
        "hostvars": {}
    },
    "all": {
        "children": [
            "ungrouped"
        ]
    }
}

Using env ANSIBLE_COLLECTIONS_PATHS=collections/ fixed it in devel, but this is so that we don't have to use that.

@kdelee

This comment has been minimized.

Copy link

commented May 10, 2019

@bcoca hoping to get this backported for 2.8.1 whenever that rolls around

@samdoran
Copy link
Member

left a comment

Can you add tests to prevent future regressions?

bcoca added some commits May 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.