need help with chef-vault and test-kitchen

52 views
Skip to first unread message

Sanjiv Kumar

unread,
Jun 10, 2017, 4:01:55 PM6/10/17
to chef-testing
Hi,

I am using test-kitchen with ec2-kitchen driver to run the integration tests. My requirement is to access the chef-vault item in .kitchen.yml. I know we can sepcify the data_bags_path in .kitchen.yml but while running "kitchen test <INSTANCE>" I am getting following error:

item is not encrypted with your public key.  Contact an administrator of the vault item to encrypt for you!

I have created a vault with the command:
knife vault create credentials password '{"username":"red","password":"guess"}' -A chef-user

chef-user is a user in chef server. When I create the vault with -S 'role:role-name' it is working in ec2 instance but not through test-kitchen. This is my .kitchen.yml file:

---
driver:
  name: ec2
  aws_ssh_key_id: key_name
  security_group_ids: ["sg-id"]
  region: us-east-1
  availability_zone: a
  subnet_id: subnet-id
  require_chef_omnibus: true
  instance_type: t2.small
  associate_public_ip: true

provisioner:
  name: chef_zero
  roles_path: ../../roles
  environments_path: ../../environments
  data_bags_path: ../../data_bags
  client_rb:
    client_key: '/tmp/kitchen/key.pem'
  ohai:
   disabled_plugins: ["passwd"]

  - name: redhat-7.2
    driver:
      image_id: ami-id
    synced_folders:
      - ["../../.chef","/tmp/kitchen/","disabled:false"]
    transport:
      ssh_key: /home/ec2-user/key
      username: ec2-user
      connection_timeout: 20
      connection_retries: 500
    driver_config:
      tags: {
        "created-by": "Test-Kitchen",
      }
      block_device_mappings:
        - device_name: /dev/sda1
          ebs:
            volume_type: gp2
            volume_size: 20
            delete_on_termination: true
suites:
 - name: default
   run_list:
      - role[role1]

Please help me with this.

Thanks,
Sanjiv
Reply all
Reply to author
Forward
0 new messages