Skip to content

more flexible service require #636

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

Closed
wants to merge 3 commits into from
Closed

Conversation

Micsi
Copy link

@Micsi Micsi commented Jan 5, 2015

This makes the recently merged service-require PR #615 work better with externally managed config-files, even stored in unusual places as well as with user-specified packages. See discussion with original author at PR #615.
Works well with package-manage param PR #617
This is sort of an alternative to PR #630

…t-warning

Fix lint warning in server/service.pp
require => [ File['mysql-config-file'], Package['mysql-server'] ]
# if you manage the config file outside of the module or want mysql provided by another package, you may still use this service
# provided you set the parameters config_file resp. package_name on the mysql::server class
require => [ File[$mysql::server::config_file], Package[$mysql::server::package_name]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you conditionalize the File[$mysql::server::config_file] dependency on $mysql::server::manage_config_file (see #630 for example)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hunner:
Why should we? Pls see the discussion on this at #630? In the proposed form it works well with a externally manged config files. I think this is the better alternative because MySQL still requires a config file to start.
This form of the require ensures that the config exists, when the server starts but even allows not standard locations of the file.
Because of this, this PR is an alternative to #630.

…-mysql into service-require

Conflicts:
	manifests/server/service.pp
@Micsi
Copy link
Author

Micsi commented Jan 16, 2015

@mhaskel I did the rebase and pushed the results. Who is responsible to remove the "needs-rebase" label?

@underscorgan
Copy link
Contributor

@Micsi I think something went wrong with your rebase ... there aren't any commits there from you anymore and the PR is showing no changes

@hunner
Copy link
Contributor

hunner commented Jan 22, 2015

It looks like the rebase went wonky? There are now no lines changed. Try this:

git checkout service-require
git reset --hard 6c48b1c
git checkout master
git remote add puppetlabs https://github.com/puppetlabs/puppetlabs-mysql.git
git remote update
git reset --hard puppetlabs/master
git checkout service-require
git rebase master

< fix your merge conflict here, then git add manifests/server/service.pp to add the changes >

git rebase --continue
git push -f origin service-require

And that should get this PR up to date with only one commit, no merge conflicts, and the changes you want.

@underscorgan
Copy link
Contributor

Actually, it looks like this PR won't actually fix the same usecase as #630. If $manage_config_file is set to false this will be adding dependencies on resources that likely don't exist.

@Micsi
Copy link
Author

Micsi commented Jan 22, 2015

@mhaskel what added dependencies do you think of?
MySQL needs a config file in place to start. manage_config_file tells the module to mange it or not. The dependency to the config file has nothing to do with that, it is required anyway. With this PR the user is free to mange the config outside of the module and to store it in unusable places and still use the module service.

I for example want to copy an existing config file over to the server and use the module service. To require the config to exist before starting the machine is correct.

I think the management of the config file has nothing to do with the service. My version covers most use cases for configs.

@underscorgan
Copy link
Contributor

@Micsi We think something more along the lines of #630 is better, just not adding that dependency if the config file isn't being managed. If the config file is being managed externally, there should probably be a before => Service['mysqld'] where the file is being managed, rather than the require in the service.

@Micsi
Copy link
Author

Micsi commented Jan 23, 2015

ok then. I'll do as you say ;-)

@igalic
Copy link
Contributor

igalic commented Jan 27, 2015

@Micsi any updates here?

@Micsi
Copy link
Author

Micsi commented Jan 27, 2015

sorry, not yet. Will push requested changes asap.

@igalic
Copy link
Contributor

igalic commented Mar 11, 2015

thank you everyone! this was fixed in #672

@igalic igalic closed this Mar 11, 2015
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 this pull request may close these issues.

5 participants