Renames Digital Ocean cloud _facts modules to _info (#57315)

Fixes: #57276
pull/57493/head
pratikgadiya12 5 years ago committed by Felix Fontein
parent bd48a7fb73
commit 72297db686

@ -0,0 +1,13 @@
minor_changes:
- The ``digital_ocean_account_facts`` module has been renamed to ``digital_ocean_account_info``.
- The ``digital_ocean_certificate_facts`` module has been renamed to ``digital_ocean_certificate_info``.
- The ``digital_ocean_domain_facts`` module has been renamed to ``digital_ocean_domain_info``.
- The ``digital_ocean_firewall_facts`` module has been renamed to ``digital_ocean_firewall_info``.
- The ``digital_ocean_floating_ip_facts`` module has been renamed to ``digital_ocean_floating_ip_info``.
- The ``digital_ocean_image_facts`` module has been renamed to ``digital_ocean_image_info``.
- The ``digital_ocean_load_balancer_facts`` module has been renamed to ``digital_ocean_load_balancer_info``.
- The ``digital_ocean_region_facts`` module has been renamed to ``digital_ocean_region_info``.
- The ``digital_ocean_size_facts`` module has been renamed to ``digital_ocean_size_info``.
- The ``digital_ocean_snapshot_facts`` module has been renamed to ``digital_ocean_snapshot_info``.
- The ``digital_ocean_tag_facts`` module has been renamed to ``digital_ocean_tag_info``.
- The ``digital_ocean_volume_facts`` module has been renamed to ``digital_ocean_volume_info``.

@ -79,6 +79,19 @@ Noteworthy module changes
* The ``memset_server_facts`` module was renamed to :ref:`memset_server_info <memset_server_info_module>`. * The ``memset_server_facts`` module was renamed to :ref:`memset_server_info <memset_server_info_module>`.
* The ``one_image_facts`` module was renamed to :ref:`one_image_info <one_image_info_module>`. * The ``one_image_facts`` module was renamed to :ref:`one_image_info <one_image_info_module>`.
* The ``azure_rm_resourcegroup_facts`` module was renamed to :ref:`azure_rm_aks_info <azure_rm_resourcegroup_info_module>`. * The ``azure_rm_resourcegroup_facts`` module was renamed to :ref:`azure_rm_aks_info <azure_rm_resourcegroup_info_module>`.
* The ``digital_ocean_account_facts`` module was renamed to :ref:`digital_ocean_account_info <digital_ocean_account_info_module>`.
* The ``digital_ocean_certificate_facts`` module was renamed to :ref:`digital_ocean_certificate_info <digital_ocean_certificate_info_module>`.
* The ``digital_ocean_domain_facts`` module was renamed to :ref:`digital_ocean_domain_info <digital_ocean_domain_info_module>`.
* The ``digital_ocean_firewall_facts`` module was renamed to :ref:`digital_ocean_firewall_info <digital_ocean_firewall_info_module>`.
* The ``digital_ocean_floating_ip_facts`` module was renamed to :ref:`digital_ocean_floating_ip_info <digital_ocean_floating_ip_info_module>`.
* The ``digital_ocean_image_facts`` module was renamed to :ref:`digital_ocean_image_info <digital_ocean_image_info_module>`.
* The ``digital_ocean_load_balancer_facts`` module was renamed to :ref:`digital_ocean_load_balancer_info <digital_ocean_load_balancer_info_module>`.
* The ``digital_ocean_region_facts`` module was renamed to :ref:`digital_ocean_region_info <digital_ocean_region_info_module>`.
* The ``digital_ocean_size_facts`` module was renamed to :ref:`digital_ocean_size_info <digital_ocean_size_info_module>`.
* The ``digital_ocean_snapshot_facts`` module was renamed to :ref:`digital_ocean_snapshot_info <digital_ocean_snapshot_info_module>`.
* The ``digital_ocean_tag_facts`` module was renamed to :ref:`digital_ocean_tag_info <digital_ocean_tag_info_module>`.
* The ``digital_ocean_volume_facts`` module was renamed to :ref:`digital_ocean_volume_info <digital_ocean_volume_info_module>`.
Plugins Plugins
======= =======

@ -17,10 +17,11 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_account_facts module: digital_ocean_account_info
short_description: Gather facts about DigitalOcean User account short_description: Gather information about DigitalOcean User account
description: description:
- This module can be used to gather facts about User account. - This module can be used to gather information about User account.
- This module was called C(digital_ocean_account_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
@ -32,15 +33,15 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about user account - name: Gather information about user account
digital_ocean_account_facts: digital_ocean_account_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
''' '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean account facts description: DigitalOcean account information
returned: success returned: success
type: dict type: dict
sample: { sample: {
@ -65,7 +66,7 @@ def core(module):
response = rest.get("account") response = rest.get("account")
if response.status_code != 200: if response.status_code != 200:
module.fail_json(msg="Failed to fetch 'account' facts due to error : %s" % response.json['message']) module.fail_json(msg="Failed to fetch 'account' information due to error : %s" % response.json['message'])
module.exit_json(changed=False, data=response.json["account"]) module.exit_json(changed=False, data=response.json["account"])
@ -73,6 +74,8 @@ def core(module):
def main(): def main():
argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() argument_spec = DigitalOceanHelper.digital_ocean_argument_spec()
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'digital_ocean_account_facts':
module.deprecate("The 'digital_ocean_account_facts' module has been renamed to 'digital_ocean_account_info'", version='2.13')
try: try:
core(module) core(module)
except Exception as e: except Exception as e:

@ -17,10 +17,11 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_certificate_facts module: digital_ocean_certificate_info
short_description: Gather facts about DigitalOcean certificates short_description: Gather information about DigitalOcean certificates
description: description:
- This module can be used to gather facts about DigitalOcean provided certificates. - This module can be used to gather information about DigitalOcean provided certificates.
- This module was called C(digital_ocean_certificate_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
options: options:
@ -35,17 +36,17 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all certificates - name: Gather information about all certificates
digital_ocean_certificate_facts: digital_ocean_certificate_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about certificate with given id - name: Gather information about certificate with given id
digital_ocean_certificate_facts: digital_ocean_certificate_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
certificate_id: "892071a0-bb95-49bc-8021-3afd67a210bf" certificate_id: "892071a0-bb95-49bc-8021-3afd67a210bf"
- name: Get not after facts about certificate - name: Get not after information about certificate
digital_ocean_certificate_facts: digital_ocean_certificate_info:
register: resp_out register: resp_out
- set_fact: - set_fact:
not_after_date: "{{ item.not_after }}" not_after_date: "{{ item.not_after }}"
@ -58,7 +59,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean certificate facts description: DigitalOcean certificate information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -104,6 +105,8 @@ def main():
certificate_id=dict(type='str', required=False), certificate_id=dict(type='str', required=False),
) )
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'digital_ocean_certificate_facts':
module.deprecate("The 'digital_ocean_certificate_facts' module has been renamed to 'digital_ocean_certificate_info'", version='2.13')
try: try:
core(module) core(module)

@ -17,16 +17,17 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_domain_facts module: digital_ocean_domain_info
short_description: Gather facts about DigitalOcean Domains short_description: Gather information about DigitalOcean Domains
description: description:
- This module can be used to gather facts about DigitalOcean provided Domains. - This module can be used to gather information about DigitalOcean provided Domains.
- This module was called C(digital_ocean_domain_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
options: options:
domain_name: domain_name:
description: description:
- Name of the domain to gather facts for. - Name of the domain to gather information for.
required: false required: false
requirements: requirements:
- "python >= 2.6" - "python >= 2.6"
@ -35,17 +36,17 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all domains - name: Gather information about all domains
digital_ocean_domain_facts: digital_ocean_domain_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about domain with given name - name: Gather information about domain with given name
digital_ocean_domain_facts: digital_ocean_domain_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
domain_name: "example.com" domain_name: "example.com"
- name: Get ttl from domain - name: Get ttl from domain
digital_ocean_domain_facts: digital_ocean_domain_info:
register: resp_out register: resp_out
- set_fact: - set_fact:
domain_ttl: "{{ item.ttl }}" domain_ttl: "{{ item.ttl }}"
@ -58,7 +59,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean Domain facts description: DigitalOcean Domain information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -129,6 +130,8 @@ def main():
domain_name=dict(type='str', required=False), domain_name=dict(type='str', required=False),
) )
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'digital_ocean_domain_facts':
module.deprecate("The 'digital_ocean_domain_facts' module has been renamed to 'digital_ocean_domain_info'", version='2.13')
try: try:
core(module) core(module)

@ -17,10 +17,11 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_firewall_facts module: digital_ocean_firewall_info
short_description: Gather facts about DigitalOcean firewalls short_description: Gather information about DigitalOcean firewalls
description: description:
- This module can be used to gather facts about DigitalOcean firewalls. - This module can be used to gather information about DigitalOcean firewalls.
- This module was called C(digital_ocean_firewall_facts) before Ansible 2.9. The usage did not change.
author: "Anthony Bond (@BondAnthony)" author: "Anthony Bond (@BondAnthony)"
version_added: "2.8" version_added: "2.8"
options: options:
@ -35,17 +36,17 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all firewalls - name: Gather information about all firewalls
digital_ocean_firewall_facts: digital_ocean_firewall_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about a specific firewall by name - name: Gather information about a specific firewall by name
digital_ocean_firewall_facts: digital_ocean_firewall_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
name: "firewall_name" name: "firewall_name"
- name: Gather information from a firewall rule - name: Gather information from a firewall rule
digital_ocean_firewall_facts: digital_ocean_firewall_info:
name: SSH name: SSH
register: resp_out register: resp_out
@ -59,7 +60,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean firewall facts description: DigitalOcean firewall information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -122,6 +123,8 @@ def main():
name=dict(type='str', required=False), name=dict(type='str', required=False),
) )
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'digital_ocean_firewall_facts':
module.deprecate("The 'digital_ocean_firewall_facts' module has been renamed to 'digital_ocean_firewall_info'", version='2.13')
try: try:
core(module) core(module)

@ -15,10 +15,11 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_floating_ip_facts module: digital_ocean_floating_ip_info
short_description: DigitalOcean Floating IPs facts short_description: DigitalOcean Floating IPs information
description: description:
- This module can be used to fetch DigitalOcean Floating IPs facts. - This module can be used to fetch DigitalOcean Floating IPs information.
- This module was called C(digital_ocean_floating_ip_facts) before Ansible 2.9. The usage did not change.
version_added: "2.5" version_added: "2.5"
author: "Patrick Marques (@pmarques)" author: "Patrick Marques (@pmarques)"
extends_documentation_fragment: digital_ocean.documentation extends_documentation_fragment: digital_ocean.documentation
@ -30,8 +31,8 @@ requirements:
EXAMPLES = ''' EXAMPLES = '''
- name: "Gather facts about all Floating IPs" - name: "Gather information about all Floating IPs"
digital_ocean_floating_ip_facts: digital_ocean_floating_ip_info:
register: result register: result
- name: "List of current floating ips" - name: "List of current floating ips"
@ -101,7 +102,7 @@ def core(module):
if status_code == 200: if status_code == 200:
module.exit_json(changed=False, floating_ips=floating_ips) module.exit_json(changed=False, floating_ips=floating_ips)
else: else:
module.fail_json(msg="Error fetching facts [{0}: {1}]".format( module.fail_json(msg="Error fetching information [{0}: {1}]".format(
status_code, response.json["message"])) status_code, response.json["message"]))
@ -109,6 +110,8 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=DigitalOceanHelper.digital_ocean_argument_spec() argument_spec=DigitalOceanHelper.digital_ocean_argument_spec()
) )
if module._name == 'digital_ocean_floating_ip_facts':
module.deprecate("The 'digital_ocean_floating_ip_facts' module has been renamed to 'digital_ocean_floating_ip_info'", version='2.13')
try: try:
core(module) core(module)

@ -17,21 +17,22 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_image_facts module: digital_ocean_image_info
short_description: Gather facts about DigitalOcean images short_description: Gather information about DigitalOcean images
description: description:
- This module can be used to gather facts about DigitalOcean provided images. - This module can be used to gather information about DigitalOcean provided images.
- These images can be either of type C(distribution), C(application) and C(private). - These images can be either of type C(distribution), C(application) and C(private).
- This module was called C(digital_ocean_image_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
options: options:
image_type: image_type:
description: description:
- Specifies the type of image facts to be retrived. - Specifies the type of image information to be retrived.
- If set to C(application), then facts are gathered related to all application images. - If set to C(application), then information are gathered related to all application images.
- If set to C(distribution), then facts are gathered related to all distribution images. - If set to C(distribution), then information are gathered related to all distribution images.
- If set to C(private), then facts are gathered related to all private images. - If set to C(private), then information are gathered related to all private images.
- If not set to any of above, then facts are gathered related to all images. - If not set to any of above, then information are gathered related to all images.
default: 'all' default: 'all'
choices: [ 'all', 'application', 'distribution', 'private' ] choices: [ 'all', 'application', 'distribution', 'private' ]
required: false required: false
@ -42,23 +43,23 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all images - name: Gather information about all images
digital_ocean_image_facts: digital_ocean_image_info:
image_type: all image_type: all
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about application images - name: Gather information about application images
digital_ocean_image_facts: digital_ocean_image_info:
image_type: application image_type: application
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about distribution images - name: Gather information about distribution images
digital_ocean_image_facts: digital_ocean_image_info:
image_type: distribution image_type: distribution
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Get distribution about image with slug coreos-beta - name: Get distribution about image with slug coreos-beta
digital_ocean_image_facts: digital_ocean_image_info:
register: resp_out register: resp_out
- set_fact: - set_fact:
distribution_name: "{{ item.distribution }}" distribution_name: "{{ item.distribution }}"
@ -72,7 +73,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean image facts description: DigitalOcean image information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -139,6 +140,8 @@ def main():
) )
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'digital_ocean_image_facts':
module.deprecate("The 'digital_ocean_image_facts' module has been renamed to 'digital_ocean_image_info'", version='2.13')
try: try:
core(module) core(module)

@ -17,10 +17,11 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_load_balancer_facts module: digital_ocean_load_balancer_info
short_description: Gather facts about DigitalOcean load balancers short_description: Gather information about DigitalOcean load balancers
description: description:
- This module can be used to gather facts about DigitalOcean provided load balancers. - This module can be used to gather information about DigitalOcean provided load balancers.
- This module was called C(digital_ocean_load_balancer_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
options: options:
@ -35,17 +36,17 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all load balancers - name: Gather information about all load balancers
digital_ocean_load_balancer_facts: digital_ocean_load_balancer_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about load balancer with given id - name: Gather information about load balancer with given id
digital_ocean_load_balancer_facts: digital_ocean_load_balancer_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
load_balancer_id: "4de7ac8b-495b-4884-9a69-1050c6793cd6" load_balancer_id: "4de7ac8b-495b-4884-9a69-1050c6793cd6"
- name: Get name from load balancer id - name: Get name from load balancer id
digital_ocean_load_balancer_facts: digital_ocean_load_balancer_info:
register: resp_out register: resp_out
- set_fact: - set_fact:
load_balancer_name: "{{ item.name }}" load_balancer_name: "{{ item.name }}"
@ -58,7 +59,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean Load balancer facts description: DigitalOcean Load balancer information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -106,6 +107,8 @@ def main():
load_balancer_id=dict(type='str', required=False), load_balancer_id=dict(type='str', required=False),
) )
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'digital_ocean_load_balancer_facts':
module.deprecate("The 'digital_ocean_load_balancer_facts' module has been renamed to 'digital_ocean_load_balancer_info'", version='2.13')
try: try:
core(module) core(module)

@ -17,10 +17,11 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_region_facts module: digital_ocean_region_info
short_description: Gather facts about DigitalOcean regions short_description: Gather information about DigitalOcean regions
description: description:
- This module can be used to gather facts about regions. - This module can be used to gather information about regions.
- This module was called C(digital_ocean_region_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
extends_documentation_fragment: digital_ocean.documentation extends_documentation_fragment: digital_ocean.documentation
@ -30,12 +31,12 @@ requirements:
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all regions - name: Gather information about all regions
digital_ocean_region_facts: digital_ocean_region_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Get Name of region where slug is known - name: Get Name of region where slug is known
digital_ocean_region_facts: digital_ocean_region_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
register: resp_out register: resp_out
- debug: var=resp_out - debug: var=resp_out
@ -50,7 +51,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean regions facts description: DigitalOcean regions information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -106,6 +107,8 @@ def core(module):
def main(): def main():
argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() argument_spec = DigitalOceanHelper.digital_ocean_argument_spec()
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'digital_ocean_region_facts':
module.deprecate("The 'digital_ocean_region_facts' module has been renamed to 'digital_ocean_region_info'", version='2.13')
try: try:
core(module) core(module)

@ -17,10 +17,11 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_size_facts module: digital_ocean_size_info
short_description: Gather facts about DigitalOcean Droplet sizes short_description: Gather information about DigitalOcean Droplet sizes
description: description:
- This module can be used to gather facts about droplet sizes. - This module can be used to gather information about droplet sizes.
- This module was called C(digital_ocean_size_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
requirements: requirements:
@ -30,12 +31,12 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all droplet sizes - name: Gather information about all droplet sizes
digital_ocean_size_facts: digital_ocean_size_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Get droplet Size Slug where vcpus is 1 - name: Get droplet Size Slug where vcpus is 1
digital_ocean_size_facts: digital_ocean_size_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
register: resp_out register: resp_out
- debug: var=resp_out - debug: var=resp_out
@ -52,7 +53,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean droplet size facts description: DigitalOcean droplet size information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -94,7 +95,7 @@ def core(module):
response = rest.get('sizes') response = rest.get('sizes')
if response.status_code != 200: if response.status_code != 200:
module.fail_json(msg="Failed to fetch 'sizes' facts due to error : %s" % response.json['message']) module.fail_json(msg="Failed to fetch 'sizes' information due to error : %s" % response.json['message'])
module.exit_json(changed=False, data=response.json['sizes']) module.exit_json(changed=False, data=response.json['sizes'])
@ -104,6 +105,8 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=argument_spec, argument_spec=argument_spec,
) )
if module._name == 'digital_ocean_size_facts':
module.deprecate("The 'digital_ocean_size_facts' module has been renamed to 'digital_ocean_size_info'", version='2.13')
try: try:
core(module) core(module)

@ -17,27 +17,28 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_snapshot_facts module: digital_ocean_snapshot_info
short_description: Gather facts about DigitalOcean Snapshot short_description: Gather information about DigitalOcean Snapshot
description: description:
- This module can be used to gather facts about snapshot facts based upon provided values such as droplet, volume and snapshot id. - This module can be used to gather information about snapshot information based upon provided values such as droplet, volume and snapshot id.
- This module was called C(digital_ocean_snapshot_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
options: options:
snapshot_type: snapshot_type:
description: description:
- Specifies the type of snapshot facts to be retrived. - Specifies the type of snapshot information to be retrived.
- If set to C(droplet), then facts are gathered related to snapshots based on Droplets only. - If set to C(droplet), then information are gathered related to snapshots based on Droplets only.
- If set to C(volume), then facts are gathered related to snapshots based on volumes only. - If set to C(volume), then information are gathered related to snapshots based on volumes only.
- If set to C(by_id), then facts are gathered related to snapshots based on snapshot id only. - If set to C(by_id), then information are gathered related to snapshots based on snapshot id only.
- If not set to any of the above, then facts are gathered related to all snapshots. - If not set to any of the above, then information are gathered related to all snapshots.
default: 'all' default: 'all'
choices: [ 'all', 'droplet', 'volume', 'by_id'] choices: [ 'all', 'droplet', 'volume', 'by_id']
required: false required: false
snapshot_id: snapshot_id:
description: description:
- To retrieve information about a snapshot, please specify this as a snapshot id. - To retrieve information about a snapshot, please specify this as a snapshot id.
- If set to actual snapshot id, then facts are gathered related to that particular snapshot only. - If set to actual snapshot id, then information are gathered related to that particular snapshot only.
- This is required parameter, if C(snapshot_type) is set to C(by_id). - This is required parameter, if C(snapshot_type) is set to C(by_id).
required: false required: false
requirements: requirements:
@ -47,29 +48,29 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all snapshots - name: Gather information about all snapshots
digital_ocean_snapshot_facts: digital_ocean_snapshot_info:
snapshot_type: all snapshot_type: all
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about droplet snapshots - name: Gather information about droplet snapshots
digital_ocean_snapshot_facts: digital_ocean_snapshot_info:
snapshot_type: droplet snapshot_type: droplet
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about volume snapshots - name: Gather information about volume snapshots
digital_ocean_snapshot_facts: digital_ocean_snapshot_info:
snapshot_type: volume snapshot_type: volume
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about snapshot by snapshot id - name: Gather information about snapshot by snapshot id
digital_ocean_snapshot_facts: digital_ocean_snapshot_info:
snapshot_type: by_id snapshot_type: by_id
snapshot_id: 123123123 snapshot_id: 123123123
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Get facts about snapshot named big-data-snapshot1 - name: Get information about snapshot named big-data-snapshot1
digital_ocean_snapshot_facts: digital_ocean_snapshot_info:
register: resp_out register: resp_out
- set_fact: - set_fact:
snapshot_id: "{{ item.id }}" snapshot_id: "{{ item.id }}"
@ -83,7 +84,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean snapshot facts description: DigitalOcean snapshot information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -122,7 +123,7 @@ def core(module):
status_code = response.status_code status_code = response.status_code
if status_code != 200: if status_code != 200:
module.fail_json(msg="Failed to fetch snapshot facts due to error : %s" % response.json['message']) module.fail_json(msg="Failed to fetch snapshot information due to error : %s" % response.json['message'])
snapshot.extend(response.json["snapshot"]) snapshot.extend(response.json["snapshot"])
else: else:
@ -151,6 +152,8 @@ def main():
['snapshot_type', 'by_id', ['snapshot_id']], ['snapshot_type', 'by_id', ['snapshot_id']],
], ],
) )
if module._name == 'digital_ocean_snapshot_facts':
module.deprecate("The 'digital_ocean_snapshot_facts' module has been renamed to 'digital_ocean_snapshot_info'", version='2.13')
try: try:
core(module) core(module)

@ -17,10 +17,11 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_tag_facts module: digital_ocean_tag_info
short_description: Gather facts about DigitalOcean tags short_description: Gather information about DigitalOcean tags
description: description:
- This module can be used to gather facts about DigitalOcean provided tags. - This module can be used to gather information about DigitalOcean provided tags.
- This module was called C(digital_ocean_tag_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
options: options:
@ -35,17 +36,17 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all tags - name: Gather information about all tags
digital_ocean_tag_facts: digital_ocean_tag_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about tag with given name - name: Gather information about tag with given name
digital_ocean_tag_facts: digital_ocean_tag_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
tag_name: "extra_awesome_tag" tag_name: "extra_awesome_tag"
- name: Get resources from tag name - name: Get resources from tag name
digital_ocean_tag_facts: digital_ocean_tag_info:
register: resp_out register: resp_out
- set_fact: - set_fact:
resources: "{{ item.resources }}" resources: "{{ item.resources }}"
@ -58,7 +59,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean tag facts description: DigitalOcean tag information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -106,6 +107,8 @@ def main():
tag_name=dict(type='str', required=False), tag_name=dict(type='str', required=False),
) )
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'digital_ocean_tag_facts':
module.deprecate("The 'digital_ocean_tag_facts' module has been renamed to 'digital_ocean_tag_info'", version='2.13')
try: try:
core(module) core(module)

@ -17,17 +17,18 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: digital_ocean_volume_facts module: digital_ocean_volume_info
short_description: Gather facts about DigitalOcean volumes short_description: Gather information about DigitalOcean volumes
description: description:
- This module can be used to gather facts about DigitalOcean provided volumes. - This module can be used to gather information about DigitalOcean provided volumes.
- This module was called C(digital_ocean_volume_facts) before Ansible 2.9. The usage did not change.
author: "Abhijeet Kasurde (@Akasurde)" author: "Abhijeet Kasurde (@Akasurde)"
version_added: "2.6" version_added: "2.6"
options: options:
region_name: region_name:
description: description:
- Name of region to restrict results to volumes available in a specific region. - Name of region to restrict results to volumes available in a specific region.
- Please use M(digital_ocean_region_facts) for getting valid values related regions. - Please use M(digital_ocean_region_info) for getting valid values related regions.
required: false required: false
requirements: requirements:
@ -38,17 +39,17 @@ extends_documentation_fragment: digital_ocean.documentation
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts about all volume - name: Gather information about all volume
digital_ocean_volume_facts: digital_ocean_volume_info:
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Gather facts about volume in given region - name: Gather information about volume in given region
digital_ocean_volume_facts: digital_ocean_volume_info:
region_name: nyc1 region_name: nyc1
oauth_token: "{{ oauth_token }}" oauth_token: "{{ oauth_token }}"
- name: Get facts about volume named nyc3-test-volume - name: Get information about volume named nyc3-test-volume
digital_ocean_volume_facts: digital_ocean_volume_info:
register: resp_out register: resp_out
- set_fact: - set_fact:
volume_id: "{{ item.id }}" volume_id: "{{ item.id }}"
@ -61,7 +62,7 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
data: data:
description: DigitalOcean volume facts description: DigitalOcean volume information
returned: success returned: success
type: list type: list
sample: [ sample: [
@ -131,6 +132,8 @@ def main():
region_name=dict(type='str', required=False), region_name=dict(type='str', required=False),
) )
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'digital_ocean_volume_facts':
module.deprecate("The 'digital_ocean_volume_facts' module has been renamed to 'digital_ocean_volume_info'", version='2.13')
try: try:
core(module) core(module)
Loading…
Cancel
Save