Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup VMware module docs issues #36409

Merged
merged 9 commits into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/ansible/modules/cloud/vmware/_vsphere_guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
- The hostname of the vcenter server the module will connect to, to create the guest.
required: true
default: null
aliases: []
validate_certs:
description:
- Validate SSL certs. Note, if running on python without SSLContext
Expand All @@ -39,7 +38,7 @@
never validate on python <= 2.7.8.
required: false
default: yes
choices: ['yes', 'no']
type: bool
version_added: 2.1
guest:
description:
Expand Down Expand Up @@ -83,7 +82,7 @@
- Specifies if the VM should be deployed from a template (mutually exclusive with 'state' parameter). No guest customization changes to hardware
such as CPU, RAM, NICs or Disks can be applied when launching from template.
default: no
choices: ['yes', 'no']
type: bool
template_src:
version_added: "1.9"
description:
Expand All @@ -100,7 +99,7 @@
- Specifies if the VM should be powered on after the clone.
required: false
default: yes
choices: ['yes', 'no']
type: bool
vm_disk:
description:
- A key, value list of disks and their sizes and which datastore to keep it in.
Expand Down Expand Up @@ -131,13 +130,13 @@
vmware_guest_facts:
description:
- Gather facts from vCenter on a particular VM
required: false
type: bool
default: null
force:
description:
- Boolean. Allows you to run commands which may alter the running state of a guest. Also used to reconfigure and destroy.
default: "no"
choices: [ "yes", "no" ]
type: bool

notes:
- This module should run from a system that can access vSphere directly.
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/modules/cloud/vmware/vca_nat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
purge_rules:
description:
- If set to true, it will delete all rules in the gateway that are not given as parameter to this module.
required: false
type: bool
default: false
nat_rules:
description:
Expand Down
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/vmware/vca_vapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
- The name of the virtual data center (VDC) where the vm should be created or contains the vAPP.
required: false
default: None
extends_documentation_fragment: vca
'''

EXAMPLES = '''
Expand Down
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/vmware/vcenter_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
- This option is ignored, if C(parent_folder) is set.
default: vm
required: False
choices: [ datastore, host, network, vm ]
state:
description:
- State of folder.
Expand Down
19 changes: 5 additions & 14 deletions lib/ansible/modules/cloud/vmware/vcenter_license.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,13 @@
requirements:
- pyVmomi
options:
hostname:
description:
- The hostname or IP address of the vSphere vCenter.
required: yes
username:
description:
- The username to log into the vSphere vCenter.
required: yes
aliases: [admin, user]
password:
description:
- The password to log into to the vSphere vCenter.
required: yes
aliases: [pass, pwd]
labels:
description:
- The optional labels of the license key to manage in vSphere vCenter.
- This is dictionary with key/value pair.
default: {
'source': 'ansible'
}
license:
description:
- The license key to manage in vSphere vCenter.
Expand All @@ -67,6 +56,7 @@
an evaluation license only.
- The evaluation license (00000-00000-00000-00000-00000) is not listed
when unused.
extends_documentation_fragment: vmware.documentation
'''

EXAMPLES = r'''
Expand Down Expand Up @@ -204,5 +194,6 @@ def main():

module.exit_json(**result)


