diff --git a/lib/ansible/modules/cloud/cloudscale/cloudscale_floating_ip.py b/lib/ansible/modules/cloud/cloudscale/cloudscale_floating_ip.py index 244641fce18..49b3c9df810 100644 --- a/lib/ansible/modules/cloud/cloudscale/cloudscale_floating_ip.py +++ b/lib/ansible/modules/cloud/cloudscale/cloudscale_floating_ip.py @@ -19,12 +19,7 @@ module: cloudscale_floating_ip short_description: Manages floating IPs on the cloudscale.ch IaaS service description: - Create, assign and delete floating IPs on the cloudscale.ch IaaS service. - - All operations are performed using the cloudscale.ch public API v1. - - "For details consult the full API documentation: U(https://www.cloudscale.ch/en/api/v1)." - - A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at - U(https://control.cloudscale.ch). notes: - - Instead of the api_token parameter the CLOUDSCALE_API_TOKEN environment variable can be used. - To create a new floating IP at least the C(ip_version) and C(server) options are required. - Once a floating_ip is created all parameters except C(server) are read-only. - It's not possible to request a floating IP without associating it with a server at the same time. @@ -61,14 +56,7 @@ options: description: - Reverse PTR entry for this address. - You cannot set a reverse PTR entry for IPv6 floating networks. Reverse PTR entries are only allowed for single addresses. - api_token: - description: - - cloudscale.ch API token. - - This can also be passed in the CLOUDSCALE_API_TOKEN environment variable. - api_timeout: - description: - - Timeout in seconds for calls to the cloudscale.ch API. - default: 30 +extends_documentation_fragment: cloudscale ''' EXAMPLES = ''' diff --git a/lib/ansible/modules/cloud/cloudscale/cloudscale_server.py b/lib/ansible/modules/cloud/cloudscale/cloudscale_server.py index e67167d3470..222514f6c3c 100644 --- a/lib/ansible/modules/cloud/cloudscale/cloudscale_server.py +++ b/lib/ansible/modules/cloud/cloudscale/cloudscale_server.py @@ -19,12 +19,7 @@ module: cloudscale_server short_description: Manages servers on the cloudscale.ch IaaS service description: - Create, start, stop and delete servers on the cloudscale.ch IaaS service. - - All operations are performed using the cloudscale.ch public API v1. - - "For details consult the full API documentation: U(https://www.cloudscale.ch/en/api/v1)." - - A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at - U(https://control.cloudscale.ch). notes: - - Instead of the api_token parameter the CLOUDSCALE_API_TOKEN environment variable can be used. - To create a new server at least the C(name), C(ssh_key), C(image) and C(flavor) options are required. - If more than one server with the name given by the C(name) option exists, execution is aborted. - Once a server is created all parameters except C(state) are read-only. You can't change the name, flavor or any other property. This is a limitation @@ -85,15 +80,12 @@ options: user_data: description: - Cloud-init configuration (cloud-config) data to use for the server. - api_token: - description: - - cloudscale.ch API token. - - This can also be passed in the CLOUDSCALE_API_TOKEN environment variable. api_timeout: description: - Timeout in seconds for calls to the cloudscale.ch API. default: 30 version_added: "2.5" +extends_documentation_fragment: cloudscale ''' EXAMPLES = ''' diff --git a/lib/ansible/modules/cloud/cloudscale/cloudscale_volume.py b/lib/ansible/modules/cloud/cloudscale/cloudscale_volume.py index ed3ce205a7e..e988bc9104b 100644 --- a/lib/ansible/modules/cloud/cloudscale/cloudscale_volume.py +++ b/lib/ansible/modules/cloud/cloudscale/cloudscale_volume.py @@ -19,15 +19,7 @@ module: cloudscale_volume short_description: Manages volumes on the cloudscale.ch IaaS service description: - Create, attach/detach and delete volumes on the cloudscale.ch IaaS service. - - All operations are performed using the cloudscale.ch public API v1. - - "For details consult the full API documentation: - U(https://www.cloudscale.ch/en/api/v1)." - - A valid API token is required for all operations. You can create as many - tokens as you like using the cloudscale.ch control panel at - U(https://control.cloudscale.ch). notes: - - Instead of the I(api_token) parameter the C(CLOUDSCALE_API_TOKEN) environment - variable can be used. - To create a new volume at least the I(name) and I(size_gb) options are required. - A volume can be created and attached to a server in the same task. @@ -61,15 +53,7 @@ options: detach the volume. Currently a volume can only be attached to a single server. aliases: [ server_uuid ] - api_token: - description: - - cloudscale.ch API token. - - This can also be passed in the C(CLOUDSCALE_API_TOKEN) environment - variable. - api_timeout: - description: - - Timeout in seconds for calls to the cloudscale.ch API. - default: 30 +extends_documentation_fragment: cloudscale ''' EXAMPLES = ''' diff --git a/lib/ansible/plugins/doc_fragments/cloudscale.py b/lib/ansible/plugins/doc_fragments/cloudscale.py new file mode 100644 index 00000000000..2e953549d8a --- /dev/null +++ b/lib/ansible/plugins/doc_fragments/cloudscale.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, René Moser +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + + +class ModuleDocFragment(object): + + # Standard cloudstack documentation fragment + DOCUMENTATION = ''' +options: + api_token: + description: + - cloudscale.ch API token. + - This can also be passed in the C(CLOUDSCALE_API_TOKEN) environment variable. + api_timeout: + description: + - Timeout in seconds for calls to the cloudscale.ch API. + default: 30 +notes: + - Instead of the api_token parameter the C(CLOUDSCALE_API_TOKEN) environment variable can be used. + - All operations are performed using the cloudscale.ch public API v1. + - "For details consult the full API documentation: U(https://www.cloudscale.ch/en/api/v1)." + - A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at + U(https://control.cloudscale.ch). +'''