10000 AnsibleInventory does not support host_vars or group_vars with an extension · Issue #213 · nornir-automation/nornir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

AnsibleInventory does not support host_vars or group_vars with an extension #213

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

Closed
dmfigol opened this issue Jul 29, 2018 · 1 comment
Closed

Comments

@dmfigol
Copy link
Collaborator
dmfigol commented Jul 29, 2018

Currently AnsibleInventory expects host_vars or groups_vars files only without an extension:

    @staticmethod
    def read_vars_file(element: str, path: str, is_host: bool = True) -> VarsDict:
        subdir = "hosts_vars" if is_host else "group_vars"
        filepath = os.path.join(path, subdir, element)
        if not os.path.exists(filepath):

Even with present files host_vars/*.yml and group_vars/*.yml logs show an error:

2018-07-30 01:47:27,695 -       nornir -    DEBUG - read_vars_file() - AnsibleInventory: var file doesn't exist: host_vars/matrix-2
2018-07-30 01:47:27,695 -       nornir -    DEBUG - read_vars_file() - AnsibleInventory: var file doesn't exist: host_vars/matrix-3
2018-07-30 01:47:27,695 -       nornir -    DEBUG - read_vars_file() - AnsibleInventory: var file doesn't exist: host_vars/matrix-3
2018-07-30 01:47:27,695 -       nornir -    DEBUG - read_vars_file() - AnsibleInventory: var file doesn't exist: host_vars/matrix-4
2018-07-30 01:47:27,695 -       nornir -    DEBUG - read_vars_file() - AnsibleInventory: var file doesn't exist: host_vars/matrix-4

Working on a fix, will submit PR.

@dbarrosop
Copy link
Contributor

Fixed via #214

omershtivi pushed a commit to omershtivi/nornir that referenced this issue Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0