-
Notifications
You must be signed in to change notification settings - Fork 251
Enhancement: Added option to not prepend group names with group_by option #147
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
Enhancement: Added option to not prepend group names with group_by option #147
Conversation
@smolz @DouglasHeriot @TawR1024 @Yannis100 Can I get feedback from y'all on this change? |
Thanks for asking! |
My concern with this is that without the prefixes, all the slugs share the same namespace. However I can't think of any concrete examples where this will create an issue (ie. a manufacturer with the same name as a site) As long as there's an option to turn it on/off I think this is ok. I think in our usage of this we might leave the prefixes on as the verbosity helps when reading configurations to understand what's happening. And when running The group names "manufacturers_apple" and "platforms_apple_ios" are a lot clearer than "apple" and "apple_ios" - I can much more easily explain to colleages where to find this thing in netbox. Another thought - there's no reason that both sets of groups couldn't co-exist. Could help people transition, but would also increase confusion. |
We use the group names to build up a genders file - and with the roles prefixed, that file gets ugly quite fast. as for the '-' to '_', ansible is being stupid in my mind.. I'd like a flag to keep them not converted (we already do the ansible.cfg flag to turn off the warning) |
Alright. It seems like keeping the way it does it now should stay long term (forever) and adding the new option would also stick around and not replace the current method. I will also remove any data manipulation when it comes to changing from a dash to underscore as Ansible provides the config option to ignore the warnings. @Yannis100 Do you mind providing me an example of the shortening? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this gets everyone what they want. As long as I have the option to disable the prepending of the group name I am happy.
You can find it in this branch of my fork |
@Yannis100 I have to say thanks for your fork - I've been using your inventory for a little while and am now working on moving some features (the ones I need at least) into this project. I'll be doing regions next... |
Fixes #138
Added
group_names_raw
to provide the group name slug rather than prepending with the group_by option.e.g. Before
e.g. After
This also replaces any dash in the slug to an underscore since Ansible will be enforcing that moving from 2.10+. I'm open to keeping it as just returning the slug so please discuss what you guys think is the best approach.