---
- hosts: localhost
  vars_files:
    - vars/main.yaml
  roles:
    - create-vm-haproxy

- name: Deploy ha proxy server
  hosts: haproxy_group
  vars_files:
    - vars/main.yaml
  roles:
    - rhsm
    - vmware-guest-setup
  ignore_errors: yes

- name: Configure ha proxy server
  hosts: haproxy_group
  vars_files:
    - vars/main.yaml
  roles:
    - haproxy-server

- name: Configure ha proxy server files
  hosts: haproxy_group, master, infra
  serial: 1
  remote_user: root
  gather_facts: yes
  vars_files:
    - vars/main.yaml
  roles:
    - instance-groups
    - haproxy-server-config
