#jinja2:lstrip_blocks: True
# core_provisioner_version: {{ core_provisioner_version }}
# provisioner_name: {{ provisioner_name }}
# provisioner_version: {{ provisioner_version }}
---
hosts:
  -
    settings:
      # Identifiers
      hostname: ::SERVER_HOSTNAME::
      domain: ::SERVER_DOMAIN::
      server_id: '::SERVER_ID::'

      # Resources
      vcpus: ::RESOURCES_CPU::
      memory: ::RESOURCES_RAM::

      # Console Access
      consoleport: ::SERVER_ID::
      consolehost: 0.0.0.0
      show_console: false ## Some people have reported issues when VBox doesn't show the Console

      # Box information
      box: 'STARTcloud/debian12-server'
      box_url: 'https://vagrantcloud.com'
      box_version: 0.0.4

      # Provider Specific Settings
      provider-type: virtualbox
      os_type: 'Debian_64'
      firmware_type: UEFI

      # Setup Variables
      setup_wait: 300

      # Vagrant Configurations
      vagrant_user_private_key_path: ./id_rsa
      vagrant_user: ::SERVER_DEFAULT_USER:: #  startcloud
      vagrant_user_pass: ::SERVER_DEFAULT_USER_PASS:: # 'STARTcloud24@!' 
      vagrant_insert_key: true
      ssh_forward_agent: true

    networks:
      # Future iteration may omit this to skip attaching a bridged adpater, the below block will need to be template unto itself
      - type: external
        address: ::NETWORK_ADDRESS::
        netmask: ::NETWORK_NETMASK::
        gateway: ::NETWORK_GATEWAY::
        dhcp4: ::NETWORK_DHCP4::
        dhcp6: false # false
        bridge: ::NETWORK_BRIDGE::
        mac: auto
        dns:
          - nameserver: ::NETWORK_DNS_NAMESERVER_1::
          - nameserver: ::NETWORK_DNS_NAMESERVER_2::

    provisioning:
      shell:
        enabled: false
        scripts:
          - './scripts/aliases.sh'

      ansible:
        enabled: true
        scripts:
          - local:
              - script: ansible/generate-playbook.yml
                ansible_python_interpreter: /usr/bin/python3
                compatibility_mode: 2.0
                install_mode: pip
                ssh_pipelining: true
                verbose: false
                remote_collections: true
              - script: ansible/playbook.yml
                ansible_python_interpreter: /usr/bin/python3
                compatibility_mode: 2.0
                install_mode: pip
                ssh_pipelining: true
                verbose: false
                remote_collections: true

    folders:
      - 
        description: "Disables VBoxSF, do not enable"
        map: .
        to: /vagrant
        type: virtualbox
        disabled: true
        automount: true
      -
        description: "Directory for Ansible Scripts"
        map: ./provisioners/ansible/
        to: /vagrant/ansible/
        type: rsync
        args:
          - '--verbose'
          - '--archive'
          - '--delete'
          - '-z'
          - '--copy-links'
      -
        description: "Directory for Application Installers"
        map: ./installers/
        to: /vagrant/installers/
        type: rsync
      -
        description: "Directory for Pre-Signed SSLs"
        map: ./ssls/
        to: /secure/
        type: rsync
      -
        description: "Directory for Server and User IDs"
        map: ./id-files/
        to: /id-files/
        type: rsync
        syncback: true

    vars:
      debug_all: true
      selfsigned_enabled: ::CERT_SELFSIGNED::
      haproxy_ssl_redirect: true
      
      # Domino Configuration Variables
      domino_organization: ::SERVER_ORGANIZATION::
      user_safe_id: ::USER_SAFE_ID::
      domino_admin_notes_id_password: ::DOMINO_ADMIN_PASSWORD::
      generate_server_id_count: ::DOMINO_SERVER_CLUSTERMATES::

      # Additional server options
      is_additional_server: ::DOMINO_IS_ADDITIONAL_INSTANCE::

      # Genesis Variables
      genesis_packages:
        - netmonitor
        - SuperHumanPortal

      # Domino Installer Variables
      domino_hash: ::DOMINO_HASH::
      domino_major_version: ::DOMINO_MAJOR_VERSION::
      domino_minor_version: ::DOMINO_MINOR_VERSION::
      domino_patch_version: ::DOMINO_PATCH_VERSION::

      # Domino fixpack Variables
      domino_fp_hash: ::DOMINO_FP_HASH::
      domino_server_installer_tar: ::DOMINO_INSTALLER::
      domino_installer_fixpack_install: ::DOMINO_INSTALLER_FIXPACK_INSTALL::
      domino_fixpack_version: ::DOMINO_INSTALLER_FIXPACK_VERSION::
      domino_server_fixpack_tar: ::DOMINO_INSTALLER_FIXPACK::

      # Domino Hotfix Variables
      domino_hf_hash: ::DOMINO_HF_HASH::
      domino_installer_hotfix_install: ::DOMINO_INSTALLER_HOTFIX_INSTALL::
      domino_hotfix_version: ::DOMINO_INSTALLER_HOTFIX_VERSION::
      domino_server_hotfix_tar: ::DOMINO_INSTALLER_HOTFIX::

      # Leap Variables
      leap_hash: ::LEAP_HASH::
      leap_archive: ::LEAP_INSTALLER::
      leap_version: ::LEAP_INSTALLER_VERSION::

      # Nomad Web Variables
      nomadweb_hash: ::NOMADWEB_HASH::
      nomadweb_archive: ::NOMADWEB_INSTALLER::
      nomadweb_version: ::NOMADWEB_VERSION::

      # Traveler Variables
      traveler_hash: ::TRAVELER_HASH::
      traveler_archive: ::TRAVELER_INSTALLER::
      traveler_base_version: ::TRAVELER_INSTALLER_VERSION::
      traveler_fixpack_archive: ::TRAVELER_FP_INSTALLER::
      traveler_fixpack_version: ::TRAVELER_FP_INSTALLER_VERSION::

      # Verse Variables
      verse_hash: ::VERSE_HASH::
      verse_archive: ::VERSE_INSTALLER::
      verse_base_version: ::VERSE_INSTALLER_VERSION::

      # Domino Rest API Variables
      domino_rest_api_hash: ::DOMINO_REST_API_HASH::
      domino_rest_api_version: ::DOMINO_REST_API_INSTALLER_VERSION::
      domino_rest_api_archive: ::DOMINO_REST_API_INSTALLER::

    roles:
      - name: startcloud.startcloud_roles.setup
      - name: startcloud.startcloud_roles.networking
        tags: always
      - name: startcloud.startcloud_roles.hostname
      - name: startcloud.startcloud_roles.dependencies
      - name: startcloud.startcloud_roles.service_user
      - name: startcloud.startcloud_roles.sdkman_install
      - name: startcloud.startcloud_roles.sdkman_java
      - name: startcloud.startcloud_roles.sdkman_maven
      - name: startcloud.startcloud_roles.sdkman_gradle
      - name: startcloud.startcloud_roles.ssl
      ::ROLE_DOMINO_RESET:: #- name: startcloud.hcl_roles.domino_reset 
      - name: startcloud.hcl_roles.domino_install
      - name: startcloud.hcl_roles.domino_vagrant_rest_api 
      - name: startcloud.hcl_roles.domino_service_nash
      - name: startcloud.hcl_roles.domino_java_config
      - name: startcloud.hcl_roles.domino_java_tools
      - name: startcloud.hcl_roles.domino_updatesite
      - name: startcloud.hcl_roles.domino_config 
      - name: startcloud.hcl_roles.domino_genesis
      - name: startcloud.hcl_roles.domino_genesis_applications
      - name: startcloud.hcl_roles.domino_cross_certify
      #- name: startcloud.hcl_roles.domino_java_app_example ## Uncomment Me to build your own Domino Java Servlet
      ::ROLE_LEAP:: 
      ::ROLE_NOMADWEB::
      ::ROLE_TRAVELER:: 
      ::ROLE_TRAVELER_HTMO:: 
      ::ROLE_VERSE:: 
      ::ROLE_RESTAPI:: ## Note to SHI devs, This should be called ROLE_DOMINO_RESTAPI, as this is different than startcloud.hcl_roles.domino_vagrant_rest_api
      - name: startcloud.hcl_roles.domino_vagrant_readme
      ::ROLE_MARIADB::  
      ::ROLE_DOCKER::  
      ::ROLE_VOLTMX_DOCKER::
      ::ROLE_VOLTMX::
      - name: startcloud.startcloud_roles.quick_start # ::ROLE_STARTCLOUD_QUICK_START::
        tags: always
      ::ROLE_STARTCLOUD_HAPROXY::
      ::ROLE_STARTCLOUD_VAGRANT_README::
      - name: startcloud.startcloud_roles.lockdown
