---
hosts:
  -
    settings:
      debug_build: false
      # Identifiers
      hostname: test
      domain: test.com
      server_id: '8131'

    # Extra Actions
      post_provision: true ## This calls extra things after Ansible completes, like syncing the new SSH key from the lockdown role, or the id_files or the support bundle

      # Resources
      vcpus: 2
      memory: 8G

      # Console Access
      consoleport: 8131
      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://boxvault.startcloud.com # Should default to 'https://boxvault.startcloud.com' but can be set to 'https://vagrantcloud.com'
      box_version: 2025.5.24
      box_arch: 'amd64'

      # Provider Specific Settings
      provider_type: utm
      os_type: 'Debian_64'
      firmware_type: UEFI

      # Setup Variables
      setup_wait: 420

      # Vagrant Configurations
      vagrant_user: startcloud #  startcloud
      vagrant_user_pass: STARTcloud24@! # 'STARTcloud24@!'
      vagrant_user_private_key_path: ./id_rsa
      vagrant_ssh_insert_key: true
      vagrant_ssh_forward_agent: true
      vagrant_ssh_keep_alive: true

    plugins:
      install:
        -
          name: vagrant-scp-sync
          version: latest
      remove:
        -
          name: vagrant-scp

    zones:
      on_demand_vnics: true
      post_provision_boot: true
      vmtype: production
      brand: bhyve
      console_onboot: false
      console: webvnc
      debug: false
      debug_boot: false
      hostbridge: q35
      acpi: on
      autostart: true
      setup_method: zlogin
      diskif: virtio
      netif: virtio-net-viona
      booted_string: 'Web console:'
      lcheck_string: ':~$'
      alcheck_string: 'login:'
      safe_restart: 'sudo shutdown -r'
      safe_shutdown: 'sudo init 0 || true'
      clean_shutdown_time: 200
      snapshot_script: '/opt/vagrant/bin/Snapshooter.sh'
      cpu_configuration: simple

    # UTM Provider Specific Settings
    utm:
      notes: "Vagrant: For testing plugin development"  # Custom VM notes/description
      check_guest_additions: true                       # Check for qemu-guest-agent
      functional_9pfs: true                            # VirtFS 9P filesystem support
      customizations:                                  # Custom AppleScript commands
        # - event: "pre-boot"
        #   command: ["customize_vm.applescript", ":id", "--some-option", "value"]
        # - event: "post-boot"
        #   command: ["some_script.applescript", ":id", "--another-option"]

    # VirtualBox Provider Specific Settings (commented out for now)
    # vbox:
    #   directives:                                     # Custom VBoxManage directives
    #     # - directive: "natdnsproxy1"
    #     #   value: "off"
    #     # - directive: "natdnshostresolver1"
    #     #   value: "off"
    #     # - directive: "accelerate3d"
    #     #   value: "off"
    #     # - directive: "vram"
    #     #   value: "256"
    #     # - directive: "macaddress1"
    #     #   value: "00FF00FF00FF"

    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: 192.168.2.1
        netmask: 255.255.255.0
        gateway:
        autoconf: false
        vlan:
        dhcp4: true
        dhcp6: false # false
        is_control: false
        route: default
        provisional: false
        bridge: "en0"
        nic_type: virtio
        mac: auto
        dns:
          - nameserver: 1.1.1.1
          - nameserver: 1.0.0.1

    disks:
      boot:
        array: null
        dataset: null
        volume_name: null
        mount: /
        size: 48G

      additional_disks:
      # if null
      # TO SHI DEVs, if user wants to store thier data on a secondary disk, you would enable this block
      #  - array: null
      #    dataset: null
      #    sparse: true
      #    live: false
      #    filesystem: xfs
      #    mount: null
      #    size: null
      #    port: 5
      #    volume_name: disk1

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

      ansible:
        enabled: true
        playbooks:
          - local:
              -
                description: "This playbook imports Hosts.yml variables into a generated playbook: /vagrant/ansible/playbook.yml"
                playbook: ansible/generate-playbook.yml
                ansible_python_interpreter: /usr/bin/python3
                compatibility_mode: 2.0
                install_mode: pip
                ssh_pipelining: true
                verbose: false
                callbacks: profile_tasks
                run: always
                remote_collections: false
                collections: []
              -
                description: "This playbook configures the machine using the generated playbook: /vagrant/ansible/playbook.yml"
                playbook: ansible/playbook.yml
                ansible_python_interpreter: /usr/bin/python3
                compatibility_mode: 2.0
                install_mode: pip
                ssh_pipelining: true
                verbose: false
                callbacks: profile_tasks
                run: once
                remote_collections: false
                collections:
                  - startcloud.startcloud_roles
                  - startcloud.hcl_roles
              -
                description: "This playbook configures the machine for roles tagged as always, using the generated playbook: /vagrant/ansible/playbook.yml"
                playbook: ansible/always-playbook.yml
                ansible_python_interpreter: /usr/bin/python3
                compatibility_mode: 2.0
                install_mode: pip
                ssh_pipelining: true
                verbose: false
                callbacks: profile_tasks
                run: not_first
                remote_collections: false
                collections:
                  - startcloud.startcloud_roles

    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: scp ## rsync or scp
        args:
          - '--verbose'
          - '--archive'
          - '--delete'
          - '-z'
          - '--copy-links'
      -
        description: "Directory for Ansible Collections"
        map: ./provisioners/ansible_collections/
        to: /vagrant/ansible_collections/
        type: scp
        args:
          - '--verbose'
          - '--archive'
          - '--delete'
          - '-z'
          - '--copy-links'
