diff --git a/plugins/doc_fragments/vultr.py b/plugins/doc_fragments/vultr.py index cb5cfb6..e9d911e 100644 --- a/plugins/doc_fragments/vultr.py +++ b/plugins/doc_fragments/vultr.py @@ -3,6 +3,7 @@ # Copyright (c) 2017 René Moser # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function + __metaclass__ = type @@ -54,5 +55,11 @@ class ModuleDocFragment(object): requirements: - python >= 2.6 notes: - - Also see the API documentation on https://www.vultr.com/api/. + - Also see the API documentation on https://www.vultr.com/api/v1/. + +deprecated: + removed_in: 2.0.0 + why: This module uses the deprecated Vultr v1 API. + alternative: Please use the vultr.cloud collection instead. + ''' diff --git a/plugins/module_utils/vultr.py b/plugins/module_utils/vultr.py index 81e7b62..74b3908 100644 --- a/plugins/module_utils/vultr.py +++ b/plugins/module_utils/vultr.py @@ -3,17 +3,18 @@ # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function + __metaclass__ = type import os -import time import random +import time import urllib + +from ansible.module_utils._text import to_native, to_text from ansible.module_utils.six.moves import configparser -from ansible.module_utils._text import to_text, to_native from ansible.module_utils.urls import fetch_url - VULTR_API_ENDPOINT = "https://api.vultr.com" VULTR_USER_AGENT = 'Ansible Vultr' @@ -40,6 +41,14 @@ def __init__(self, module, namespace): collection_name='ngine_io.vultr', version='2.0.0') # Was Ansbile 2.11 + module.deprecate( + msg="This module is deprecated, it uses the deprecated Vultr v1 API. " + "Please switch to the modules in collection vultr.cloud as soon as possible. " + "Also see https://galaxy.ansible.com/vultr/cloud.", + collection_name="ngine_io.vultr", + version="2.0.0" + ) + self.module = module # Namespace use for returns