if __name__ == '__main__':
main()
3 changes: 2 additions & 1 deletion lib/ansible/modules/cloud/vmware/vmware_dvs_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
state:
description:
- If the host should be present or absent attached to the vSwitch.
choices: [present, absent]
choices: [ present, absent ]
required: True
default: 'present'
extends_documentation_fragment: vmware.documentation
'''

Expand Down
27 changes: 27 additions & 0 deletions lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
description:
- Determines if the portgroup should be present or not.
required: True
type: bool
choices:
- 'present'
- 'absent'
Expand All @@ -71,6 +72,7 @@
- Indicates whether this is a VLAN trunk or not.
required: False
default: False
type: bool
version_added: '2.5'
network_policy:
description:
Expand All @@ -81,6 +83,11 @@
- '- C(mac_changes) (bool): indicates whether mac changes are allowed. (default: false)'
required: False
version_added: '2.5'
default: {
promiscuous: False,
forged_transmits: False,
mac_changes: False,
}
teaming_policy:
description:
- Dictionary which configures the different teaming values for portgroup.
Expand All @@ -92,6 +99,12 @@
- '- C(rolling_order) (bool): Indicate whether or not to use a rolling policy when restoring links. (default: False)'
required: False
version_added: '2.5'
default: {
'notify_switches': True,
'load_balance_policy': 'loadbalance_srcid',
'inbound_policy': False,
'rolling_order': False
}
port_policy:
description:
- Dictionary which configures the advanced policy settings for the portgroup.
Expand All @@ -109,6 +122,20 @@
- '- C(vlan_override) (bool): indicates if the vlan can be changed per port. (default: false)'
required: False
version_added: '2.5'
default: {
'traffic_filter_override': False,
'network_rp_override': False,
'live_port_move': False,
'security_override': False,
'vendor_config_override': False,
'port_config_reset_at_disconnect': True,
'uplink_teaming_override': False,
'block_override': True,
'shaping_override': False,
'vlan_override': False,
'ipfix_override': False
}

extends_documentation_fragment: vmware.documentation
'''

Expand Down
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/vmware/vmware_guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
- If this value is not set, VM is created without using a template.
- If the VM exists already this setting will be ignored.
- This parameter is case sensitive.
aliases: [ 'template_src' ]
is_template:
description:
- Flag the instance as a template.
Expand Down
10 changes: 6 additions & 4 deletions lib/ansible/modules/cloud/vmware/vmware_guest_file_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,30 @@
required: True
directory:
description:
- Create or delete directory
- Create or delete directory.
- 'Valid attributes are:'
- ' path: directory path to create or remove'
- ' operation: Valid values are create, delete'
- ' recurse (boolean): Not required, default (false)'
required: False
copy:
description:
- Copy file to vm networkless
- Copy file to vm without requiring network.
- 'Valid attributes are:'
- ' src: file source absolute or relative'
- ' dest: file destination, path must be exist'
- ' overwrite: False or True (not required, default False)'
required: False
file:
fetch:
description:
- Get file from vm networkless
- Get file from virtual machine without requiring network.
- 'Valid attributes are:'
- ' src: The file on the remote system to fetch. This I(must) be a file, not a directory'
- ' dest: file destination on localhost, path must be exist'
required: False
version_added: 2.5

extends_documentation_fragment: vmware.documentation
'''

EXAMPLES = '''
Expand Down
14 changes: 11 additions & 3 deletions lib/ansible/modules/cloud/vmware/vmware_guest_powerstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
state:
description:
- Set the state of the virtual machine.
choices: [ powered-off, powered-on, reboot-guest, restarted, shutdown-guest, suspended ]
choices: [ powered-off, powered-on, reboot-guest, restarted, shutdown-guest, suspended, present]
default: present
name:
description:
- Name of the virtual machine to work with.
Expand Down Expand Up @@ -64,6 +65,13 @@
- Date and time in string format at which specificed task needs to be performed.
- "The required format for date and time - 'dd/mm/yyyy hh:mm'."
- Scheduling task requires vCenter server. A standalone ESXi server does not support this option.
force:
description:
- Ignore warnings and complete the actions.
- This parameter is useful while forcing virtual machine state.
default: False
type: bool
version_added: 2.5
state_change_timeout:
description:
- If the C(state) is set to C(shutdown-guest), by default the module will return immediately after sending the shutdown signal.
Expand Down Expand Up @@ -130,7 +138,7 @@ def main():
argument_spec = vmware_argument_spec()
argument_spec.update(
state=dict(type='str', default='present',
choices=['powered-off', 'powered-on', 'reboot-guest', 'restarted', 'shutdown-guest', 'suspended']),
choices=['present', 'powered-off', 'powered-on', 'reboot-guest', 'restarted', 'shutdown-guest', 'suspended']),
name=dict(type='str'),
name_match=dict(type='str', choices=['first', 'last'], default='first'),
uuid=dict(type='str'),
Expand Down Expand Up @@ -202,7 +210,7 @@ def main():
"given are invalid: %s" % (module.params.get('state'),
to_native(e.msg)))
else:
result = set_vm_power_state(pyv.content, vm, module.params['state'], module.params['force'], module.params['state_change_timeout'])
result = set_vm_power_state(pyv.content, vm, module.params['state'], module.params['force'])
else:
module.fail_json(msg="Unable to set power state for non-existing virtual machine : '%s'" % (module.params.get('uuid') or module.params.get('name')))

