Skip to content

Instantly share code, notes, and snippets.

@bedecarroll
Created December 6, 2015 05:52
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bedecarroll/9af1bde860dfd2199e5d to your computer and use it in GitHub Desktop.
Save bedecarroll/9af1bde860dfd2199e5d to your computer and use it in GitHub Desktop.
Ansible playbook to install the VMware ESXi Embedded Host Client. Requires the VIB (esxui-signed.vib) to be in the folder as the playbook. Will install or upgrade as required.
---
- hosts: esxi
tasks:
- name: Get list of installed VIBs
shell: esxcli software vib get -n "esx-ui"
register: vibs
changed_when: false
ignore_errors: yes
- debug: var=vibs.stdout
- name: Copy esxui-signed.vib to ESXi Host
copy: src=esxui-signed.vib dest=/tmp/esxui-signed.vib
- name: Run an upgrade if VIB is already installed
shell: esxcli software vib update -v /tmp/esxui-signed.vib
when: "'VMware_bootbank_esx-ui' in vibs.stdout"
- name: If not installed, install it
shell: esxcli software vib install -v /tmp/esxui-signed.vib
- name: Remove ui line from rhttpproxy
lineinfile: dest=/etc/vmware/rhttpproxy/endpoints.conf state=absent regexp="/ui local 8308 redirect allow"
notify: restart rhttpproxy
- name: Confirm VIB is installed
shell: esxcli software vib get -n "esx-ui"
register: vibs
changed_when: false
ignore_errors: yes
- debug: var=vibs.stdout
handlers:
- name: restart rhttpproxy
shell: /etc/init.d/rhttpproxy restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment