---
<%
    require 'dotenv'
    Dotenv.load
%>

driver:
  name: ec2
  associate_public_ip: false
  instance_type: <%= ENV['EC2_INSTANCE_TYPE'] || 't3.medium' %>
  iam_profile_name: <%= ENV['EC2_IAM_PROFILE_NAME'] || 'test-kitchen-instance-profile' %> # this role needs EFS permissions for the FS specified below
  interface: private
  region: <%= ENV['AWS_REGION'] || 'us-east-1' %>
  security_group_filter:
    name: <%= ENV['EC2_SECURITY_GROUP_NAME'] %>
  subnet_filter:
    tag: Name
    value: <%= ENV['EC2_SUBNET_NAME'] %>
  aws_ssh_key_id: <%= ENV['EC2_SSH_KEY_NAME'] %>
  tags:
    Name: <%= ENV['EC2_INSTANCE_NAME'] %>

provisioner:
  name: chef_zero
  product_name: cinc
  product_version: 18.4.12
  chef_license: accept

verifier:
  name: inspec

platforms:
  - name: debian-12
    driver:
      image_search:
        architecture: x86_64
        owner-id: 136693071363
        name: debian-12-amd64-*
    transport:
      username: admin
      ssh_key: <%= ENV['SSH_KEY_PATH'] %>
    lifecycle:
      post_create:
        - remote: sudo apt update
        - remote: "sudo apt-get -y upgrade -qq"

suites:
  - name: default
    run_list:
      - recipe[irrigate-orchard_base::package]
      - recipe[irrigate-docker::install]
      - recipe[irrigate-python::python38]
      - recipe[irrigate-python::python311]
      - recipe[irrigate-python::poetry]
      - recipe[irrigate-python::pipenv]
      - recipe[irrigate-jenkins::agent]
      - recipe[irrigate-jenkins::accounting_nfs_client]
    verifier:
      inspec_tests:
         - test/smoke/agent.rb
    attributes:
      firewall:
        firewalld:
          permanent: true
      jenkins:
        accounting_nfs:
          remote_endpoint: 'fs-0f704526733d54c24:'
          efs_access_point_id: 'fsap-0009984a7706e791f'
    data_bags_path: <%= ENV['DATA_BAGS_PATH'] || '../../data_bags' %>
    encrypted_data_bag_secret_key_path: <%= ENV['ENCRYPTED_DATA_BAG_SECRET_KEY_PATH'] || '/etc/chef/encrypted_data_bag_secret' %>
    roles_path: ../../roles
