Skip to content

Instantly share code, notes, and snippets.

@smford22
Last active August 29, 2015 14:17
Show Gist options
  • Save smford22/16c0164508160f3c4f79 to your computer and use it in GitHub Desktop.
Save smford22/16c0164508160f3c4f79 to your computer and use it in GitHub Desktop.
Test-Kitchen issue converting symbols to strings

I am using test-kitchen 1.3.2 dev built from the windows-guest-support branch. I have a basic .kitchen.yml that should setup my client.rb to turn on audit_mode :enabled

~/analytics-workshop/chef-repo/cookbooks/cis_benchmarks
scottford$ kitchen -v
Test Kitchen version 1.3.2.dev
~/analytics-workshop/chef-repo/cookbooks/cis_benchmarks
scottford$ chef gem list|grep kitchen
kitchen-ec2 (0.8.0)
kitchen-vagrant (0.15.0)
test-kitchen (1.3.2.dev, 1.3.1)

My .kitchen.yml file

scottford$ cat .kitchen.yml
---
driver:
  name: vagrant

provisioner:
  name: chef_zero

platforms:
  - name: ubuntu-12.04
  - name: centos-6.5

suites:
  - name: default
    run_list:
      - recipe[cis_benchmarks::default]
    attributes:
      chef_client:
        config:
          log_level: :debug
          audit_mode: :enabled

However, that is getting ignored and the ruby symbols are being converted to strings...

scottford$ kitchen diagnose --all
---
timestamp: 2015-03-19 23:52:07 UTC
kitchen_version: 1.3.2.dev
loader:
  process_erb: true
  process_local: true
  process_global: true
  global_config:
  project_config:
    filename: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/.kitchen.yml"
    raw_data:
      driver:
        name: vagrant
      provisioner:
        name: chef_zero
      platforms:
      - name: ubuntu-12.04
      - name: centos-6.5
      suites:
      - name: default
        run_list:
        - recipe[cis_benchmarks::default]
        attributes:
          chef_client:
            config:
              log_level: ":debug"
              audit_mode: ":enabled"
  local_config:
  combined_config:
    filename:
    raw_data:
      driver:
        name: vagrant
      provisioner:
        name: chef_zero
      platforms:
      - name: ubuntu-12.04
      - name: centos-6.5
      suites:
      - name: default
        run_list:
        - recipe[cis_benchmarks::default]
        attributes:
          chef_client:
            config:
              log_level: ":debug"
              audit_mode: ":enabled"
instances:
  default-ubuntu-1204:
    state_file: {}
    driver:
      box: opscode-ubuntu-12.04
      box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box
      customize: {}
      kitchen_root: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks"
      log_level: :info
      name: vagrant
      network: []
      port: 22
      pre_create_command:
      provider: virtualbox
      sudo: true
      synced_folders: []
      test_base_path: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/test/integration"
      vagrantfile_erb: "/Users/scottford/.chefdk/gem/ruby/2.1.0/gems/kitchen-vagrant-0.15.0/lib/kitchen/driver/../../../templates/Vagrantfile.erb"
      vm_hostname: default-ubuntu-1204.vagrantup.com
    provisioner:
      attributes:
        chef_client:
          config:
            log_level: ":debug"
            audit_mode: ":enabled"
      chef_client_path: "/opt/chef/bin/chef-client"
      chef_omnibus_install_options:
      chef_omnibus_root: "/opt/chef"
      chef_omnibus_url: https://www.chef.io/chef/install.sh
      chef_zero_host:
      chef_zero_port: 8889
      client_rb: {}
      clients_path:
      cookbook_files_glob: README.*,metadata.{json,rb},attributes/**/*,definitions/**/*,files/**/*,libraries/**/*,providers/**/*,recipes/**/*,resources/**/*,templates/**/*
      data_bags_path:
      data_path:
      encrypted_data_bag_secret_key_path:
      environments_path:
      json_attributes: true
      kitchen_root: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks"
      log_file:
      log_level: :info
      name: chef_zero
      nodes_path:
      require_chef_omnibus: true
      roles_path:
      root_path: "/tmp/kitchen"
      ruby_bindir: "/opt/chef/embedded/bin"
      run_list:
      - recipe[cis_benchmarks::default]
      sudo: true
      test_base_path: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/test/integration"
    transport:
      box: opscode-ubuntu-12.04
      box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box
      customize: {}
      http_proxy:
      kitchen_root: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks"
      log_level: :info
      name: ssh
      network: []
      port: 22
      pre_create_command:
      provider: virtualbox
      shell: bourne
      sudo: true
      synced_folders: []
      test_base_path: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/test/integration"
      vagrantfile_erb: "/Users/scottford/.chefdk/gem/ruby/2.1.0/gems/kitchen-vagrant-0.15.0/lib/kitchen/driver/../../../templates/Vagrantfile.erb"
      vm_hostname: default-ubuntu-1204.vagrantup.com
    busser:
      busser_bin: "/tmp/busser/gems/bin/busser"
      kitchen_root: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks"
      log_level: :info
      root_path: "/tmp/busser"
      ruby_bindir: "/opt/chef/embedded/bin"
      suite_name: default
      test_base_path: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/test/integration"
      version: busser
  default-centos-65:
    state_file:
      hostname: 127.0.0.1
      last_action: converge
      port: '2222'
      ssh_key: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/.kitchen/kitchen-vagrant/default-centos-65/.vagrant/machines/default/virtualbox/private_key"
      username: vagrant
    driver:
      box: opscode-centos-6.5
      box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box
      customize: {}
      kitchen_root: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks"
      log_level: :info
      name: vagrant
      network: []
      port: 22
      pre_create_command:
      provider: virtualbox
      sudo: true
      synced_folders: []
      test_base_path: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/test/integration"
      vagrantfile_erb: "/Users/scottford/.chefdk/gem/ruby/2.1.0/gems/kitchen-vagrant-0.15.0/lib/kitchen/driver/../../../templates/Vagrantfile.erb"
      vm_hostname: default-centos-65.vagrantup.com
    provisioner:
      attributes:
        chef_client:
          config:
            log_level: ":debug"
            audit_mode: ":enabled"
      chef_client_path: "/opt/chef/bin/chef-client"
      chef_omnibus_install_options:
      chef_omnibus_root: "/opt/chef"
      chef_omnibus_url: https://www.chef.io/chef/install.sh
      chef_zero_host:
      chef_zero_port: 8889
      client_rb: {}
      clients_path:
      cookbook_files_glob: README.*,metadata.{json,rb},attributes/**/*,definitions/**/*,files/**/*,libraries/**/*,providers/**/*,recipes/**/*,resources/**/*,templates/**/*
      data_bags_path:
      data_path:
      encrypted_data_bag_secret_key_path:
      environments_path:
      json_attributes: true
      kitchen_root: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks"
---
      log_file:
      log_level: :info
      name: chef_zero
      nodes_path:
      require_chef_omnibus: true
      roles_path:
      root_path: "/tmp/kitchen"
      ruby_bindir: "/opt/chef/embedded/bin"
      run_list:
      - recipe[cis_benchmarks::default]
      sudo: true
      test_base_path: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/test/integration"
    transport:
      box: opscode-centos-6.5
      box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box
      customize: {}
      http_proxy:
      kitchen_root: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks"
      log_level: :info
      name: ssh
      network: []
      port: 22
      pre_create_command:
      provider: virtualbox
      shell: bourne
      sudo: true
      synced_folders: []
      test_base_path: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/test/integration"
      vagrantfile_erb: "/Users/scottford/.chefdk/gem/ruby/2.1.0/gems/kitchen-vagrant-0.15.0/lib/kitchen/driver/../../../templates/Vagrantfile.erb"
      vm_hostname: default-centos-65.vagrantup.com
    busser:
      busser_bin: "/tmp/busser/gems/bin/busser"
      kitchen_root: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks"
      log_level: :info
      root_path: "/tmp/busser"
      ruby_bindir: "/opt/chef/embedded/bin"
      suite_name: default
      test_base_path: "/Users/scottford/analytics-workshop/chef-repo/cookbooks/cis_benchmarks/test/integration"
      version: busser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment