-
Notifications
You must be signed in to change notification settings - Fork 218
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
Rename devices and other entities #215
Comments
Let me think about how we can accomplish this. Do you find yourself needing to change device names, etc. often? I'm wondering if we can add a "new_name" sort of thing to modules to act upon to find the existing device/item and then update the name. What other endpoints do you find yourself doing this on? |
We recycle bare metal devices very often.
I don't see other endpoints so far. Maybe Inventory Items. As HDDs may be mounted with another purpose. In my eyes a "key" selector (default is the current setting "name") for every module would be great:
this would set name, device_type, device_role, stage where an asset_tag is given or it would create an entry. The fact would have to be gathered first obviously - and the fact should be unique. Another possibility would be mass updates:
This would require a new state, that would not create an item if none exists. |
I think I like the idea of the If I think that should work for changing the name, but let me prototype this and then I'll submit a PR and have you test it. |
@monkz I submitted PR #222 for this. Do you mind testing it. The error message provided if an invalid query is provided is cryptic. I did add a new method to validate the |
Ok, i created a full device inventory with your change - works. During next week we will have such a rename event. So i'll test the ability to track devices on a serial in a production environment. |
Test in production environment will delay for another week. |
Well - scratch the delay. It works as expected. @FragmentedPacket Thanks a lot! |
Thanks for testing! |
so based on this I can rename a device as follows ?
`` |
yes |
ISSUE TYPE
SOFTWARE VERSIONS
Ansible:
ansible 2.9.9
Netbox:
(v2.8.4)
Collection:
0.2.1
SUMMARY
It is not possible to rename a device.
This collection uses the name of an entity as identification. So on every rename (aka. destroy and create) the device loses the changelog.
I would like to identify the device by asset tag (which is also unique) or another unique attribute to rename a device and keep the changelog.
The text was updated successfully, but these errors were encountered: