简体   繁体   中英

Ansible Restarting VMware vCenter Server Appliance

I would like to simply reboot the VCSA using Ansible as part of a development workflow. Does anybody have any ideas as to how to do so?

https://kb.vmware.com/s/article/2147152

This would normally be done by hitting 'shell' and then turning off/on the service and/or 'reboot'

I've been playing around with ansible.raw, but it seems to hang indefinitely.

A few of the attempts I have tried:

tasks:

- name: 'get into the shell'
  raw: 'shell'
  register: shell
- debug: msg="{{ shell }}"

- name: 'reboot'
  raw: 'reboot'
  register: reboot
- debug: msg="{{ reboot }}"

- name: Unconditionally reboot the machine with all defaults
  reboot:

I resolved this by manually going into every system and changing the default shell to /bin/bash

https://communities.vmware.com/t5/vCenter-Server-Discussions/Access-to-VCSA-through-SSH-and-or-local-console-is-NOT-working/td-p/1816293

############

~# vi /etc/passwd

and change the appliancesh to /bin/bash

root:x:0:0:root:/root:/bin/bash

Also make sure that ssh access for root is enabled from /etc/ssh/sshd_config

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM