---
- name: Gather facts
  openshift_facts:
    role: common

- name: use the default project
  shell: "{{ openshift.common.client_binary }} project default"

- name: Count the infrastructure nodes
  shell: "{{ openshift.common.client_binary }}  get nodes --show-labels | grep role=infra -c"
  register: nodes
  when: node_type == "infra"

- name: Scale the router
  shell: "{{ openshift.common.client_binary }} scale dc/router --replicas={{ nodes.stdout }}"
  when: node_type == "infra"
