From 52c69f5d1295acffc60785d71a6e3adde3271b46 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Fri, 3 Jul 2020 18:50:13 +0200 Subject: [PATCH 1/3] Sanity fixes --- plugins/doc_fragments/vultr.py | 2 + plugins/modules/vultr_account_info.py | 2 +- plugins/modules/vultr_block_storage.py | 12 +- plugins/modules/vultr_block_storage_info.py | 2 +- plugins/modules/vultr_dns_domain.py | 11 +- plugins/modules/vultr_dns_domain_info.py | 20 +- plugins/modules/vultr_dns_record.py | 19 +- plugins/modules/vultr_firewall_group.py | 8 +- plugins/modules/vultr_firewall_group_info.py | 35 ++-- plugins/modules/vultr_firewall_rule.py | 19 +- plugins/modules/vultr_network.py | 12 +- plugins/modules/vultr_network_info.py | 44 +++-- plugins/modules/vultr_os_info.py | 2 +- plugins/modules/vultr_plan_baremetal_info.py | 4 +- plugins/modules/vultr_plan_info.py | 3 +- plugins/modules/vultr_region_info.py | 7 +- plugins/modules/vultr_server.py | 2 +- plugins/modules/vultr_server_baremetal.py | 20 +- plugins/modules/vultr_server_info.py | 183 +++++++++++++++---- plugins/modules/vultr_ssh_key.py | 2 +- plugins/modules/vultr_ssh_key_info.py | 2 +- plugins/modules/vultr_startup_script.py | 2 +- plugins/modules/vultr_startup_script_info.py | 44 +++-- plugins/modules/vultr_user.py | 2 +- plugins/modules/vultr_user_info.py | 2 +- 25 files changed, 326 insertions(+), 135 deletions(-) diff --git a/plugins/doc_fragments/vultr.py b/plugins/doc_fragments/vultr.py index 61d36ae..cb5cfb6 100644 --- a/plugins/doc_fragments/vultr.py +++ b/plugins/doc_fragments/vultr.py @@ -2,6 +2,8 @@ # 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 class ModuleDocFragment(object): diff --git a/plugins/modules/vultr_account_info.py b/plugins/modules/vultr_account_info.py index 366c3e3..1718ff6 100644 --- a/plugins/modules/vultr_account_info.py +++ b/plugins/modules/vultr_account_info.py @@ -14,7 +14,7 @@ short_description: Get information about the Vultr account. description: - Get infos about account balance, charges and payments. -version_added: "1.0.0" +version_added: "0.1.0" author: "René Moser (@resmo)" extends_documentation_fragment: - ngine_io.vultr.vultr diff --git a/plugins/modules/vultr_block_storage.py b/plugins/modules/vultr_block_storage.py index 7b2d79a..3ff1351 100644 --- a/plugins/modules/vultr_block_storage.py +++ b/plugins/modules/vultr_block_storage.py @@ -15,26 +15,30 @@ description: - Manage block storage volumes on Vultr. author: "Yanis Guenane (@Spredzy)" -version_added: "1.0.0" +version_added: "0.1.0" options: name: description: - Name of the block storage volume. required: true aliases: [ description, label ] + type: str size: description: - Size of the block storage volume in GB. - Required if I(state) is present. + type: int region: description: - Region the block storage volume is deployed into. - Required if I(state) is present. + type: str state: description: - State of the block storage volume. default: present choices: [ present, absent ] + type: str extends_documentation_fragment: - ngine_io.vultr.vultr @@ -216,10 +220,10 @@ def absent_block_storage_volume(self): def main(): argument_spec = vultr_argument_spec() argument_spec.update(dict( - name=dict(required=True, aliases=['description', 'label']), + name=dict(type='str', required=True, aliases=['description', 'label']), size=dict(type='int'), - region=dict(), - state=dict(choices=['present', 'absent'], default='present'), + region=dict(type='str'), + state=dict(type='str', choices=['present', 'absent'], default='present'), )) module = AnsibleModule( diff --git a/plugins/modules/vultr_block_storage_info.py b/plugins/modules/vultr_block_storage_info.py index a0dfdd5..46bdbec 100644 --- a/plugins/modules/vultr_block_storage_info.py +++ b/plugins/modules/vultr_block_storage_info.py @@ -15,7 +15,7 @@ short_description: Get information about the Vultr block storage volumes available. description: - Get infos about block storage volumes available in Vultr. -version_added: "1.0.0" +version_added: "0.1.0" author: - "Yanis Guenane (@Spredzy)" - "René Moser (@resmo)" diff --git a/plugins/modules/vultr_dns_domain.py b/plugins/modules/vultr_dns_domain.py index a4f9a84..131280d 100644 --- a/plugins/modules/vultr_dns_domain.py +++ b/plugins/modules/vultr_dns_domain.py @@ -14,7 +14,7 @@ short_description: Manages DNS domains on Vultr. description: - Create and remove DNS domains. -version_added: "1.0.0" +version_added: "0.1.0" author: "René Moser (@resmo)" options: name: @@ -22,16 +22,19 @@ - The domain name. required: true aliases: [ domain ] + type: str server_ip: description: - The default server IP. - Use M(vultr_dns_record) to change it once the domain is created. - Required if C(state=present). + type: str state: description: - State of the DNS domain. default: present choices: [ present, absent ] + type: str extends_documentation_fragment: - ngine_io.vultr.vultr @@ -172,9 +175,9 @@ def absent_domain(self): def main(): argument_spec = vultr_argument_spec() argument_spec.update(dict( - name=dict(required=True, aliases=['domain']), - server_ip=dict(), - state=dict(choices=['present', 'absent'], default='present'), + name=dict(type='str', required=True, aliases=['domain']), + server_ip=dict(type='str',), + state=dict(type='str', choices=['present', 'absent'], default='present'), )) module = AnsibleModule( diff --git a/plugins/modules/vultr_dns_domain_info.py b/plugins/modules/vultr_dns_domain_info.py index 8058094..35a47d7 100644 --- a/plugins/modules/vultr_dns_domain_info.py +++ b/plugins/modules/vultr_dns_domain_info.py @@ -13,7 +13,7 @@ short_description: Gather information about the Vultr DNS domains available. description: - Gather information about DNS domains available in Vultr. -version_added: "1.0.0" +version_added: "0.1.0" author: "Yanis Guenane (@Spredzy)" extends_documentation_fragment: - ngine_io.vultr.vultr @@ -66,13 +66,17 @@ description: Response from Vultr API returned: success type: complex - sample: - "vultr_dns_domain_info": [ - { - "date_created": "2018-07-19 07:14:21", - "domain": "ansibletest.com" - } - ] + contains: + domain: + description: Name of the DNS Domain. + returned: success + type: str + sample: example.com + date_created: + description: Date the DNS domain was created. + returned: success + type: str + sample: "2017-08-26 12:47:48" ''' from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/vultr_dns_record.py b/plugins/modules/vultr_dns_record.py index ac93c2d..bab11c4 100644 --- a/plugins/modules/vultr_dns_record.py +++ b/plugins/modules/vultr_dns_record.py @@ -14,7 +14,7 @@ short_description: Manages DNS records on Vultr. description: - Create, update and remove DNS records. -version_added: "1.0.0" +version_added: "0.1.0" author: "René Moser (@resmo)" options: name: @@ -22,9 +22,11 @@ - The record name (subrecord). default: "" aliases: [ subrecord ] + type: str domain: description: - The domain the record is related to. + type: str required: true record_type: description: @@ -41,14 +43,17 @@ - NS - SSHFP aliases: [ type ] + type: str data: description: - Data of the record. - Required if C(state=present) or C(multiple=yes). + type: str ttl: description: - TTL of the record. default: 300 + type: int multiple: description: - Whether to use more than one record with similar C(name) including no name and C(record_type). @@ -60,11 +65,13 @@ description: - Priority of the record. default: 0 + type: int state: description: - State of the DNS record. default: present choices: [ present, absent ] + type: str extends_documentation_fragment: - ngine_io.vultr.vultr @@ -335,14 +342,14 @@ def absent_record(self): def main(): argument_spec = vultr_argument_spec() argument_spec.update(dict( - domain=dict(required=True), - name=dict(default="", aliases=['subrecord']), - state=dict(choices=['present', 'absent'], default='present'), + domain=dict(type='str', required=True), + name=dict(type='str', default="", aliases=['subrecord']), + state=dict(type='str', choices=['present', 'absent'], default='present'), ttl=dict(type='int', default=300), - record_type=dict(choices=RECORD_TYPES, default='A', aliases=['type']), + record_type=dict(type='str', choices=RECORD_TYPES, default='A', aliases=['type']), multiple=dict(type='bool', default=False), priority=dict(type='int', default=0), - data=dict() + data=dict(type='str',) )) module = AnsibleModule( diff --git a/plugins/modules/vultr_firewall_group.py b/plugins/modules/vultr_firewall_group.py index 77f4b8d..36ef3b4 100644 --- a/plugins/modules/vultr_firewall_group.py +++ b/plugins/modules/vultr_firewall_group.py @@ -14,7 +14,7 @@ short_description: Manages firewall groups on Vultr. description: - Create and remove firewall groups. -version_added: "1.0.0" +version_added: "0.1.0" author: "René Moser (@resmo)" options: name: @@ -22,11 +22,13 @@ - Name of the firewall group. required: true aliases: [ description ] + type: str state: description: - State of the firewall group. default: present choices: [ present, absent ] + type: str extends_documentation_fragment: - ngine_io.vultr.vultr @@ -176,8 +178,8 @@ def absent_firewall_group(self): def main(): argument_spec = vultr_argument_spec() argument_spec.update(dict( - name=dict(required=True, aliases=['description']), - state=dict(choices=['present', 'absent'], default='present'), + name=dict(type='str', required=True, aliases=['description']), + state=dict(type='str', choices=['present', 'absent'], default='present'), )) module = AnsibleModule( diff --git a/plugins/modules/vultr_firewall_group_info.py b/plugins/modules/vultr_firewall_group_info.py index 5d829cf..52b3eb0 100644 --- a/plugins/modules/vultr_firewall_group_info.py +++ b/plugins/modules/vultr_firewall_group_info.py @@ -13,7 +13,7 @@ short_description: Gather information about the Vultr firewall groups available. description: - Gather information about firewall groups available in Vultr. -version_added: "1.0.0" +version_added: "0.1.0" author: "Yanis Guenane (@Spredzy)" extends_documentation_fragment: - ngine_io.vultr.vultr @@ -66,18 +66,27 @@ description: Response from Vultr API returned: success type: complex - sample: - "vultr_firewall_group_info": [ - { - "date_created": "2018-07-12 10:27:14", - "date_modified": "2018-07-12 10:27:14", - "description": "test", - "id": "5e128ff0", - "instance_count": 0, - "max_rule_count": 50, - "rule_count": 0 - } - ] + contains: + id: + description: ID of the firewall group + returned: success + type: str + sample: 1234abcd + description: + description: Name of the firewall group + returned: success + type: str + sample: my firewall group + date_created: + description: Date the firewall group was created + returned: success + type: str + sample: "2017-08-26 12:47:48" + date_modified: + description: Date the firewall group was modified + returned: success + type: str + sample: "2017-08-26 12:47:48" ''' from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/vultr_firewall_rule.py b/plugins/modules/vultr_firewall_rule.py index d338455..f9a59b2 100644 --- a/plugins/modules/vultr_firewall_rule.py +++ b/plugins/modules/vultr_firewall_rule.py @@ -14,44 +14,51 @@ short_description: Manages firewall rules on Vultr. description: - Create and remove firewall rules. -version_added: "1.0.0" +version_added: "0.1.0" author: "René Moser (@resmo)" options: group: description: - Name of the firewall group. required: true + type: str ip_version: description: - IP address version choices: [ v4, v6 ] default: v4 aliases: [ ip_type ] + type: str protocol: description: - Protocol of the firewall rule. choices: [ icmp, tcp, udp, gre ] default: tcp + type: str cidr: description: - Network in CIDR format - The CIDR format must match with the C(ip_version) value. - Required if C(state=present). - Defaulted to 0.0.0.0/0 or ::/0 depending on C(ip_version). + type: str start_port: description: - Start port for the firewall rule. - Required if C(protocol) is tcp or udp and I(state=present). aliases: [ port ] + type: int end_port: description: - End port for the firewall rule. - Only considered if C(protocol) is tcp or udp and I(state=present). + type: int state: description: - State of the firewall rule. default: present choices: [ present, absent ] + type: str extends_documentation_fragment: - ngine_io.vultr.vultr @@ -349,13 +356,13 @@ def get_result(self, resource): def main(): argument_spec = vultr_argument_spec() argument_spec.update(dict( - group=dict(required=True), + group=dict(type='str', required=True), start_port=dict(type='int', aliases=['port']), end_port=dict(type='int'), - protocol=dict(choices=['tcp', 'udp', 'gre', 'icmp'], default='tcp'), - cidr=dict(), - ip_version=dict(choices=['v4', 'v6'], default='v4', aliases=['ip_type']), - state=dict(choices=['present', 'absent'], default='present'), + protocol=dict(type='str', choices=['tcp', 'udp', 'gre', 'icmp'], default='tcp'), + cidr=dict(type='str',), + ip_version=dict(type='str', choices=['v4', 'v6'], default='v4', aliases=['ip_type']), + state=dict(type='str', choices=['present', 'absent'], default='present'), )) module = AnsibleModule( diff --git a/plugins/modules/vultr_network.py b/plugins/modules/vultr_network.py index d683a44..3992e3d 100644 --- a/plugins/modules/vultr_network.py +++ b/plugins/modules/vultr_network.py @@ -14,7 +14,7 @@ short_description: Manages networks on Vultr. description: - Manage networks on Vultr. A network cannot be updated. It needs to be deleted and re-created. -version_added: "1.0.0" +version_added: "0.1.0" author: "Yanis Guenane (@Spredzy)" options: name: @@ -22,17 +22,21 @@ - Name of the network. required: true aliases: [ description, label ] + type: str cidr: description: - The CIDR IPv4 network block to be used when attaching servers to this network. Required if I(state=present). + type: str region: description: - Region the network is deployed into. Required if I(state=present). + type: str state: description: - State of the network. default: present choices: [ present, absent ] + type: str extends_documentation_fragment: - ngine_io.vultr.vultr @@ -202,9 +206,9 @@ def absent_network(self): def main(): argument_spec = vultr_argument_spec() argument_spec.update(dict( - name=dict(required=True, aliases=['description', 'label']), - cidr=dict(), - region=dict(), + name=dict(type='str', required=True, aliases=['description', 'label']), + cidr=dict(type='str',), + region=dict(type='str',), state=dict(choices=['present', 'absent'], default='present'), )) diff --git a/plugins/modules/vultr_network_info.py b/plugins/modules/vultr_network_info.py index 31e0b66..85f6471 100644 --- a/plugins/modules/vultr_network_info.py +++ b/plugins/modules/vultr_network_info.py @@ -13,7 +13,7 @@ short_description: Gather information about the Vultr networks available. description: - Gather information about networks available in Vultr. -version_added: "1.0.0" +version_added: "0.1.0" author: "Yanis Guenane (@Spredzy)" extends_documentation_fragment: - ngine_io.vultr.vultr @@ -66,17 +66,37 @@ description: Response from Vultr API returned: success type: complex - sample: - "vultr_network_info": [ - { - "date_created": "2018-08-02 11:18:49", - "id": "net5b62e8991adfg", - "name": "mynet", - "region": "Amsterdam", - "v4_subnet": "192.168.42.0", - "v4_subnet_mask": 24 - } - ] + contains: + id: + description: ID of the network + returned: success + type: str + sample: "net5b62c6dc63ef5" + name: + description: Name (label) of the network + returned: success + type: str + sample: "mynetwork" + date_created: + description: Date when the network was created + returned: success + type: str + sample: "2018-08-02 08:54:52" + region: + description: Region the network was deployed into + returned: success + type: str + sample: "Amsterdam" + v4_subnet: + description: IPv4 Network address + returned: success + type: str + sample: "192.168.42.0" + v4_subnet_mask: + description: Ipv4 Network mask + returned: success + type: int + sample: 24 ''' from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/vultr_os_info.py b/plugins/modules/vultr_os_info.py index 142f75f..258b50d 100644 --- a/plugins/modules/vultr_os_info.py +++ b/plugins/modules/vultr_os_info.py @@ -15,7 +15,7 @@ short_description: Get information about the Vultr OSes available. description: - Get infos about OSes available to boot servers. -version_added: "1.0.0" +version_added: "0.1.0" author: - "Yanis Guenane (@Spredzy)" - "René Moser (@resmo)" diff --git a/plugins/modules/vultr_plan_baremetal_info.py b/plugins/modules/vultr_plan_baremetal_info.py index 515af71..040ca2d 100644 --- a/plugins/modules/vultr_plan_baremetal_info.py +++ b/plugins/modules/vultr_plan_baremetal_info.py @@ -14,7 +14,7 @@ short_description: Gather information about the Vultr Bare Metal plans available. description: - Gather information about Bare Metal plans available to boot servers. -version_added: "1.0.0" +version_added: "0.3.0" author: "Simon Baerlocher (@sbaerlocher)" extends_documentation_fragment: - ngine_io.vultr.vultr @@ -68,7 +68,7 @@ type: complex contains: plan: - description: List of the Bare Metal plans available. + description: List of the Bare Metal plans available. returned: success type: list sample: [{ diff --git a/plugins/modules/vultr_plan_info.py b/plugins/modules/vultr_plan_info.py index 516df2f..3783ab8 100644 --- a/plugins/modules/vultr_plan_info.py +++ b/plugins/modules/vultr_plan_info.py @@ -14,11 +14,10 @@ short_description: Gather information about the Vultr plans available. description: - Gather information about plans available to boot servers. -version_added: "1.0.0" +version_added: "0.1.0" author: "Yanis Guenane (@Spredzy)" extends_documentation_fragment: - ngine_io.vultr.vultr - ''' EXAMPLES = r''' diff --git a/plugins/modules/vultr_region_info.py b/plugins/modules/vultr_region_info.py index cb462c5..2080d2d 100644 --- a/plugins/modules/vultr_region_info.py +++ b/plugins/modules/vultr_region_info.py @@ -14,7 +14,7 @@ short_description: Gather information about the Vultr regions available. description: - Gather information about regions available to boot servers. -version_added: "1.0.0" +version_added: "0.1.0" author: "Yanis Guenane (@Spredzy)" extends_documentation_fragment: - ngine_io.vultr.vultr @@ -66,9 +66,8 @@ vultr_region_info: description: Response from Vultr API returned: success - type: complex - sample: - "vultr_region_info": [ + type: list + sample: [ { "block_storage": false, "continent": "Europe", diff --git a/plugins/modules/vultr_server.py b/plugins/modules/vultr_server.py index 27df2da..94161fc 100644 --- a/plugins/modules/vultr_server.py +++ b/plugins/modules/vultr_server.py @@ -14,7 +14,7 @@ short_description: Manages virtual servers on Vultr. description: - Deploy, start, stop, update, restart, reinstall servers. -version_added: "1.0.0" +version_added: "0.1.0" author: "René Moser (@resmo)" options: name: diff --git a/plugins/modules/vultr_server_baremetal.py b/plugins/modules/vultr_server_baremetal.py index b941c01..1df7676 100644 --- a/plugins/modules/vultr_server_baremetal.py +++ b/plugins/modules/vultr_server_baremetal.py @@ -14,7 +14,7 @@ short_description: Manages baremetal servers on Vultr. description: - Deploy and destroy servers. -version_added: "1.0.0" +version_added: "0.3.0" author: - "Nate River (@vitikc)" - "Simon Baerlocher (@sbaerlocher)" @@ -514,18 +514,18 @@ def main(): argument_spec = vultr_argument_spec() argument_spec.update(dict( name=dict(required=True, aliases=['label']), - hostname=dict(), - os=dict(), - plan=dict(), + hostname=dict(type='str',), + os=dict(type='str',), + plan=dict(type='str',), notify_activate=dict(type='bool', default=False), ipv6_enabled=dict(type='bool'), - tag=dict(), - reserved_ip_v4=dict(), - startup_script=dict(), - user_data=dict(), + tag=dict(type='str',), + reserved_ip_v4=dict(type='str',), + startup_script=dict(type='str',), + user_data=dict(type='str',), ssh_keys=dict(type='list', elements='str', aliases=['ssh_key']), - region=dict(), - state=dict(choices=['present', 'absent'], default='present'), + region=dict(type='str',), + state=dict(type='str', choices=['present', 'absent'], default='present'), )) module = AnsibleModule( diff --git a/plugins/modules/vultr_server_info.py b/plugins/modules/vultr_server_info.py index 1d53a95..4d84bdc 100644 --- a/plugins/modules/vultr_server_info.py +++ b/plugins/modules/vultr_server_info.py @@ -14,7 +14,7 @@ short_description: Gather information about the Vultr servers available. description: - Gather information about servers available. -version_added: "1.0.0" +version_added: "0.1.0" author: "Yanis Guenane (@Spredzy)" extends_documentation_fragment: - ngine_io.vultr.vultr @@ -67,41 +67,152 @@ description: Response from Vultr API returned: success type: complex - sample: - "vultr_server_info": [ - { - "allowed_bandwidth_gb": 1000, - "auto_backup_enabled": false, - "application": null, - "cost_per_month": 5.00, - "current_bandwidth_gb": 0, - "date_created": "2018-07-19 08:23:03", - "default_password": "p4ssw0rd!", - "disk": "Virtual 25 GB", - "firewallgroup": null, - "id": 17241096, - "internal_ip": "", - "kvm_url": "https://my.vultr.com/subs/vps/novnc/api.php?data=OFB...", - "name": "ansibletest", - "os": "CentOS 7 x64", - "pending_charges": 0.01, - "plan": "1024 MB RAM,25 GB SSD,1.00 TB BW", - "power_status": "running", - "ram": "1024 MB", - "region": "Amsterdam", - "server_state": "ok", - "status": "active", - "tag": "", - "v4_gateway": "105.178.158.1", - "v4_main_ip": "105.178.158.181", - "v4_netmask": "255.255.254.0", - "v6_main_ip": "", - "v6_network": "", - "v6_network_size": "", - "v6_networks": [], - "vcpu_count": 1 - } - ] + contains: + id: + description: ID of the server + returned: success + type: str + sample: 10194376 + name: + description: Name (label) of the server + returned: success + type: str + sample: "ansible-test-vm" + plan: + description: Plan used for the server + returned: success + type: str + sample: "1024 MB RAM,25 GB SSD,1.00 TB BW" + allowed_bandwidth_gb: + description: Allowed bandwidth to use in GB + returned: success + type: int + sample: 1000 + auto_backup_enabled: + description: Whether automatic backups are enabled + returned: success + type: bool + sample: false + cost_per_month: + description: Cost per month for the server + returned: success + type: float + sample: 5.00 + current_bandwidth_gb: + description: Current bandwidth used for the server + returned: success + type: int + sample: 0 + date_created: + description: Date when the server was created + returned: success + type: str + sample: "2017-08-26 12:47:48" + default_password: + description: Password to login as root into the server + returned: success + type: str + sample: "!p3EWYJm$qDWYaFr" + disk: + description: Information about the disk + returned: success + type: str + sample: "Virtual 25 GB" + v4_gateway: + description: IPv4 gateway + returned: success + type: str + sample: "45.32.232.1" + internal_ip: + description: Internal IP + returned: success + type: str + sample: "" + kvm_url: + description: URL to the VNC + returned: success + type: str + sample: "https://my.vultr.com/subs/vps/novnc/api.php?data=xyz" + region: + description: Region the server was deployed into + returned: success + type: str + sample: "Amsterdam" + v4_main_ip: + description: Main IPv4 + returned: success + type: str + sample: "45.32.233.154" + v4_netmask: + description: Netmask IPv4 + returned: success + type: str + sample: "255.255.254.0" + os: + description: Operating system used for the server + returned: success + type: str + sample: "CentOS 6 x64" + firewall_group: + description: Firewall group the server is assigned to + returned: success and available + type: str + sample: "CentOS 6 x64" + pending_charges: + description: Pending charges + returned: success + type: float + sample: 0.01 + power_status: + description: Power status of the server + returned: success + type: str + sample: "running" + ram: + description: Information about the RAM size + returned: success + type: str + sample: "1024 MB" + server_state: + description: State about the server + returned: success + type: str + sample: "ok" + status: + description: Status about the deployment of the server + returned: success + type: str + sample: "active" + tag: + description: TBD + returned: success + type: str + sample: "" + v6_main_ip: + description: Main IPv6 + returned: success + type: str + sample: "" + v6_network: + description: Network IPv6 + returned: success + type: str + sample: "" + v6_network_size: + description: Network size IPv6 + returned: success + type: str + sample: "" + v6_networks: + description: Networks IPv6 + returned: success + type: list + sample: [] + vcpu_count: + description: Virtual CPU count + returned: success + type: int + sample: 1 ''' from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/vultr_ssh_key.py b/plugins/modules/vultr_ssh_key.py index 14d5301..6c9a56a 100644 --- a/plugins/modules/vultr_ssh_key.py +++ b/plugins/modules/vultr_ssh_key.py @@ -14,7 +14,7 @@ short_description: Manages ssh keys on Vultr. description: - Create, update and remove ssh keys. -version_added: "1.0.0" +version_added: "0.1.0" author: "René Moser (@resmo)" options: name: diff --git a/plugins/modules/vultr_ssh_key_info.py b/plugins/modules/vultr_ssh_key_info.py index 25cebfb..51b2960 100644 --- a/plugins/modules/vultr_ssh_key_info.py +++ b/plugins/modules/vultr_ssh_key_info.py @@ -16,7 +16,7 @@ short_description: Get information about the Vultr SSH keys available. description: - Get infos about SSH keys available. -version_added: "1.0.0" +version_added: "0.1.0" author: - "Yanis Guenane (@Spredzy)" - "René Moser (@resmo)" diff --git a/plugins/modules/vultr_startup_script.py b/plugins/modules/vultr_startup_script.py index 935768c..dfa58af 100644 --- a/plugins/modules/vultr_startup_script.py +++ b/plugins/modules/vultr_startup_script.py @@ -14,7 +14,7 @@ short_description: Manages startup scripts on Vultr. description: - Create, update and remove startup scripts. -version_added: "1.0.0" +version_added: "0.1.0" author: "René Moser (@resmo)" options: name: diff --git a/plugins/modules/vultr_startup_script_info.py b/plugins/modules/vultr_startup_script_info.py index 0ed32d0..262954a 100644 --- a/plugins/modules/vultr_startup_script_info.py +++ b/plugins/modules/vultr_startup_script_info.py @@ -14,7 +14,7 @@ short_description: Gather information about the Vultr startup scripts available. description: - Gather information about vultr_startup_scripts available. -version_added: "1.0.0" +version_added: "0.1.0" author: "Yanis Guenane (@Spredzy)" extends_documentation_fragment: - ngine_io.vultr.vultr @@ -67,17 +67,37 @@ description: Response from Vultr API returned: success type: complex - sample: - "vultr_startup_script_info": [ - { - "date_created": "2018-07-19 08:38:36", - "date_modified": "2018-07-19 08:38:36", - "id": 327133, - "name": "lolo", - "script": "#!/bin/bash\necho Hello World > /root/hello", - "type": "boot" - } - ] + contains: + id: + description: ID of the startup script. + returned: success + type: str + sample: 249395 + name: + description: Name of the startup script. + returned: success + type: str + sample: my startup script + script: + description: The source code of the startup script. + returned: success + type: str + sample: "#!/bin/bash\necho Hello World > /root/hello" + type: + description: The type of the startup script. + returned: success + type: str + sample: pxe + date_created: + description: Date the startup script was created. + returned: success + type: str + sample: "2017-08-26 12:47:48" + date_modified: + description: Date the startup script was modified. + returned: success + type: str + sample: "2017-08-26 12:47:48" ''' from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/vultr_user.py b/plugins/modules/vultr_user.py index 98fd9e7..53ebfea 100644 --- a/plugins/modules/vultr_user.py +++ b/plugins/modules/vultr_user.py @@ -14,7 +14,7 @@ short_description: Manages users on Vultr. description: - Create, update and remove users. -version_added: "1.0.0" +version_added: "0.1.0" author: "René Moser (@resmo)" options: name: diff --git a/plugins/modules/vultr_user_info.py b/plugins/modules/vultr_user_info.py index 656222c..f07d0ef 100644 --- a/plugins/modules/vultr_user_info.py +++ b/plugins/modules/vultr_user_info.py @@ -13,7 +13,7 @@ --- module: vultr_user_info short_description: Get information about the Vultr user available. -version_added: "1.0.0" +version_added: "0.1.0" description: - Get infos about users available in Vultr. author: From 674bdbb895dfaadf3ef9f10f88f1ad67a8af79a4 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Fri, 3 Jul 2020 18:57:17 +0200 Subject: [PATCH 2/3] add changelog and meta/runtime --- changelogs/.gitignore | 1 + changelogs/config.yaml | 29 +++++ .../fragments/66792-vultr-improve-plan.yml | 2 + .../67437-vultr-fix-retry-max-delay-param.yml | 2 + meta/runtime.yml | 114 ++++++++++++++++++ 5 files changed, 148 insertions(+) create mode 100644 changelogs/.gitignore create mode 100644 changelogs/config.yaml create mode 100644 changelogs/fragments/66792-vultr-improve-plan.yml create mode 100644 changelogs/fragments/67437-vultr-fix-retry-max-delay-param.yml create mode 100644 meta/runtime.yml diff --git a/changelogs/.gitignore b/changelogs/.gitignore new file mode 100644 index 0000000..6be6b53 --- /dev/null +++ b/changelogs/.gitignore @@ -0,0 +1 @@ +/.plugin-cache.yaml diff --git a/changelogs/config.yaml b/changelogs/config.yaml new file mode 100644 index 0000000..98cab92 --- /dev/null +++ b/changelogs/config.yaml @@ -0,0 +1,29 @@ +changelog_filename_template: ../CHANGELOG.rst +changelog_filename_version_depth: 0 +changes_file: changelog.yaml +changes_format: combined +keep_fragments: true +mention_ancestor: true +new_plugins_after_name: removed_features +notesdir: fragments +prelude_section_name: release_summary +prelude_section_title: Release Summary +sections: +- - major_changes + - Major Changes +- - minor_changes + - Minor Changes +- - breaking_changes + - Breaking Changes / Porting Guide +- - deprecated_features + - Deprecated Features +- - removed_features + - Removed Features (previously deprecated) +- - security_fixes + - Security Fixes +- - bugfixes + - Bugfixes +- - known_issues + - Known Issues +title: Vultr Collection +trivial_section_name: trivial diff --git a/changelogs/fragments/66792-vultr-improve-plan.yml b/changelogs/fragments/66792-vultr-improve-plan.yml new file mode 100644 index 0000000..fe1144d --- /dev/null +++ b/changelogs/fragments/66792-vultr-improve-plan.yml @@ -0,0 +1,2 @@ +minor_changes: + - vultr_server_info, vultr_server - Improved handling of discontinued plans (https://github.com/ansible/ansible/issues/66707). diff --git a/changelogs/fragments/67437-vultr-fix-retry-max-delay-param.yml b/changelogs/fragments/67437-vultr-fix-retry-max-delay-param.yml new file mode 100644 index 0000000..b3796ce --- /dev/null +++ b/changelogs/fragments/67437-vultr-fix-retry-max-delay-param.yml @@ -0,0 +1,2 @@ +bugfixes: + - vultr - Fixed the issue retry max delay param was ignored. diff --git a/meta/runtime.yml b/meta/runtime.yml new file mode 100644 index 0000000..93580fd --- /dev/null +++ b/meta/runtime.yml @@ -0,0 +1,114 @@ +requires_ansible: '>=2.9.10' +action_groups: + vultr: + - vultr_user + - vultr_plan_baremetal_info + - vultr_user_info + - vultr_block_storage + - vultr_plan_info + - vultr_ssh_key_info + - vultr_network_info + - vultr_firewall_group_info + - vultr_ssh_key + - vultr_dns_domain + - vultr_server_info + - vultr_dns_record + - vultr_server_baremetal + - vultr_block_storage_info + - vultr_firewall_group + - vultr_region_info + - vultr_network + - vultr_account_info + - vultr_firewall_rule + - vultr_dns_domain_info + - vultr_server + - vultr_startup_script + - vultr_os_info + - vultr_startup_script_info + +plugin_routing: + modules: + vr_account_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_account_info + vr_dns_domain: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vr_dns_domain + vr_dns_record: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_dns_record + vr_firewall_group: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_firewall_group + vr_firewall_rule: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_firewall_rule + vr_server: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_server + vr_ssh_key: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_ssh_key + vr_startup_script: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_startup_script + vr_user: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_user + vultr_account_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_account_info + vultr_block_storage_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_block_storage_info + vultr_dns_domain_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_dns_domain_info + vultr_firewall_group_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_firewall_group_info + vultr_network_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_network_info + vultr_os_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_os_info + vultr_plan_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_plan_info + vultr_region_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_region_info + vultr_server_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_server_info + vultr_ssh_key_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_ssh_key_info + vultr_startup_script_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_startup_script_info + vultr_user_facts: + deprecation: + removal_version: 2.0.0 + warning_text: module was renamed to vultr_user_info From c4a79b987c666ea5b40ba3421aba17c563919838 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Fri, 3 Jul 2020 18:57:53 +0200 Subject: [PATCH 3/3] release 0.3.0 --- CHANGELOG.rst | 25 +++++++++++++++++++++++++ changelogs/changelog.yaml | 20 ++++++++++++++++++++ galaxy.yml | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.rst create mode 100644 changelogs/changelog.yaml diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..fc98f87 --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,25 @@ +============================== +Vultr Collection Release Notes +============================== + +.. contents:: Topics + + +v0.3.0 +====== + +Minor Changes +------------- + +- vultr_server_info, vultr_server - Improved handling of discontinued plans (https://github.com/ansible/ansible/issues/66707). + +Bugfixes +-------- + +- vultr - Fixed the issue retry max delay param was ignored. + +New Modules +----------- + +- vultr_plan_baremetal_info - Gather information about the Vultr Bare Metal plans available. +- vultr_server_baremetal - Manages baremetal servers on Vultr. diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml new file mode 100644 index 0000000..5986c12 --- /dev/null +++ b/changelogs/changelog.yaml @@ -0,0 +1,20 @@ +ancestor: null +releases: + 0.3.0: + changes: + bugfixes: + - vultr - Fixed the issue retry max delay param was ignored. + minor_changes: + - vultr_server_info, vultr_server - Improved handling of discontinued plans + (https://github.com/ansible/ansible/issues/66707). + fragments: + - 66792-vultr-improve-plan.yml + - 67437-vultr-fix-retry-max-delay-param.yml + modules: + - description: Gather information about the Vultr Bare Metal plans available. + name: vultr_plan_baremetal_info + namespace: '' + - description: Manages baremetal servers on Vultr. + name: vultr_server_baremetal + namespace: '' + release_date: '2020-07-03' diff --git a/galaxy.yml b/galaxy.yml index baefa9d..29f173a 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -16,4 +16,4 @@ tags: - cloud - vultr - ngine_io -version: 0.2.0 +version: 0.3.0