Comments (8)
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.
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.
This sounds even better, as this would have been my next feature request!
from ansible-cmdb.
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.
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:
- https://github.com/cookrn/ansible_variable_precedence
- http://jpmens.net/2012/08/30/ansible-variables-variables-and-more-variables/
from ansible-cmdb.
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.
I just tested it from master-branch and its working! All hosts are displayed!
from ansible-cmdb.
Awesome Sebastian! Thanks for testing it, and thanks for your help!
from ansible-cmdb.
Related Issues (20)
- Is it possible to add additional & custom columns to the CSV template? HOT 2
- Comments must be stripped before calling shlex.split
- ModuleNotFoundError: No module named 'ansiblecmdb' HOT 2
- New column: public IP address HOT 1
- [html_fancy_split] Unable to sort custom column by mixed type "string"/ "num" AND how to custom template html_fancy_split HOT 9
- CSV import feature to manage inventory and host_vars easily HOT 1
- CSV export feature for easy reporting HOT 2
- kernel info to txt_table.tpl
- Ansible Tower Generated Json Output unable to generate report HOT 1
- No suitable python version found (v2.7 or higher required). Aborting HOT 4
- Template html fancy split is broken with Edge when excluding columns HOT 1
- Debian 11 can't use default template with ansible-cmdb 1.31 HOT 3
- F
- Markdown split doesn't work
- Does not get built with python-packaging 23.0
- [Question] Offline js libraries
- Using facts_cache for esx hosts is not working properly HOT 1
- Custom fact using command output HOT 1
- python 3.12: imp is deprecated in favor of importlib HOT 1
- bug using cmdb inside container ee
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-cmdb.