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

Puppetfile option with a config file #71

Open
mchouque opened this issue Sep 4, 2017 · 6 comments
Open

Puppetfile option with a config file #71

mchouque opened this issue Sep 4, 2017 · 6 comments

Comments

@mchouque
Copy link

mchouque commented Sep 4, 2017

Hello,

This issue is somewhat related to issue #70 where with r10k, I can have both a simple config file and still use: puppetfile install.

My yaml config (r10k.yaml) file contains:

---
cachedir: /tmp/somerandomdirectory
forge: {baseurl: 'https://myforge:42080'}
git:
    private_key: /home/user/.ssh/id_rsa
    provider: rugged

And I run r10k with the following options (which works properly):

r10k -c r10k.yaml puppetfile install -v info --puppetfile Puppetfile --moduledir modules

If I try the same thing with g10k, I get this message "-puppetfile parameter is not allowed with -config parameter" which is different from what r10k supports: is there a reason for that?

So either:

  • I figure out how to write a full file based configuration using my Puppetfile (so far I haven't haha)
  • or like with Support a config file  #70, provide a way to set more than just cachedir
  • or support a config file with -puppetfile parameter

Cheers,
Mathieu

@xorpaul
Copy link
Owner

xorpaul commented Sep 4, 2017

Is the Puppetfile you want to use located in the same directory as your r10k.yaml file?
Do you only use one Puppetfile?

By default g10k looks inside defined sources for a Puppetfile and resolves those modules.

See https://github.com/xorpaul/g10k/blob/master/test.yaml and https://github.com/xorpaul/g10k-environment

@mchouque
Copy link
Author

mchouque commented Sep 4, 2017

Right, my Puppetfile and r10k.yaml are in the same directory and I only use one Puppetfile.

Thing is, to use a source I have to define a remote which I have no use for (unless I misunderstood something: "config setting remote is not set for source operations in config file r10k.yaml").

My use case is somewhat special as I generate the Puppetfile on the fly to execute compilation checks.
The CI gets the Puppetfile from the control-repo and then modifies module lines by changing either tag, version, branch to compile against the appropriate target(s).

So it can't really come from a repo, hence why with r10k it doesn't. And having it in a repo doesn't make much sense either as the file is short lived and doesn't need to be kept around. Also it could be messy to store it in a repo as I'd have to have multiple branches (or something similar) as I can have concurrent compilations.

@mchouque
Copy link
Author

Hello,

I found a work around for this so I'm closing this issue.

Thanks for all the other things you added for me, it's very much appreciated!

Regards,
Mathieu

@xorpaul
Copy link
Owner

xorpaul commented Sep 28, 2017

Could you tell me about your workaround?

Maybe others could also use it as well.

@mchouque
Copy link
Author

It's definitely an ugly workaround but it works for me (TM).

In a nutshell I created a repo which contains only one symbolic link:
Puppetfile -> ../../Puppetfile

This way g10k is happy: there's a Puppetfile in a repo and it points to the one I modified.

@xorpaul
Copy link
Owner

xorpaul commented Sep 28, 2017

Thanks for the info.

I'll leave this open, so I can add the config with puppetfile mode later.

@xorpaul xorpaul reopened this Sep 28, 2017
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

2 participants