S
S
sergei19932019-07-04 10:37:28
Chef
sergei1993, 2019-07-04 10:37:28

Chef cookbook incompatibility, how to fix?

Good afternoon!
I have a cookbook for syslog_ng, it is referenced in the nginx cookbook definitions. Nginx custom.
The problem is that we are now moving to 12 chief, and the old version of syslog_ng refuses to work in conjunction with custom nginx.
Here is the error:
============================================= ================================
Recipe Compile Error in /var/chef/cache/cookbooks/_roles/recipes/ secure_globpay.rb
============================================= ================================
NoMethodError
-------------
undefined method ` syslog_ng_source_file' for cookbook: _nginx, recipe: frontend_checkout_globpay :Chef::Recipe
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/_nginx/definitions/nginx_syslog.rb:8:in `block (2 levels) in from_file'
/var/chef/cache/cookbooks/_nginx/definitions/nginx_syslog.rb:7:in ` each'
/var/chef/cache/cookbooks/_nginx/definitions/nginx_syslog.rb:7:in `block in from_file'
/var/chef/cache/cookbooks/_nginx/recipes/frontend_checkout_globpay.rb:38:in `from_file'
/var/chef/cache/cookbooks/_roles/recipes/secure_globpay.rb:7:in `from_file'
Relevant File Content:
----------------------
/ var/chef/cache/cookbooks/_nginx/definitions/nginx_syslog.rb:
1: define :nginx_syslog, :action => :create do
2: include_recipe 'syslog_ng::default'
3:
4: host = params[:name]
5:
6: # Add logging of params[:name] to Syslog
7: %w(access error).each do |type|
8>> syslog_ng_source_file "#{host}_#{type}" do
9: action action
10: path "/var/log/nginx/#{host}_#{type}.log"
11: program_override 'nginx'
12 : default_facility 'local7'
13: flags %w(no-hostname no-parse no-multi-line)
14: notifies :restart, 'service[syslog-ng]'
15: end
16:
17: syslog_ng_rewrite "#{host} _#{type}" do
System Info:
------------
chef_version=13.12.
ruby=ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
program_name=chef-client worker: ppid=29708;start=07:15:08;
executable=/opt/chef/bin/chef-client
Metadata for nginx:
name "_nginx"
maintainer "YOUR_COMPANY_NAME"
maintainer_email "YOUR_EMAIL"
license "All rights reserved"
description "Installs/Configures nginx. To install SSL servers you should use a dedicated box or provide :listen_ip attribute"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.1.25"
depends 'libraries'
depends 'perl'
depends 'syslog_ng', '
Metadata for syslog_ng:
name 'syslog_ng'
maintainer 'Ben Hughes'
maintainer_email '[email protected]'
license 'Apache-2.0'
description 'Installs/Configures syslog_ng'
long_description 'Installs/Configures syslog_ng'
version '0.0.4'
chef_version '>= 12.14' if respond_to?(:chef_version)
# The `issues_url` points to the location where issues for this cookbook are
# tracked. A `View Issues` link will be displayed on this cookbook's page when
# uploaded to a Supermarket.
#
issues_url ' https://github.com/bmhughes/syslog_ng/issues '
# The `source_url` points to the development repository for this cookbook. A
# `View Source` link will be displayed on this cookbook's page when uploaded to
# a Supermarket.
#
source_url ' https://github.com/bmhughes/syslog_ng '
os_support = {
'redhat' => '>= 7.0.0',
'centos' => '>= 7.0.0',
'fedora' => ' >= 28.0',
'debian' => '>= 8.0.0',
'ubuntu' => '>= 16.04',
'amazon' => '>= 2.0.0',
}
os_support.each do |os, ver|
supports os, ver
end
depends on 'yum-epel'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TyzhSysAdmin, 2019-07-04
@POS_troi

The "syslog_ng_source_file" method is not in the original nginx cookbook or in syslog_ng, respectively, this method is implemented in your cookbook, no one knows the source code that you wrote there.
CODE tag.
What is needed from us?
Crystal balls were rented out, fortune tellers were sent on vacation :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question