Hello,
Im trying to update the php.ini file on my system. There's only two small changes
I want to make so I thought I would copy the file over to my templates directory and just add a couple variables in there to replace the values I want, and just overwrite the php.ini file. The only thing is I'm getting this error every time I try to apply the recipe.
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* template[/etc/php/7.2/apache2/php.ini] action create
================================================================================
Error executing action `create` on resource 'template[/etc/php/7.2/apache2/php.ini]'
================================================================================
NoMethodError
-------------
undefined method `preferred_filename_on_disk_location' for nil:NilClass
Resource Declaration:
---------------------
# In update_php_file.rb
10: template '/etc/php/7.2/apache2/php.ini' do
11: action :create
12: mode '0644'
13: source 'php.erb'
14: variables(
15: :post_size => '12M',
16: :upload_size => '10M'
17: )
18: end
Compiled Resource:
------------------
# Declared in update_php_file.rb:10:in `run_chef_recipe'
template("/etc/php/7.2/apache2/php.ini") do
action [:create]
default_guard_interpreter :default
source "php.erb"
declared_type :template
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
mode "0644"
variables {:post_size=>"12M", :upload_size=>"10M"}
path "/etc/php/7.2/apache2/php.ini"
owner nil
group nil
verifications []
end
System Info:
------------
chef_version=14.10.9
platform=ubuntu
platform_version=18.04
ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
program_name=/usr/bin/chef-apply
executable=/opt/chefdk/bin/chef-apply
[2019-05-09T14:35:34-03:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-05-09T14:35:34-03:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-05-09T14:35:34-03:00] FATAL: NoMethodError: template[/etc/php/7.2/apache2/php.ini] ((chef-apply cookbook)::(chef-apply recipe) line 10) had an error: NoMethodError: undefined method `preferred_filename_on_disk_location' for nil:NilClass
I'm not sure what this means, and I literally can't find anything explaining it. Any feedback would be appreciated. (I'll post the recipe contents below)
template '/etc/php/7.2/apache2/php.ini' do
action :create
mode '0644'
source 'php.erb'
variables(
:post_size => '12M',
:upload_size => '10M'
)
end