Comments (5)
@patcon I've made it recently just in order to follow the recommendations from Chef how libraries should look like:
https://www.chef.io/blog/2014/03/12/writing-libraries-in-chef-cookbooks/
https://docs.chef.io/libraries.html
I was also inspired by examples from mysql
, postgresql
cookbooks.
Actually, these helpers methods are designed for usage in the same cookbook. There is no need to call merge_confluence_settings
in wrapper cookbooks.
from confluence.
Actually, these helpers methods are designed for usage in the same cookbook. There is no need to call merge_confluence_settings in wrapper cookbooks.
heh. i beg to differ :) I am calling them in a wrapper cookbook (for manipulating config files, doing restore from backup, etc), which is totally reasonable, right? otherwise the node object might differ from the settings hash, and attributes in the wrapper wouldn't match the actual cookbook
from confluence.
For example, if I want to talk to the database in my wrapper cookbook, I need to recreate the logic in here, including loading the merged settings hash:
https://github.com/bflad/chef-confluence/blob/master/recipes/database.rb
I'd much rather replace all the repetition with DRYness:
# my_confluence/recipes/restore.rb
settings = Confluence.merge_confluence_settings
postgresql_database settings['database']['name'] do
connection Confluence.database_connection
owner settings['database']['user']
action [:drop, :create]
end
Is this unreasonable?
from confluence.
I think it's reasonable that this cookbook provides external cookbooks a
method for retrieving the finished product of determining the settings just
like the cookbook internally uses so they don't have to reinvent the wheel.
On Wed, Sep 30, 2015, 16:31 Patrick Connolly [email protected]
wrote:
For example, if I want to talk to the database in my wrapper cookbook, I
need to recreate the logic in here, including loading the merged settings
hash:
https://github.com/bflad/chef-confluence/blob/master/recipes/database.rbI'd much rather replace all the repetition with DRYness:
my_confluence/recipes/restore.rb
settings = Confluence.merge_confluence_settings
postgresql_database settings['database']['name'] do
connection Confluence.database_connection
owner settings['database']['user']
action [:drop, :create]endIs this unreasonable?
—
Reply to this email directly or view it on GitHub
#55 (comment)
.
from confluence.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from confluence.
Related Issues (20)
- Cookbook does not function on Amazon Linux 2016.09 and above HOT 2
- Please template confluence.cfg.xml HOT 4
- apache2 cookbook v5.0.0 removes support for Apache 2.2 HOT 1
- Call for maintainer HOT 10
- Apache proxy_wstunnel module needed for synchrony HOT 4
- unlock mysql and mysql2_chef_gem dependencies HOT 3
- Undefined node attribute or method `|' on `node'. To set an attribute, use `|=value' instead. HOT 3
- MySQL drivers are not installed HOT 1
- Add support for apache2.4 & and the apache2 7.0 cookbook HOT 1
- confluence.cfg.xml missing database info HOT 1
- Confluence version 6.1 is not supported by the cookbook HOT 1
- this chef book will support for 6.15.1 HOT 1
- Dangerfile should use failure instead of fail
- Remove .rubocop.yml with Dangerfile HOT 1
- Update Changelog HOT 1
- Run latest cookstyle HOT 1
- Update builds to be parallel HOT 2
- Testing should run against latest chef in dokken
- chef version dependendcy HOT 2
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from confluence.