GithubHelp home page GithubHelp logo

Comments (8)

fboender avatar fboender commented on July 24, 2024

Hey Sebastian!

I've implemented a host expansion algorithm. It supports numbers ([1:3]), letters ([a:z]) and zero-padding ([01:03]). It also supports multiple patterns in a hostname, though I'm not sure if Ansible even supports that.

Can you verify that this new change fixes your problem? The change has been committed to the master branch, so you'll have to checkout the git repository. If you don't know how to do this, please let me know which method (package) your using to install Ansible-cmdb and I'll whip up a package for you.

Thanks for the bugreport!

Regards,

Ferry

from ansible-cmdb.

fboender avatar fboender commented on July 24, 2024

Never mind that testing request. I'm reimplementing the host parsing so it'll also do group vars and such. Testing the current implementation would be pointless, since it's changing anyway.

from ansible-cmdb.

rndmh3ro avatar rndmh3ro commented on July 24, 2024

This sounds even better, as this would have been my next feature request!

from ansible-cmdb.

fboender avatar fboender commented on July 24, 2024

I can't find in the manual how variable precedence works. Would you happen to know? For example, if I have:

[prod]
db01
db02 ansible_ssh_port=8022

[prod:vars]
ansible_ssh_port=6022

Would db02 get a port of 8022 or 6022? I'm assuming more specific definitions override more generic ones (so it would be 8022), but assumption is the mother of you-know-what.

Would you happen to know?

from ansible-cmdb.

rndmh3ro avatar rndmh3ro commented on July 24, 2024

Here's the documentation:
https://docs.ansible.com/ansible/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable

Remember: Child groups override parent groups, and hosts always override their groups.

Your particular case isn't mentioned, but I jsut tested it with this:

[prod]
localhost ansible_connection=ssh ansible_ssh_user=vagrant

[prod:vars]
ansible_connection=ssh ansible_ssh_user=root

The first variable ansible_ssh_user (vagrant) is used, because it is a host-var. When swapping vagrant with root, root is used.
The second var is a group var which has a lower precedence.

EDIT: some more older, unoffical docu:

from ansible-cmdb.

fboender avatar fboender commented on July 24, 2024

Then they way I implemented it is correct. Thanks for that info!

I've committed a rewrite of the hosts parsing logic to the master branch. It now supports groups of groups and vars groups. I had to fake some data for testing as I don't have an extensive enough hosts definition at my disposal.

Could you test it to see if it works for you?

from ansible-cmdb.

rndmh3ro avatar rndmh3ro commented on July 24, 2024

I just tested it from master-branch and its working! All hosts are displayed!

from ansible-cmdb.

fboender avatar fboender commented on July 24, 2024

Awesome Sebastian! Thanks for testing it, and thanks for your help!

from ansible-cmdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.