Make foodcritic and rubocop happy again
This commit is contained in:
parent
2b91f3513f
commit
0c0580f7e5
1
Gemfile
1
Gemfile
@ -3,7 +3,6 @@ source 'https://rubygems.org'
|
||||
group :lint do
|
||||
gem 'foodcritic', '~> 4.0'
|
||||
gem 'rubocop', '~> 0.33'
|
||||
gem 'rake'
|
||||
end
|
||||
|
||||
group :unit do
|
||||
|
@ -16,32 +16,29 @@
|
||||
|
||||
node['postfix']['maps'].each do |type, maps|
|
||||
if node['platform_family'] == 'debian'
|
||||
if ['pgsql', 'mysql', 'ldap', 'cdb'].include?(type)
|
||||
package "postfix-#{type}"
|
||||
end
|
||||
package "postfix-#{type}" if %w(pgsql mysql ldap cdb).include?(type)
|
||||
end
|
||||
|
||||
if %w(pgsql mysql ldap memcache sqlite).include?(type)
|
||||
separator = ' = '
|
||||
else
|
||||
separator = ' '
|
||||
end
|
||||
maps.each do |file, content|
|
||||
if ['btree', 'cdb', 'dbm', 'hash', 'sdbm'].include?(type)
|
||||
execute "update-postmap-#{file}" do
|
||||
command "postmap #{file}"
|
||||
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
|
||||
action :nothing
|
||||
end
|
||||
end
|
||||
if ['pgsql', 'mysql', 'ldap', 'memcache', 'sqlite'].include?(type)
|
||||
separator = " = "
|
||||
else
|
||||
separator = " "
|
||||
end
|
||||
template file do
|
||||
execute "update-postmap-#{file}" do
|
||||
command "postmap #{file}"
|
||||
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
|
||||
action :nothing
|
||||
end if %w(btree cdb dbm hash sdbm).include?(type)
|
||||
template "#{file}-#{type}" do
|
||||
path file
|
||||
source 'maps.erb'
|
||||
only_if "postconf -m | grep -q #{type}"
|
||||
variables(
|
||||
map: content,
|
||||
separator: separator
|
||||
)
|
||||
if ['btree', 'cdb', 'dbm', 'hash', 'sdbm'].include?(type)
|
||||
if %w(btree cdb dbm hash sdbm).include?(type)
|
||||
notifies :run, "execute[update-postmap-#{file}]"
|
||||
end
|
||||
notifies :restart, 'service[postfix]'
|
||||
|
Loading…
x
Reference in New Issue
Block a user