vmware_drs - Create VMWare DRS Rule¶
New in version 2.3.
Options¶
parameter | required | default | choices | comments |
---|---|---|---|---|
cluster |
yes | The cluster name for the DRS rule. | ||
force_update |
no | false |
|
Force an update. Performs a delete and create. Note: Task will always be marked as changed. |
gather_facts |
no | false |
|
If set to true , fact gather only.Return rules defined on cluster. If vms are defined, return vm facts. |
hostname |
yes | The hostname or IP address of the vSphere vCenter. | ||
keep_together |
no |
|
Required when state is set to present .Set to true will create an Affinity rule.Set to false will create an AntiAffinity rule.Use force_update to change an existing rule. | |
name |
no | The name of the DRS rule to manage. Required when gather_facts is false | ||
password |
yes | The password of the vSphere vCenter. | ||
state |
no | present |
|
Create or delete the DRS rule. |
username |
yes | The username of the vSphere vCenter. | ||
validate_certs |
no | true |
|
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted. |
vms |
no | A list of vms for the DRS rule. Required when state is present |
Examples¶
# gather facts on cluster and vms - vmware_drs: hostname: "vcenter.example.com" username: "vcuser" password: "vcpass" cluster: "Cluster Name" gather_facts: true vms: - vma - vmb # gather facts on just cluster - vmware_drs: hostname: "vcenter.example.com" username: "vcuser" password: "vcpass" cluster: "Cluster Name" gather_facts: true # create vmware drs rule - vmware_drs: hostname: "vcenter.example.com" username: "vcuser" password: "vcpass" cluster: "Cluster Name" name: "drs-rule-name" vms: - vma - vmb keep_together: false # delete vmware drs rule - vmware_drs: hostname: "vcenter.example.com" username: "vcuser" password: "vcpass" cluster: "vcenter-cluster" state: "absent" name: "drs-rule-name"