<%
# Example 01 contains a single file designed to assist in providing the initial
# configuration for an rXg. That rXg can then be configured as a standalone rXg,
# or a cluster member.

# To make this configuration mergable with other configurations, the top-level
# YAML shall be an array.

admin_login ||= 'testadmin'
admin_password ||= 'testPassword1!'
admin_ssh_key ||= ''
fqdn ||= 'rxg.example.com'
time_zone ||= 'America/Chicago'
wan_interface ||= 'em0'
wan_cidr ||= '10.255.255.11/24'
wan_speed_mbps ||= 100
license_key ||= <<-BLOCK
INSERT LICENSE HERE
BLOCK

# calculated variables
wan_gateway ||= IPAddr.new(wan_cidr).to_range.first(2)[1]
%>

- license_key: <%= license_key.dump %>

- admins:
  - login: <%= admin_login %>
    password: '<%= admin_password %>'
    password_confirmation: '<%= admin_password %>'
    ssh_public_key: '<%= admin_ssh_key %>'
    admin_role: Super User

- device_options:
  - name: Default
    domain_name: '<%= fqdn %>'
    time_zone: <%= time_zone %>

- uplinks:
  - name: Uplink
    interface: <%= wan_interface %>
    gateway_ip: <%= wan_gateway %>
    dhcp: false
    download_bw: <%= wan_speed_mbps %>
    download_bw_unit: Mbps
    upload_bw: <%= wan_speed_mbps %>
    upload_bw_unit: Mbps
    priority: 9
    weight: 1

- addresses:
  - name: WAN
    interface: <%= wan_interface %>
    cidr: <%= wan_cidr %>
    span: 1
    primary: true

