Once the `logger` issue was resolved, we could get to the real issue. For some reason app/services/classification/base.rb#type_cast throws this error:
Unable to type cast {"ubuntu-main"=>{"location"=>"http://archive.ubuntu.com/ubuntu/", "release"=>"trusty", "repos"=>"main restricted universe multiverse", "include_src"=>"true", "include_deb"=>"true"}, "ubuntu-security"=>{"location"=>"http://archive.ubuntu.com/ubuntu/", "release"=>"trusty-security", "repos"=>"main restricted universe multiverse", "include_src"=>"true", "include_deb"=>"true"}, "ubuntu-updates"=>{"location"=>"http://archive.ubuntu.com/ubuntu/", "release"=>"trusty-updates", "repos"=>"main restricted universe multiverse", "include_src"=>"true", "include_deb"=>"true"}, "puppetlabs"=>{"location"=>"http://apt.puppetlabs.com", "repos"=>"main", "key"=>"1054B7A24BD6EC30", "key_server"=>"pgp.mit.edu", "include_deb"=>"true", "include_src"=>"false"}, "foreman"=>{"location"=>"http://deb.theforeman.org/", "release"=>"trusty", "repos"=>"1.7", "key_source"=>"http://deb.theforeman.org/pubkey.gpg", "include_deb"=>"true", "include_src"=>"false"}, "foreman-plugins"=>{"location"=>"http://deb.theforeman.org/", "release"=>"plugins", "repos"=>"1.7", "key_source"=>"http://deb.theforeman.org/pubkey.gpg", "include_deb"=>"true", "include_src"=>"false"}, "docker"=>{"location"=>"https://get.docker.com/ubuntu", "release"=>"docker", "repos"=>"main", "key"=>"D8576A8BA88D21E9", "key_server"=>"keyserver.ubuntu.com", "include_deb"=>"true", "include_src"=>"false"}} to yaml
THis is when using a yaml hash like:
ubuntu-main:
location: http://archive.ubuntu.com/ubuntu/
release: trusty
repos: main restricted universe multiverse
include_src: true
include_deb: true
ubuntu-security:
location: http://archive.ubuntu.com/ubuntu/
release: trusty-security
repos: main restricted universe multiverse
include_src: true
include_deb: true
ubuntu-updates:
location: http://archive.ubuntu.com/ubuntu/
release: trusty-updates
repos: main restricted universe multiverse
include_src: true
include_deb: true
puppetlabs:
location: http://apt.puppetlabs.com
repos: main
key: 1054B7A24BD6EC30
key_server: pgp.mit.edu
include_deb: true
include_src: false
Note how the yaml has become a ruby hash in the log output. Because `type_cast` doesn't have a return in the rescue, it returns "true" leading to your ENC yaml being incorrect.
I gave Chris this workaround:
--- a/app/services/classification/base.rb
+++ b/app/services/classification/base.rb
@@ -147,6 +147,7 @@ module Classification
key.cast_validate_value(value)
rescue TypeError
logger.warn "Unable to type cast #{value} to #{key.key_type}"
+ return value
end
but there may be better options. Marek, thoughts?