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

Installs postgresql even though empty #2

Open
jgarber opened this issue May 7, 2013 · 7 comments
Open

Installs postgresql even though empty #2

jgarber opened this issue May 7, 2013 · 7 comments

Comments

@jgarber
Copy link

jgarber commented May 7, 2013

Is it just me or is it installing Postgres even though I only specified mysql ones? Running chef 11.4.4 on precise64-vanilla with databox and rackbox.

{
  "set_fqdn": "myhost.example.com",
  "rackbox": {
    "ruby": {
      "versions": ["1.8.7-p371", "2.0.0-p0"],
      "global_version": "2.0.0-p0"
    }
  },
  "mysql": {"bind_address": "localhost"},
  "databox": {
    "db_root_password": "********",
    "databases": {
      "mysql": [
        { "username": "***",
          "password": "******",
          "database_name": "***_production" },
        { "username": "****",
          "password": "******",
          "database_name": "****_production" }
      ]
    }
  },
  "run_list":[
    "recipe[hostname]",
    "recipe[databox]",
    "recipe[nodejs]",
    "recipe[rackbox]"
  ]
}
@teohm
Copy link
Owner

teohm commented May 7, 2013

It should not happen. Let me check what's going wrong.

On Tue, May 7, 2013 at 10:17 PM, Jason Garber [email protected]:

Is it just me or is it installing Postgres even though I only specified
mysql ones? Running chef 11.4.4 on precise64-vanilla with databox and
rackbox.

{
"set_fqdn": "myhost.example.com",
"rackbox": {
"ruby": {
"versions": ["1.8.7-p371", "2.0.0-p0"],
"global_version": "2.0.0-p0"
}
},
"mysql": {"bind_address": "localhost"},
"databox": {
"db_root_password": "******",
"databases": {
"mysql": [
{ "username": "**
",
"password": "_",
"database_name": "__production" },
{ "username": "
",
"password": "**
_",
"database_name": "
_
_production" }
]
}
},
"run_list":[
"recipe[hostname]",
"recipe[databox]",
"recipe[nodejs]",
"recipe[rackbox]"
]
}


Reply to this email directly or view it on GitHubhttps://github.com//issues/2
.

Huiming

@jgarber
Copy link
Author

jgarber commented May 7, 2013

Looks like it's coming up as [], which isn't false.

I'm using Chef 11.4.4 and databox 0.1.0

@luislavena
Copy link

@jgarber is correct, the issue is here:

https://github.com/teohm/databox-cookbook/blob/master/recipes/default.rb#L11

And a simply change to this should solve the issue:

if node["databox"]["databases"]["postgresql"].any?
  include_recipe "databox::postgresql"
end

That ensures that empty list of DBs do not install the opposite engine.

Hope that helps.

@teohm
Copy link
Owner

teohm commented May 9, 2013

Thanks Luis, I will try to release a patch this weekend.

On Thu, May 9, 2013 at 5:12 AM, Luis Lavena [email protected]:

@jgarber https://github.com/jgarber is correct, the issue is here:

https://github.com/teohm/databox-cookbook/blob/master/recipes/default.rb#L11

And a simply change to this should solve the issue:

if node["databox"]["databases"]["postgresql"].any?
include_recipe "databox::postgresql"end

That ensures that empty list of DBs do not install the opposite engine.

Hope that helps.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-17634256
.

Huiming

@luislavena
Copy link

@teohm thank you.

I might send some pull requests soon as I just started playing with these recipes. Thank you for sharing! ❤️

@luislavena
Copy link

@teohm pull request sent!

kohenkatz added a commit to kohenkatz/databox-cookbook that referenced this issue Jul 7, 2015
@kohenkatz
Copy link

Fixed in my fork, and released as version 0.1.2.

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

Successfully merging a pull request may close this issue.

4 participants