Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Adds the ability to rename objects in Zabbix
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
Currently the only way to rename resources using the Ansible modules is to delete the resource under the old name and recreate it under the new name, despite that the Zabbix API supports renaming these types of resources.
The UID for these resources from the API's point of view is a number, not the name. As that's not very user friendly, when I wrote the modules, I use the resource name and the host/template name to lookup the ID. Unfortunately, the side effect of this is if you try to rename a resource, the module will try to create a duplicate resource with the new name
I've been using the above work around of deleting and recreating, but that has its own unfortunate side-effect that you lose the historical data
This PR adds a new_name parameter like below:
In this example, the module lookup the itemid for a Zabbix item with the name
agent_ping
in the templateexample_template
. It will then set the name field for the item with the id tonew_agent_ping