#      -
#        description: "Directory for Application Installers"
#        map: ./installers/
#        to: /vagrant/installers/
#        type: scp ## rsync or scp
      -
        description: "Directory for Pre-Signed SSLs"
        map: ./ssls/
        to: /secure/
        type: scp ## rsync or scp
#      -
#        description: "Directory for Server and User IDs"
#        map: ./id-files/
#        to: /id-files/
#        type: scp ## rsync or scp
#        syncback: true

    vars:
      # Secrets Override: If you don't want to use a secrets file you can override secrets here
      installer_base_url: null
      installer_url_user: null  # Only if useAuth is true
      installer_url_pass: null  # Only if useAuth is true

      debug_all: true
      selfsigned_enabled: true
      haproxy_ssl_redirect: true
      letsencrypt_enabled: false
      letsencrypt_staging_enabled: false

      #dns_entries_list:
      #  - nomadweb
      #  - domino
      #  - traveler
      #  - verse
      #  - console
      #  - downloads

      ## Use Proxy for downloads and updates
      use_proxy: false
      proxy_server: 255.255.255.255
      proxy_port: 3128

      ## Extra Packages
      extra_packages: ['htop']

      # Domino Configuration Variables
      domino_organization: test
      domino_admin_notes_id_password: password

      # Domino OIDC Configurations
      domino_oidc_debug: false

      user_safe_id: safe.ids

      #generate_server_id_count: 0

      ## Additional server options
      is_additional_server: false
      domino_server_id: null
      origin_server: test  ## Note to SHI dev, may be able to use test.com instead of null
      #origin_server_ip: null

      # Genesis Variables
      genesis_packages:
        - netmonitor
        - SuperHumanPortal

      # Domino Installer Variables
      domino_hash: 33bd0f978a7d8a84de5cbf8ffa992502
      domino_server_installer_tar: license.txt
      domino_major_version: null
      domino_minor_version: null
      domino_patch_version: null

      # Domino fixpack Variables
      domino_fp_hash: null
      domino_installer_fixpack_install: false
      domino_fixpack_version: null
      domino_server_fixpack_tar: null

      # Domino Hotfix Variables
      domino_hf_hash: null
      domino_installer_hotfix_install: false
      domino_hotfix_version: null
      domino_server_hotfix_tar: null

## Jedi Overrides
      jedi_enabled: true ## If you prefer Nashed Domino Management, but want to have Jedi Installed, set this to False, otherwise if you want Jedi to manage domino, set this to true

      # Leap Variables
      leap_hash: null
      leap_archive: null
      leap_version:

      # Nomad Web Variables
      nomadweb_hash: null
      nomadweb_archive: null
      nomadweb_version: null
      nomad_hotfix_archive: null ### NEW VARIABLES NEEDED FOR DOMINO HOTFIX, Default to False, until the HF button is added in SHI
      nomad_hotfix_version: null # "HF1"
      nomad_hotfix_install: false # Default to False, HCL may provide Hotfixes, for example HF1 fixes and issue that requires Nomad to be restarted after HTTP comes up


      # Traveler Variables
      #traveler_hash: null
      traveler_archive: null
      traveler_base_version: null
      traveler_fixpack_install: false ## NEW VARIABLE, Traveler now fully supprots fixpacks
      traveler_fixpack_archive: null
      traveler_fixpack_version: null

      # Verse Variables
     # verse_hash: null
      verse_archive: null
      verse_base_version: null

      # Domino Rest API Variables
      #domino_rest_api_hash: null
      domino_rest_api_version: null
      domino_rest_api_archive: null

       ## Hosts entries for /etc/hosts
      #etc_hosts_entries:
       # - hostname: null.null
        #  aliases:
         #   - null
          #ip: null

    roles:
      - name: startcloud.startcloud_roles.setup
#      - name: startcloud.startcloud_roles.networking
#        tags: always
      - name: startcloud.startcloud_roles.disks
      - name: startcloud.startcloud_roles.hostname
      - name: startcloud.startcloud_roles.dependencies
      - name: startcloud.startcloud_roles.mdns
      - 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
      - name: startcloud.hcl_roles.domino_reset
        vars:
          run_tasks: false
      - 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
        vars:
          run_tasks: true
      - name: startcloud.hcl_roles.domino_oidc
        vars:
          run_tasks: true # Default to true
      - name: startcloud.hcl_roles.domino_leap
        vars:
          run_tasks: false
      - name: startcloud.hcl_roles.domino_traveler
        vars:
          run_tasks: false
      - name: startcloud.hcl_roles.domino_traveler_htmo
        vars:
          run_tasks: false
      - name: startcloud.hcl_roles.domino_verse
        vars:
          run_tasks: false
      - name: startcloud.hcl_roles.domino_rest_api
        vars:
          run_tasks: false
      - name: startcloud.hcl_roles.domino_nomadweb
        vars:
          run_tasks: false
      - name: startcloud.hcl_roles.domino_jedi
        vars:
          run_tasks: true
      - name: startcloud.hcl_roles.domino_vagrant_readme
      - name: startcloud.startcloud_roles.quick_start
        tags: always
        vars:
          run_tasks: true
      - name: startcloud.startcloud_roles.haproxy
        vars:
          run_tasks: true
      - name: startcloud.startcloud_roles.vagrant_readme
        vars:
          run_tasks: true
      - name: startcloud.startcloud_roles.lockdown
        vars:
          run_tasks: true