Expand Down
8 changes: 8 additions & 0 deletions lib/ansible/modules/cloud/vmware/vmware_guest_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- Manage snapshots attached to a specific virtual machine.
required: True
choices: ['present', 'absent', 'revert', 'remove_all']
default: 'present'
name:
description:
- Name of the VM to work with
Expand Down Expand Up @@ -75,6 +76,7 @@
description:
description:
- Define an arbitrary description to attach to snapshot.
default: ''
quiesce:
description:
- If set to C(true) and virtual machine is powered on, it will quiesce the
Expand All @@ -86,6 +88,8 @@
this flag is set to C(false).
required: False
version_added: "2.4"
type: bool
default: False
memory_dump:
description:
- If set to C(true), memory dump of virtual machine is also included in snapshot.
Expand All @@ -94,12 +98,16 @@
this flag is set to C(false).
required: False
version_added: "2.4"
type: bool
default: False
remove_children:
description:
- If set to C(true) and state is set to C(absent), then entire snapshot subtree is set
for removal.
required: False
version_added: "2.4"
type: bool
default: False
new_snapshot_name:
description:
- Value to rename the existing snapshot to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def main():
argument_spec = vmware_argument_spec()
argument_spec.update(
name=dict(type='str'),
name_match=dict(type='str', default='first'),
name_match=dict(type='str', default='first', choices=['first', 'last']),
folder=dict(type='str'),
uuid=dict(type='str'),
)
Expand Down
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/vmware/vmware_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
- "Use following command to get hostsystem's certificate's thumbprint - "
- "# openssl x509 -in /etc/vmware/ssl/rui.crt -fingerprint -sha1 -noout"
version_added: 2.5
default: ''
extends_documentation_fragment: vmware.documentation
'''

Expand Down
1 change: 1 addition & 0 deletions lib/ansible/modules/cloud/vmware/vmware_host_acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- If set to C(present), then will set given acceptance level.
choices: [ list, present ]
required: False
default: 'list'
acceptance_level:
description:
- Name of acceptance level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
description:
- A dictionary of advance configuration parameter.
- Invalid configuration parameters are ignored.
default: {}
extends_documentation_fragment: vmware.documentation
'''

Expand Down
2 changes: 2 additions & 0 deletions lib/ansible/modules/cloud/vmware/vmware_host_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
description:
- Type of the datastore to configure (nfs/vmfs).
required: true
choices: [ 'nfs', 'vmfs' ]
nfs_server:
description:
- NFS host serving nfs datastore.
Expand All @@ -54,6 +55,7 @@
- ReadOnly or ReadWrite mount.
- Unused if datastore type is not set to C(nfs) and state is not set to C(present).
default: False
type: bool
vmfs_device_name:
description:
- Name of the device to be used as VMFS datastore.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- Each member of list is rule set name and state to be set the rule.
- Both rule name and rule state are required parameters.
- Please see examples for more information.
default: []
extends_documentation_fragment: vmware.documentation
'''

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@
- "State value 'start' and 'present' has same effect."
- "State value 'stop' and 'absent' has same effect."
choices: [ absent, present, restart, start, stop ]
default: 'start'
service_policy:
description:
- Set of valid service policy strings.
- If set C(on), then service should be started when the host starts up.
- If set C(automatic), then service should run if and only if it has open firewall ports.
- If set C(off), then Service should not be started when the host starts up.
choices: [ 'automatic', 'off', 'on' ]
service_name:
description:
- Name of Service to be managed. This is brief identifier for the service, for example, ntpd, vxsyslogd etc.
Expand Down