---
###########################
# REST API variables
###########################
#engine_url: https://engine."{{ public_hosted_zone }}"/ovirt-engine/api
#engine_user: admin@internal
#engine_password: changeme
#engine_cafile: /etc/pki/ovirt-engine/ca.pem
#engine_cafile: ../playbooks/vars/ca.pem

###########################
# Common
###########################
compatibility_version: 4.1

# Data center
data_center_name: Default

###########################
# Clusters
###########################
clusters:
  - name: "{{ rhv_cluster }}"
    cpu_type: Intel Conroe Family
    profile: Default
    ha_reservation: true

###########################
# Hosts
###########################
#hosts:
#  - name: hypervisor200
#    address: 192.168.155.200
#    cluster: "{{ rhv_cluster }}"
#    password: changeme
#  - name: hypervisor201
#    address: 192.168.155.201
#    cluster: "{{ rhv_cluster }}"
#    password: changeme
#  - name: hypervisor202
#    address: 192.168.155.202
#    cluster: "{{ rhv_cluster }}"
#    password: changeme

###########################
# Storage (used to create storage in RHV)
###########################
#storages:
#  my_data_storage:
#    master: true
#    state: present
#    nfs:
#      address: 192.168.155.10
#      path: /var/lib/exports/vms
#  my_export_storage:
#    domain_function: export
#    nfs:
#      address: 192.168.155.10
#      path: /var/lib/exports/exports
#  myiscsistorage:
#    iscsi:
#      target: iqn.2014-07.org.ovirt:storage
#      port: 3260
#      address: 192.168.200.3
#      username: username
#      password: password
#      lun_id: 3600140551fcc8348ea74a99b6760fbb4
#  myisostorage:
#    domain_function: iso
#    nfs:
#      address: 192.168.155.10
#      path: /var/lib/exports/iso

###########################
# Networks
###########################
#logical_networks:
# - name: mynetwork
#   clusters:
#    - name: development
#      assigned: false
#      required: true
#      display: false
#      migration: true
#      gluster: false

#host_networks:
# - name: myhost1
#   check: true
#   save: true
#   bond:
#    name: bond0
#    mode: 2
#    interfaces:
#     - eth2
#     - eth3
#   networks:
#    - name: mynetwork
#      boot_protocol: dhcp

###########################
# Users & Groups
###########################
#users:
# - name: user1
#   authz_name: internal-authz
#   password: changeme8
#   valid_to: "2018-01-01 00:00:00Z"
# - name: user2
#   authz_name: internal-authz
#   password: changeme8
#   valid_to: "2018-01-01 00:00:00Z"

#user_groups:
# - name: group1
#   authz_name: internal-authz
#   users:
#    - user1

#permissions:
# - state: present
#   user_name: user1
#   authz_name: internal-authz
#   role: UserRole
#   object_type: cluster
#   object_name: Default

# - state: present
#   group_name: group1
#   authz_name: internal-authz
#   role: UserRole
#   object_type: cluster
#   object_name: Default


##########################
# VM infra
##########################
#qcow_url: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
#qcow_url: https://satellite."{{ public_hosted_zone }}"/pub/rhel-guest-image-7.3-35.x86_64.qcow2
template_cluster: "{{ rhv_cluster }}"
template_name: rhel7
template_memory: 4GiB
template_cpu: 1
template_disk_size: 20GiB
template_nics:
  - name: nic1
    profile_name: ovirtmgmt
    interface: virtio

master_vm:
  cluster: "{{ rhv_cluster }}"
  ssh_key: "{{ root_ssh_key }}"
  domain: "{{ public_hosted_zone }}"
  template: rhel7
  memory: 16GiB
  cores: 2
  high_availability: true
  disks:
    - size: 40GiB
      name: docker_disk
      storage_domain: "{{ rhv_data_storage }}"
      interface: virtio
    - size: 40GiB
      name: etcd_disk
      storage_domain: "{{ rhv_data_storage }}"
      interface: virtio

node_vm:
  cluster: "{{ rhv_cluster }}"
  ssh_key: "{{ root_ssh_key }}"
  domain: "{{ public_hosted_zone }}"
  template: rhel7
  memory: 8GiB
  cores: 1
  disks:
    - size: 20GiB
      name: docker_disk
      storage_domain: "{{ rhv_data_storage }}"
      interface: virtio
    - size: 15GiB
      name: localvol_disk
      storage_domain: "{{ rhv_data_storage }}"
      interface: virtio

infra_vm:
  cluster: "{{ rhv_cluster }}"
  ssh_key: "{{ root_ssh_key }}"
  domain: "{{ public_hosted_zone }}"
  template: rhel7
  memory: 8GiB
  cores: 2
  high_availability: true
  disks:
    - size: 20GiB
      name: docker_disk
      storage_domain: "{{ rhv_data_storage }}"
      interface: virtio
    - size: 15GiB
      name: localvol_disk
      storage_domain: "{{ rhv_data_storage }}"
      interface: virtio

lb_vm:
  cluster: "{{ rhv_cluster }}"
  ssh_key: "{{ root_ssh_key }}"
  domain: "{{ public_hosted_zone }}"
  template: rhel7
  memory: 8GiB
  cores: 1
  high_availability: true
  disks:
    - size: 20GiB
      name: docker_disk
      storage_domain: "{{ rhv_data_storage }}"
      interface: virtio
    - size: 15GiB
      name: localvol_disk
      storage_domain: "{{ rhv_data_storage }}"
      interface: virtio

vms:
  # Node VMs
  - name: openshift-node-0
    tag: openshift_node
    profile: "{{ node_vm }}"
  - name: openshift-node-1
    tag: openshift_node
    profile: "{{ node_vm }}"

  # Infra VMs
  - name: openshift-infra-0
    tag: openshift_infra
    profile: "{{ infra_vm }}"
  - name: openshift-infra-1
    tag: openshift_infra
    profile: "{{ infra_vm }}"

  # Master VMs
  - name: openshift-master-0
    profile: "{{ master_vm }}"
    tag: openshift_master
  - name: openshift-master-1
    tag: openshift_master
    profile: "{{ master_vm }}"
  - name: openshift-master-2
    tag: openshift_master
    profile: "{{ master_vm }}"

  # Load balancer
  - name: openshift-lb
    tag: openshift_lb
    profile: "{{ lb_vm }}"

affinity_groups:
  - name: masters_ag
    cluster: "{{ rhv_cluster }}"
    vm_enforcing: false
    vm_rule: negative
    vms:
      - openshift-master-0
      - openshift-master-1
      - openshift-master-2
    wait: true
  - name: infra_ag
    cluster: "{{ rhv_cluster }}"
    vm_enforcing: false
    vm_rule: negative
    vms:
      - openshift-infra-0
      - openshift-infra-1
      - openshift-lb
    wait: true

  - name: app_ag
    cluster: "{{ rhv_cluster }}"
    vm_enforcing: false
    vm_rule: negative
    vms:
      - openshift-node-0
      - openshift-node-1
...
