- name: Start the OpenShift cluster hosts: localhost gather_facts: no become: no vars: lb: '{{ nodes | selectattr("role", "eq", "lb") | first }}' storage: '{{ nodes | selectattr("role", "eq", "storage") | first }}' workers: '{{ nodes | selectattr("role", "eq", "worker") | list }}' masters: '{{ nodes | selectattr("role", "eq", "master") | list }}' tasks: - name: Start the Load Balancer and the Storage community.libvirt.virt: name: '{{ item.name }}' state: running uri: '{{ lookup("env", "LIBVIRT_DEFAULT_URI") }}' loop: - '{{ lb }}' - '{{ storage }}' loop_control: label: "{{ item.name }}" - name: Wait for the Load Balancer to appear wait_for: port: 443 host: '{{ lb.ip }}' - name: Wait for the NFS Server to appear wait_for: port: 2049 host: '{{ storage.ip }}' - name: Start the Workers and the Masters community.libvirt.virt: name: '{{ item.name }}' state: running uri: '{{ lookup("env", "LIBVIRT_DEFAULT_URI") }}' loop: '{{ masters + workers }}' loop_control: label: "{{ item.name }}"