I got this pb. In stead of waiting for port 443 available. I need to have 
it shows as available or back in a connected state or in maintenance mode 
in vcenter then exit maintenance mode. any idea how?

- name: test

  hosts: all

  gather_facts: no

  vars_files:

    - vcenter_creds.yml

    - vars.yml

 

  tasks:

 

    - name: Enable SSH service

      vmware_host_service_manager:

        hostname: '{{ vcenter_hostname }}'

        username: '{{ vcenter_admin }}'

        password: '{{ vcenter_admin_pass }}'

        esxi_hostname: "{{ inventory_hostname }}"

        validate_certs: no

        state: present

        service_name: "TSM-SSH"

      delegate_to: localhost

 

    - name: Esxcli

      shell:

        cmd: '{{ cmd }}'

      register: esxcli_output

 

    - name: Display esxcli output

      debug:

        var: esxcli_output.stdout_lines

 

    - name: Reboot ESXi host

      vmware_host_powerstate:

        hostname: '{{ vcenter_hostname }}'

        username: '{{ vcenter_admin }}'

        password: '{{ vcenter_admin_pass }}'

        esxi_hostname: "{{ inventory_hostname }}"

        validate_certs: no

        state: reboot-host

      delegate_to: localhost

 

    - name: Wait for ESXi host to become available

      wait_for:

        host: "{{ inventory_hostname }}"

        port: 443

        delay: 10

        timeout: 300

        state: started

      delegate_to: localhost





-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/30bbec4d-3f96-45e2-99d3-0c7ff396bd05n%40googlegroups.com.

Reply via email to