chef-coldfusion10
chef-coldfusion10 copied to clipboard
erb file does not exist (but it does) - SOLVED
I'm having a problem running this cookbook on AWS through Packer / chef-solo. i have a feeling it's a problem with chef, but this is my first chef deploy so i'm just guessing. I'm calling it like this (that line into is destined for a Jenkins job) /opt/packer/packer build coldfusion10.json here's the json file
{
"builders": [{
"type": "amazon-ebs",
"region": "ap-southeast-2",
"source_ami": "ami-83e08db9",
"instance_type": "t2.micro",
"ssh_username": "ec2-user",
"ami_name": "coldfusion10-web-{{timestamp}}",
"ami_description": "RHEL6.6 + Apache, ColdFusion, etc",
"subnet_id": "subnet-xxxxx",
"vpc_id": "vpc-xxxxx",
"run_tags": {
"role": "coldfusion"
}
}],
"provisioners": [{
"type": "chef-solo",
"cookbook_paths": ["cookbooks"],
"run_list": [
"recipe[coldfusion10::standalone]"
]
}]
}
the recipe starts an instance successfully with RedHat 6.6 or 7, but fails at the first template call like this
amazon-ebs: Recipe: coldfusion10::install
amazon-ebs: * directory[/opt/coldfusion10] action create
amazon-ebs: - create new directory /opt/coldfusion10
amazon-ebs: - change mode from '' to '0755'
amazon-ebs: - change owner from '' to 'nobody'
amazon-ebs: - restore selinux security context
amazon-ebs: * template[/var/chef/cache/cf10-installer.properties] action create
amazon-ebs:
amazon-ebs: ================================================================================
amazon-ebs: Error executing action `create` on resource 'template[/var/chef/cache/cf10-installer.properties]'
amazon-ebs: ================================================================================
amazon-ebs:
amazon-ebs: RuntimeError
amazon-ebs: ------------
amazon-ebs: File templates/default/cf10-installer.properties.erb does not exist for cookbook coldfusion10
amazon-ebs:
amazon-ebs: Resource Declaration:
amazon-ebs: ---------------------
amazon-ebs: # In /tmp/packer-chef-solo/cookbooks-0/chef-coldfusion10/recipes/install.rb
amazon-ebs:
amazon-ebs: 42: template "#{Chef::Config['file_cache_path']}/cf10-installer.properties" do
amazon-ebs: 43: source "cf10-installer.properties.erb"
amazon-ebs: 44: owner node['cf10']['installer']['runtimeuser']
amazon-ebs: 45: mode 00644
amazon-ebs: 46: variables(
amazon-ebs: 47: :admin_password => pwds['admin_password'],
amazon-ebs: 48: :jetty_password => pwds['jetty_password'],
amazon-ebs: 49: :rds_password => pwds['rds_password']
amazon-ebs: 50: )
amazon-ebs: 51: not_if { File.exists?("#{node['cf10']['installer']['install_folder']}/license.html") }
amazon-ebs: 52: end
amazon-ebs: 53:
amazon-ebs:
amazon-ebs: Compiled Resource:
amazon-ebs: ------------------
amazon-ebs: # Declared in /tmp/packer-chef-solo/cookbooks-0/chef-coldfusion10/recipes/install.rb:42:in `from_file'
amazon-ebs:
amazon-ebs: template("/var/chef/cache/cf10-installer.properties") do
amazon-ebs: action "create"
amazon-ebs: retries 0
amazon-ebs: retry_delay 2
amazon-ebs: default_guard_interpreter :default
amazon-ebs: path "/var/chef/cache/cf10-installer.properties"
amazon-ebs: backup 5
amazon-ebs: atomic_update true
amazon-ebs: source "cf10-installer.properties.erb"
amazon-ebs: variables {:admin_password=>"vagrant", :jetty_password=>"vagrant", :rds_password=>"vagrant"}
amazon-ebs: declared_type :template
amazon-ebs: cookbook_name :coldfusion10
amazon-ebs: recipe_name "install"
amazon-ebs: owner "nobody"
amazon-ebs: mode 420
amazon-ebs: not_if { #code block }
amazon-ebs: end
amazon-ebs:
amazon-ebs:
amazon-ebs: Running handlers:
amazon-ebs: [2015-02-09T19:47:55-05:00] ERROR: Running exception handlers
amazon-ebs: Running handlers complete
amazon-ebs: [2015-02-09T19:47:55-05:00] ERROR: Exception handlers complete
amazon-ebs: [2015-02-09T19:47:55-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
amazon-ebs: Chef Client failed. 1 resources updated in 1.645054601 seconds
amazon-ebs: [2015-02-09T19:47:55-05:00] ERROR: template[/var/chef/cache/cf10-installer.properties] (coldfusion10::install line 42) had an error: RuntimeError: File templates/default/cf10-installer.properties.erb does not exist for cookbook coldfusion10
amazon-ebs: [2015-02-09T19:47:55-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
The only similar problem i've found is one guy who seems to have been having the same problem with packer and chef-solo for quite a while. i can't believe there are only two of us though - maybe he and i both have the same config problem. https://tickets.opscode.com/browse/COOK-3501 https://tickets.opscode.com/browse/COOK-3961
my mistake. a trap for middle-aged players : this repo is called chef-coldfusion10, but the folder has to be called cookbooks/coldfusion10 otherwise the first time chef tries to access a resource on the target system it can't find it (even though it's been running the rest of the scripts succesfully)
you can close this issue.