Skip to content

Commit

Permalink
Tidy up validate-modules ignores for some cloud/ modules (#1354)
Browse files Browse the repository at this point in the history
* fixed validation-modules for plugins/modules/cloud/atomic/atomic_container.py

* fixed validation-modules for plugins/modules/cloud/oracle/oci_vcn.py

* fixed validation-modules for plugins/modules/cloud/heroku/heroku_collaborator.py

* fixed validation-modules for plugins/modules/cloud/docker/docker_stack.py

* fixed validation-modules for plugins/modules/cloud/pubnub/pubnub_blocks.py

* fixed validation-modules for plugins/modules/cloud/huawei/hwc_ecs_instance.py

* fixed validation-modules for plugins/modules/cloud/huawei/hwc_vpc_port.py

* fixed validation-modules for plugins/modules/cloud/huawei/hwc_vpc_subnet.py

* fixed validation-modules for plugins/modules/cloud/ovh/ovh_ip_failover.py

* fixed validation-modules for plugins/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py

* fixed validation-modules for plugins/modules/cloud/softlayer/sl_vm.py

* fixed validation-modules for plugins/modules/cloud/misc/proxmox_kvm.py

* fixed validation-modules for plugins/modules/cloud/misc/proxmox_template.py

* fixed validation-modules for plugins/modules/cloud/misc/terraform.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_dns_reload.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_memstore_info.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_server_info.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_zone_domain.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_zone.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_zone_record.py

* fixed validation-modules for plugins/modules/cloud/linode/linode.py

* fixed validation-modules for plugins/modules/cloud/linode/linode_v4.py

* fixed validation-modules for plugins/doc_fragments/dimensiondata.py

* fixed validation-modules for plugins/modules/cloud/dimensiondata/dimensiondata_network.py

* fixed validation-modules for plugins/modules/cloud/dimensiondata/dimensiondata_vlan.py

* fixed validation-modules for plugins/modules/cloud/xenserver/xenserver_guest_info.py

* fixed validation-modules for plugins/modules/cloud/xenserver/xenserver_guest_powerstate.py

* Tidy up validate-modules ignores for varied cloud modules

- loking at the count of ignore lines, worked from the lower numbers up

* rolled back line for docker_container, removed two extraneous for xenserver

* rolled back lins for linode in 2.9
  • Loading branch information
russoz committed Nov 23, 2020
1 parent 5c768dc commit 3d1f9ed
Show file tree
Hide file tree
Showing 30 changed files with 165 additions and 120 deletions.
1 change: 0 additions & 1 deletion plugins/doc_fragments/dimensiondata.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class ModuleDocFragment(object):
region:
description:
- The target region.
choices:
- Regions are defined in Apache libcloud project [libcloud/common/dimensiondata.py]
- They are also listed in U(https://libcloud.readthedocs.io/en/latest/compute/drivers/dimensiondata.html)
- Note that the default value "na" stands for "North America".
Expand Down
2 changes: 0 additions & 2 deletions plugins/modules/cloud/atomic/atomic_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@
state:
description:
- State of the container.
required: True
choices: ["absent", "latest", "present", "rollback"]
default: "latest"
type: str
mode:
description:
- Define if it is an user or a system container.
required: True
choices: ["user", "system"]
type: str
values:
Expand Down
4 changes: 4 additions & 0 deletions plugins/modules/cloud/dimensiondata/dimensiondata_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,25 @@
description:
- The name of the network domain to create.
required: true
type: str
description:
description:
- Additional description of the network domain.
required: false
type: str
service_plan:
description:
- The service plan, either "ESSENTIALS" or "ADVANCED".
- MCP 2.0 Only.
choices: [ESSENTIALS, ADVANCED]
default: ESSENTIALS
type: str
state:
description:
- Should the resource be present or absent.
choices: [present, absent]
default: present
type: str
'''

EXAMPLES = '''
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/cloud/dimensiondata/dimensiondata_vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,33 @@
name:
description:
- The name of the target VLAN.
- Required if C(state) is C(present).
type: str
required: true
description:
description:
- A description of the VLAN.
type: str
network_domain:
description:
- The Id or name of the target network domain.
required: true
type: str
private_ipv4_base_address:
description:
- The base address for the VLAN's IPv4 network (e.g. 192.168.1.0).
type: str
private_ipv4_prefix_size:
description:
- The size of the IPv4 address space, e.g 24.
- Required, if C(private_ipv4_base_address) is specified.
type: int
state:
description:
- The desired state for the target VLAN.
- C(readonly) ensures that the state is only ever read, not modified (the module will fail if the resource does not exist).
choices: [present, absent, readonly]
default: present
type: str
allow_expand:
description:
- Permit expansion of the target VLAN's network if the module parameters specify a larger network than the VLAN currently possesses.
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/cloud/docker/docker_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
referring to the path of the compose file on the target host
or the YAML contents of a compose file nested as dictionary.
type: list
# elements: raw
elements: raw
default: []
prune:
description:
Expand Down
4 changes: 4 additions & 0 deletions plugins/modules/cloud/heroku/heroku_collaborator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
- heroku3
options:
api_key:
type: str
description:
- Heroku API key
apps:
type: list
description:
- List of Heroku App names
required: true
Expand All @@ -33,10 +35,12 @@
type: bool
default: "no"
user:
type: str
description:
- User ID or e-mail
required: true
state:
type: str
description:
- Create or remove the heroku collaborator
choices: ["present", "absent"]
Expand Down
3 changes: 3 additions & 0 deletions plugins/modules/cloud/huawei/hwc_ecs_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
network of the NIC must belong to the VPC specified by vpc_id. A
maximum of 12 NICs can be attached to an ECS.
type: list
elements: dict
required: true
suboptions:
ip_address:
Expand Down Expand Up @@ -150,6 +151,7 @@
description:
- Specifies the data disks of ECS instance.
type: list
elements: dict
required: false
suboptions:
volume_id:
Expand Down Expand Up @@ -193,6 +195,7 @@
parameter is left blank, the default security group is bound to
the ECS by default.
type: list
elements: str
required: false
server_metadata:
description:
Expand Down
3 changes: 3 additions & 0 deletions plugins/modules/cloud/huawei/hwc_vpc_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
- Specifies a set of zero or more allowed address pairs.
required: false
type: list
elements: dict
suboptions:
ip_address:
description:
Expand All @@ -72,6 +73,7 @@
description:
- Specifies the extended option of DHCP.
type: list
elements: dict
required: false
suboptions:
name:
Expand Down Expand Up @@ -99,6 +101,7 @@
description:
- Specifies the ID of the security group.
type: list
elements: str
required: false
extends_documentation_fragment:
- community.general.hwc
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/cloud/huawei/hwc_vpc_subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
- Specifies the DNS server addresses for subnet. The address
in the head will be used first.
type: list
elements: str
required: false
extends_documentation_fragment:
- community.general.hwc
Expand Down
25 changes: 23 additions & 2 deletions plugins/modules/cloud/linode/linode.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,77 +18,92 @@
- Indicate desired state of the resource
choices: [ absent, active, deleted, present, restarted, started, stopped ]
default: present
type: str
api_key:
description:
- Linode API key
type: str
name:
description:
- Name to give the instance (alphanumeric, dashes, underscore).
- To keep sanity on the Linode Web Console, name is prepended with C(LinodeID-).
required: true
type: str
displaygroup:
description:
- Add the instance to a Display Group in Linode Manager.
type: str
linode_id:
description:
- Unique ID of a linode server. This value is read-only in the sense that
if you specify it on creation of a Linode it will not be used. The
Linode API generates these IDs and we can those generated value here to
reference a Linode more specifically. This is useful for idempotence.
aliases: [ lid ]
type: int
additional_disks:
description:
- List of dictionaries for creating additional disks that are added to the Linode configuration settings.
- Dictionary takes Size, Label, Type. Size is in MB.
type: list
alert_bwin_enabled:
description:
- Set status of bandwidth in alerts.
type: bool
alert_bwin_threshold:
description:
- Set threshold in MB of bandwidth in alerts.
type: int
alert_bwout_enabled:
description:
- Set status of bandwidth out alerts.
type: bool
alert_bwout_threshold:
description:
- Set threshold in MB of bandwidth out alerts.
type: int
alert_bwquota_enabled:
description:
- Set status of bandwidth quota alerts as percentage of network transfer quota.
type: bool
alert_bwquota_threshold:
description:
- Set threshold in MB of bandwidth quota alerts.
type: int
alert_cpu_enabled:
description:
- Set status of receiving CPU usage alerts.
type: bool
alert_cpu_threshold:
description:
- Set percentage threshold for receiving CPU usage alerts. Each CPU core adds 100% to total.
type: int
alert_diskio_enabled:
description:
- Set status of receiving disk IO alerts.
type: bool
alert_diskio_threshold:
description:
- Set threshold for average IO ops/sec over 2 hour period.
type: int
backupweeklyday:
description:
- Integer value for what day of the week to store weekly backups.
type: int
plan:
description:
- plan to use for the instance (Linode plan)
type: int
payment_term:
description:
- payment term to use for the instance (payment term in months)
default: 1
choices: [ 1, 12, 24 ]
type: int
password:
description:
- root password to apply to a new server (auto generated if missing)
type: str
private_ip:
description:
- Add private IPv4 address when Linode is created.
Expand All @@ -97,28 +112,34 @@
ssh_pub_key:
description:
- SSH public key applied to root user
type: str
swap:
description:
- swap size in MB
default: 512
type: int
distribution:
description:
- distribution to use for the instance (Linode Distribution)
type: int
datacenter:
description:
- datacenter to create an instance in (Linode Datacenter)
type: int
kernel_id:
description:
- kernel to use for the instance (Linode Kernel)
type: int
wait:
description:
- wait for the instance to be in state C(running) before returning
type: bool
default: "no"
default: true
wait_timeout:
description:
- how long before wait gives up, in seconds
default: 300
type: int
watchdog:
description:
- Set status of Lassie watchdog.
Expand Down Expand Up @@ -337,7 +358,7 @@ def linodeServers(module, api, state, name,
if not servers:
for arg in (name, plan, distribution, datacenter):
if not arg:
module.fail_json(msg='%s is required for %s state' % (arg, state))
module.fail_json(msg='%s is required for %s state' % (arg, state)) # @TODO use required_if instead
# Create linode entity
new_server = True

Expand Down
1 change: 1 addition & 0 deletions plugins/modules/cloud/linode/linode_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
the C(LINODE_ACCESS_TOKEN) environment variable. See
U(https://www.linode.com/docs/api#access-and-authentication).
required: true
type: str
stackscript_id:
description:
- The numeric ID of the StackScript to use when creating the instance.
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/cloud/memset/memset_dns_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
options:
api_key:
required: true
type: str
description:
- The API key obtained from the Memset control panel.
poll:
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/cloud/memset/memset_memstore_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
options:
api_key:
required: true
type: str
description:
- The API key obtained from the Memset control panel.
name:
required: true
type: str
description:
- The Memstore product name (i.e. C(mstestyaa1)).
'''
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/cloud/memset/memset_server_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
options:
api_key:
required: true
type: str
description:
- The API key obtained from the Memset control panel.
name:
required: true
type: str
description:
- The server product name (i.e. C(testyaa1)).
'''
Expand Down
4 changes: 4 additions & 0 deletions plugins/modules/cloud/memset/memset_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,25 @@
required: true
description:
- Indicates desired state of resource.
type: str
choices: [ absent, present ]
api_key:
required: true
description:
- The API key obtained from the Memset control panel.
type: str
name:
required: true
description:
- The zone nickname; usually the same as the main domain. Ensure this
value has at most 250 characters.
type: str
aliases: [ nickname ]
ttl:
description:
- The default TTL for all records created in the zone. This must be a
valid int from U(https://www.memset.com/apidocs/methods_dns.html#dns.zone_create).
type: int
choices: [ 0, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400 ]
force:
required: false
Expand Down
Loading

0 comments on commit 3d1f9ed

Please sign in to comment.