Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wordpress DB password is not set correctly #56

Open
erez-rabih opened this issue Apr 19, 2015 · 2 comments
Open

Wordpress DB password is not set correctly #56

erez-rabih opened this issue Apr 19, 2015 · 2 comments

Comments

@erez-rabih
Copy link

I'm wrapping the wordpress cookbook with my own. I am trying to set the wordpress DB password using attributes:

include_attribute 'wordpress'
default['wordpress']['db']['pass'] = "some-password"

But it is not being set as expected.
The problem is here: https://github.com/brint/wordpress-cookbook/blob/master/recipes/database.rb#L35

It overrides the given password even though the attribute has a value.
After exploring the problem I found out that set_unless will override default precedence attributes.
Changing the attributes file to normal instead of default solves it:

include_attribute 'wordpress'
normal['wordpress']['db']['pass'] = "some-password"

Just thought I should bring this issue to awareness.

Thanks :)

@petracvv
Copy link

I am running into this as well. It seems that you must set your own password as a normal precedence attribute in order for it to not be overwritten by the set_unless statement; not even a force_override was able to take precedence. Maybe switch the statement to something like:

node.set['wordpress']['db']['pass'] = secure_password if node['wordpress']['db']['pass'].nil?

@Vanders
Copy link

Vanders commented May 26, 2016

If you're still having problems with this I just opened #71 that solves this for all of the set_unless cases and makes the cookbook more wrap-able.

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

No branches or pull requests

3 participants