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

Configure source repository #139

Open
jujugrrr opened this issue Sep 11, 2014 · 6 comments
Open

Configure source repository #139

jujugrrr opened this issue Sep 11, 2014 · 6 comments

Comments

@jujugrrr
Copy link
Contributor

From what I've seen so far, a lot of our recipes are playing with yum/apt repo sources.
It creates a lot of duplication. At the same time I have no way to say I'd like to use the IUS repo for yum without adding custom code.

What about making it a part of platformstack?

@martinb3
Copy link
Contributor

FWIW, An example of apt stuff done without yum equivalent: -> That particular one is a valid use case, since apt must update but yum will do it automatically. That's just a difference in how they behave. The only yum equivalent might be yum makecache or something, but regular yum operations will do it automagically.

@jujugrrr
Copy link
Contributor Author

FWIW, An example of apt stuff done without yum equivalent: -> That particular one is a valid use case, since apt must update but yum will do it automatically. That's just a difference in how they behave. The only yum equivalent might be yum makecache or something, but regular yum operations will do it automagically.

@martinb3 My bad then, bad example maybe it worth a comment 😉 what do you think about the issue itself rather than this example?

@fernandohonig
Copy link
Contributor

Based on what we are thinking with flags, we can enable yum repos based on flags:
if [yum][repo][epel][enabled]
if [yum][repo][ius][enabled]

@martinb3
Copy link
Contributor

I think it'd be good to enable those kinds of things by default, but we'd probably need to review each stack and make sure EPEL and IUS don't conflict with any that are missing it. For example, I know in phpstack there were lots of issues with which repo PHP came from, so phpstack allows you to add any repo before invoking it, and then specify a list of packages. We might find turning on IUS or EPEL by default means we'd exclude the packages from another 3rd party repo that a customer is trying to install (making it impossible to install the packages from the other repo, until someone finds the [repo][enabled] flag and turns it off).

I think as long as review what we're doing now for any issues, and document it, we'd be in good shape to include EPEL and IUS by default.

@jujugrrr
Copy link
Contributor Author

Cool I do agree we just need to be careful with conflict, we could just default to no repo, it will allow to only use one attribute in stacks/client cookbook, and we will have to maintain stuff like https://github.com/AutomationSupport/2869487-cmonline_app/blob/master/recipes/yum.rb#L11-L30 only in one place.

By example

[platformstack][repo][yum][epel] = { all my parameter } 
[platformstack][repo][yum][ius] = { all my parameter } 
[platformstack][repo][apt][ubuntu][backports] =  { all my parameter } 
[platformstack][repo][list] = []

Then in a recipe something like

[platformstack][repo][list] .each |repo|
  case repo 
  when epel 
     if rhel?
        yum_repositoy [platformstack][repo][yum][epel]
  when backport 
       apt_repository [platformstack][repo][apt][ubuntu][backports]

And in a stack/client cookbook if I need a repo I just need to do [platformstack][repo][list] = [ 'epel' ]

@martinb3
Copy link
Contributor

👍 I like that idea.

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