1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/vmware_host_powerstate/tasks/main.yml
Gonéri Le Bouder 636f8cbdab
Merge pull request #55730 from goneri/vmware_refact_part5
vmware: refactoring of vmware test roles -- part5
2019-05-02 09:28:17 -04:00

34 lines
1.1 KiB
YAML

# Test code for the vmware_host_powerstate module.
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# TODO: vcsim does not support Powerstate related to operations
- when: False
block:
- import_role:
name: prepare_vmware_tests
vars:
setup_attach_host: true
# https://kb.vmware.com/s/article/2001651?lang=en_US
# It seems like we need a Power managment interface to be able to run the
# module.
# I currently get:
# "Failed to power down '192.168.123.7' to standby as host system due to : ('The operation is not supported on the object.', None)"
- name: Restart Host
vmware_host_powerstate:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: False
state: power-down-to-standby
esxi_hostname: '{{ hostvars[esxi1].ansible_host }}'
force: True
register: host_powerstate
- debug: var=host_powerstate
- assert:
that:
- host_powerstate.results is changed