---
driver:
  name: docker
  use_sudo: false

provisioner:
  name: chef_zero

verifier:
  name: inspec

platforms:
  - name: centos-7
    driver_config:
      image: centos:7
      platform: centos
      run_command: /usr/sbin/init
      privileged: true

suites:
  - name: ci
    run_list:
      - recipe[commons::test_prepare]
      - recipe[commons::_mock_files]
      - recipe[commons::awscli]
      - recipe[commons::chef-client-cron]
      - recipe[commons::databags-to-files]
      - recipe[commons::chefzero]
      - recipe[commons::ec2-tagging]
      - recipe[commons::ec2-discovery]
      - recipe[commons::error-pages]
    data_bags_path: "test/integration/data_bags"
    attributes: {
      "name": "chef-commons-local",
      "hostname": "chef-commons-local",
      "commons" : {
        "install_awscli" : true,
        "logstash" : {
          "ec2" : {
            "run_discovery" : true
          }
        },
        "chef-client-cron" : {
          "cron_name" : "test1",
          "chef_json_cookbook" : "commons",
          "chef_json_source" : "cron/chef-client.cron.erb"
        },
        "awscli" : {
          "credentials_databag" : "aws",
          "credentials_databag_item" : "test"
        },
        "databags_to_files" : {
          "default_destination_folder" : "/etc/ssl/certs",
          "default_filename_prefix" : "mycertname",
          "databags" : {
            "certs" : {
              "test" : {}
            }
          }
        },
        "ec2_discovery" : {
          "skip_ec2_commands" : true,
          "current" : {
            "ip" : "171.1.1.1",
            "az" : "us-east-1a"
          },
          "output" : {
            "elements" : {
              "id" : "InstanceId",
              "ip" : "PrivateIpAddress",
              "state" : "State/Name"
            },
            "tags" : {
              "instance_name" : "Name"
            },
            "filter_in" : {
              "state" : "running"
            }
          }
        }
      }
    }
