Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Most lines commented out in configuration file #12

Closed
smith opened this issue Nov 5, 2012 · 5 comments
Closed

Most lines commented out in configuration file #12

smith opened this issue Nov 5, 2012 · 5 comments

Comments

@smith
Copy link

smith commented Nov 5, 2012

In https://github.com/phlipper/chef-postgresql/blob/a8754424a42e232a22d355654d4020e5b55560f8/templates/default/postgresql.conf.erb, most of the directives are commented out. Am I missing something here? Won't setting most of these attributes just not do anything?

If for some reason this is intended, it's confusing and not clear from the docs.

@jagregory
Copy link

I've just encountered this too. Changing any of the logging settings (obviously) has no effect, as even though the lines are correct they're still commented out.

@phlipper
Copy link
Owner

@smith, @jagregory,

The postgresql.conf file as-is is the default that ships with the package. Simply uncommenting all of the options results in the server unable to load.

My plan is to eventually support explicit templating as I do in phlipper/chef-percona, but I have not had a chance to implement that yet.

Pull requests to improve this support would gladly be welcomed.

@phlipper
Copy link
Owner

phlipper commented Feb 3, 2013

@smith, @jagregory, this issue has been addressed via 394bbc1.

@sethcall
Copy link
Contributor

I ran into this just now... I'm changing the WAL settings, but they are commented out.

I understand if I switch to 'custom' configs, i.e, ['postgresql']['conf']['archive_mode'] etc, that I'll get what I want.

Ok, that's fine--but what I'm confused about is offering up the 'standard' template mechanism in the docs. It seems to me the standard config feature is broken as long as the commenting out. Is there a way to practically use it?

A question--if you could tell that that the user specified something other than the default value in your template, would you then not feel comfortable in commenting out that specific config?

Something like:

<%= wal_level_specified? ? '#' : "" %>wal_level = <%= node["postgresql"]["wal_level"] %> # minimal, archive, or hot_standby

@kindrowboat
Copy link

I agree with @sethcall on this one. Because if someone uses the node[:postgresql][:conf][ ... ] options, then they need to specify every option and can't rely on the postgresql reasonable defaults. The current implementation renders most of the node[:postgresql][ ... ] conf related attributes useless and the node[:postgresql][conf][ ... ] attributes impractical.

One strategy is to have the default node attributes set to nil if their corresponding configuration options that are commented out in the stock postgresql.conf; in the template, have each of those lines go something like:

<%= node['wal_level'].nil? ? '# wal_level = minimal' : "wal_level = #{node[:postgresql][:wal_level]}" %> # minimal, archive, or hot_standby

While there is some verbosity, I think this is a nice compromise to having as much of the stock postgresql.conf be preserved as possible. This would also make the documentation clearer and less misleading.

Thoughts? I'd be happy to work on this if this is the direction you'd like to go @phlipper.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants