zuazo / postfixadmin-cookbook Goto Github PK
View Code? Open in Web Editor NEWChef cookbook to install and configure PostfixAdmin.
Home Page: https://supermarket.chef.io/cookbooks/postfixadmin
License: Apache License 2.0
Chef cookbook to install and configure PostfixAdmin.
Home Page: https://supermarket.chef.io/cookbooks/postfixadmin
License: Apache License 2.0
In apache2 3.2.2 apache.listen_ports and apache.listen_addresses are depreciated and this cookbook fails to run.
https://github.com/sous-chefs/apache2/blob/master/CHANGELOG.md
Quick Hack in apache2 recipe almost fixes the problem:
def update_listen_ports(port)
- return if node['apache']['listen_ports'].include?(port)
- node.set['apache']['listen_ports'] =
- node['apache']['listen_ports'] + [port]
+ return if node['apache']['listen'].include?( "*:#{port}")
+ node.default['apache']['listen'] =
+ node['apache']['listen'] + ["*:#{port}"]
end
I also had to manually edit the node to delete the listen_ports previously set by postfixadmin cookbook.
Hi,
I want to set up Postfix & Dovecot in a Vagrant VM using chef-solo. The VM is based on an Ubuntu 12.04 image with the Chef Omnibus 11.10.4 package installed.
However, when I provision the VM, Chef fails with the following error:
cludwig$ vagrant provision
[default] Chef 11.10.4 Omnibus package is already installed.
[default] Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
stdin: is not a tty
[2014-03-09T15:18:51+01:00] INFO: Forking chef instance to converge...
[2014-03-09T15:18:51+01:00] INFO: *** Chef 11.10.4 ***
[2014-03-09T15:18:51+01:00] INFO: Chef-client pid: 1793
[2014-03-09T15:18:52+01:00] INFO: Setting the run_list to ["recipe[bullinger::default]"] from JSON
[2014-03-09T15:18:52+01:00] INFO: Run List is [recipe[bullinger::default]]
[2014-03-09T15:18:52+01:00] INFO: Run List expands to [bullinger::default]
[2014-03-09T15:18:52+01:00] INFO: Starting Chef Run for precise32
[2014-03-09T15:18:52+01:00] INFO: Running start handlers
[2014-03-09T15:18:52+01:00] INFO: Start handlers complete.
[2014-03-09T15:18:54+01:00] INFO: Missing gem 'sequel'
[2014-03-09T15:18:55+01:00] WARN: Cloning resource attributes for package[postfix] from prior resource (CHEF-3694)
[2014-03-09T15:18:55+01:00] WARN: Previous package[postfix]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfix-dovecot/recipes/postfix-full.rb:20:in `from_file'
[2014-03-09T15:18:55+01:00] WARN: Current package[postfix]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfix-full/recipes/default.rb:22:in `from_file'
[2014-03-09T15:18:55+01:00] WARN: Cloning resource attributes for service[postfix] from prior resource (CHEF-3694)
[2014-03-09T15:18:55+01:00] WARN: Previous service[postfix]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfix-full/recipes/default.rb:24:in `from_file'
[2014-03-09T15:18:55+01:00] WARN: Current service[postfix]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfix-full/recipes/default.rb:74:in `from_file'
[2014-03-09T15:18:55+01:00] WARN: Cloning resource attributes for service[apache2] from prior resource (CHEF-3694)
[2014-03-09T15:18:55+01:00] WARN: Previous service[apache2]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/apache2/recipes/default.rb:24:in `from_file'
[2014-03-09T15:18:55+01:00] WARN: Current service[apache2]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/apache2/recipes/default.rb:210:in `from_file'
[2014-03-09T15:18:56+01:00] WARN: Cloning resource attributes for directory[/var/cache/local/preseeding] from prior resource (CHEF-3694)
[2014-03-09T15:18:56+01:00] WARN: Previous directory[/var/cache/local/preseeding]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/apt/recipes/default.rb:75:in `block in from_file'
[2014-03-09T15:18:56+01:00] WARN: Current directory[/var/cache/local/preseeding]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/_server_debian.rb:4:in `from_file'
[2014-03-09T15:18:56+01:00] WARN: Cloning resource attributes for directory[/var/lib/mysql] from prior resource (CHEF-3694)
[2014-03-09T15:18:56+01:00] WARN: Previous directory[/var/lib/mysql]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/_server_debian.rb:34:in `block in from_file'
[2014-03-09T15:18:56+01:00] WARN: Current directory[/var/lib/mysql]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/mysql/recipes/_server_debian.rb:78:in `from_file'
================================================================================
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/bullinger/recipes/default.rb
================================================================================
ArgumentError
-------------
You must supply a name when declaring a package resource
Cookbook Trace:
---------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfixadmin/recipes/default.rb:60:in `from_file'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfix-dovecot/recipes/postfixadmin.rb:22:in `from_file'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfix-dovecot/recipes/default.rb:23:in `from_file'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/bullinger/recipes/_postfix-dovecot.rb:24:in `from_file'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/bullinger/recipes/default.rb:16:in `from_file'
Relevant File Content:
----------------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfixadmin/recipes/default.rb:
53: action :install
54: end
55:
56: package pkg_php_imap do
57: action :install
58: end
59:
60>> package pkg_php_mbstring do
61: not_if do pkg_php_mbstring.nil? end
62: action :install
63: end
64:
65: chef_gem 'sequel'
66:
67: mysql_connection_info = {
68: :host => node['postfixadmin']['database']['host'],
69: :username => 'root',
[2014-03-09T15:18:56+01:00] ERROR: Running exception handlers
[2014-03-09T15:18:56+01:00] ERROR: Exception handlers complete
[2014-03-09T15:18:56+01:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-03-09T15:18:56+01:00] ERROR: You must supply a name when declaring a package resource
[2014-03-09T15:18:56+01:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
Looking at the default postfixadmin recipe, I see pkg_php_mbstring
is assigned nil
on an Ubuntu system; the guard in line 61 seems to come too late, though.
Regards
Christoph
I see that adding remove to some of the LWRPs is on the todo list.
Supporting update, IMHO, would be more useful than remove.
Updating goto on aliases
Updating passwords on admins and mailboxes
Updating active status on aliases, admins, domains and mailboxes
E.g. in my installation I would like for postfixadmin to be available at http://hostname/postfixadmin/ URL.
Chef complains about
27>> return if node['apache']['listen_ports'].include?(port)
ERROR: undefined method `include?' for nil:NilClass
I'm running the recipe included by postfix-dovecot cookbook and postfix-dovecot is included in another custom cookbook.
If the admin being created does not exist and encrypted attributes are enabled an exception is thrown.
In the admin LWRP the definition of password seems incorrect.
# providers/admin.rb
def password
if encrypted_attributes_enabled?
Chef::EncryptedAttribute.load(new_resource.password)
else
new_resource.password
end
end
The resource only allows a string yet the code wants different data depending on if encrypted attributes are enabled or not.
I think the check for encrypted attributes is not needed here, it should simply be:
def password
new_resource.password
end
3.0.0
13
CentOS7
Running this cookbook with Chef 13
Run the cookbook with Chef 13
Cookbook executed successfully.
Failing because mysql2_chef_gem ~> 1.0 is not compatible with Chef 13
libraries / api.rb requires a chef file that no longer exists as of 11.8.0:
requires 'chef/rest/rest_request'
https://github.com/opscode/chef/tree/11.8.0/lib/chef
When running the cookbook under the latest chef, it produces the following error:
[2013-11-17T02:40:39+00:00] ERROR: Running exception handlers
[2013-11-17T02:40:39+00:00] ERROR: Exception handlers complete
[2013-11-17T02:40:39+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-11-17T02:40:39+00:00] ERROR: cannot load such file -- chef/rest/rest_request
================================================================================
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfixadmin/libraries/api.rb
================================================================================
LoadError
---------
cannot load such file -- chef/rest/rest_request [11/893]
Cookbook Trace:
---------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfixadmin/libraries/api.rb:4:in `<top (required)>'
Relevant File Content:
----------------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/postfixadmin/libraries/api.rb:
1:
2: require 'uri'
3: require 'net/http'
4>> require 'chef/rest/rest_request'
5:
6: module PostfixAdmin
7: module API
8: @@cookie = nil
9: @@authenticated = false
10:
11: def self.request(method, path, body, ssl=false)
12: proto = ssl ? 'https' : 'http'
13: port = ssl ? 443 : 80
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.