aabouzaid / netbox-as-ansible-inventory

Ansible dynamic inventory script for Netbox.
GNU General Public License v3.0
173 stars 54 forks source link

Add specific custom field parsing as ansible groups #5

Closed Atoms closed 6 years ago

Atoms commented 7 years ago

In netbox add custom field ansible_groups fill in as comma seperated value, and each string is ansible_group.

aabouzaid commented 7 years ago

@Atoms Could you please clarify the purpose of this PR? What is its goal and what it should achieve?

Thanks.

Atoms commented 7 years ago

So if you want to add more groups to server, as we use server with groups such as service and many more, so if someone needs additional multiple groups for host, then create ansible_groups custom field in netbox and add there comma seperated groups for host.

aabouzaid commented 7 years ago

Aha, got it.

Even I'd like to see it as Netbox feature (Enable free-form, searchable, labeling/tagging of devices #132), but it's not there yet.

Anyway, I think a better way to do that instead hard coding it, let' use the conf file to to make it more flexible.

e.g.

netbox:
    main:
        custom_groups:
            key: ansible_groups
            separator: ","
rthomson commented 6 years ago

I'm also interested in exactly this functionality and agree that it would be best implemented in netbox itself with either free-form tagging on any level of object, tag fields or multi-select fields.

A custom field separator, defined in the config file would be useful but perhaps duplicate effort if netbox implements tags relatively soon.

madkiss commented 6 years ago

Folks, what is the current status of this? :)

Atoms commented 6 years ago

From my side no status updates, as it's not merged, we already maintain own tree with very specific additions and so on. so if @AAbouZaid is not merging this i would close this. and i see that this is already behind actual version

aabouzaid commented 6 years ago

I will do some changes and back to it, since it seems Netbox project is not going to make it soon.

Atoms commented 6 years ago

seems noone cares, so closing PR

aabouzaid commented 6 years ago

Since now Netbox already has free-form of labeling/tagging so no need for this workaround anymore. But anyways, thanks @Atoms for your effort :-)