- hosts: frontend
  remote_user: ubuntu
  become: true
  gather_facts: yes


  vars_files:
    - variables.yml


  post_tasks:
    - include_tasks: include_event.yml
      vars:
        application: deploy_frontend


  tasks:

    - include_tasks: include_deploy_boot.yml
      vars:
        application: frontend

- hosts: frontend
  remote_user: ubuntu
  become: true
  gather_facts: yes


  vars_files:
    - variables.yml


  post_tasks:
    - include_tasks: include_event.yml
      vars:
        application: deploy_frontend


  tasks:

    # Check that we can reach services on the monitor instance
    - name: Check all port numbers are accessible from current host
      wait_for:
        host: "monitor.{{ domain }}"
        port: "{{ item }}"
        state: started
        delay: 0
        timeout: 3
      with_items:
        - 8200

    - include_tasks: include_deploy_boot.yml
      vars:
        application: frontend

ADD a check if required ports are open
ADD a check if required ports are open
