Skip to content

Instantly share code, notes, and snippets.

@thetuxracer
Created November 22, 2018 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thetuxracer/09f6d1b26a657b6abc94e44ef0a69508 to your computer and use it in GitHub Desktop.
Save thetuxracer/09f6d1b26a657b6abc94e44ef0a69508 to your computer and use it in GitHub Desktop.
# Gist for ansible/ansible#48976
- name: Reboot the vm
vmware_guest:
name: jenkins-{{ lookup('env', 'BUILD_NUMBER') }}
hostname: "{{ lookup('env', 'VSPHERE_SERVER') }}"
username: "{{ lookup('env', 'KP_AD_USERNAME') }}"
password: "{{ lookup('env', 'VSPHERE_PWD') }}"
validate_certs: false
state: reboot-guest
─$ ansible-playbook --connection=local reboot_vm.yml 130 ↵
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost
does not match 'all'
PLAY [localhost] *****************************************************************************************
TASK [Gathering Facts] ***********************************************************************************
ok: [localhost]
TASK [Reboot the vm] *************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "value of state must be one of: absent, poweredoff, poweredon, present, rebootguest, restarted, shutdownguest, suspended, got: reboot-guest"}
to retry, use: --limit @/media/sf_workspace/icce_automation/test_before_role.retry
PLAY RECAP ***********************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment