g10k icon indicating copy to clipboard operation
g10k copied to clipboard

Puppetfile option with a config file

Open mchouque opened this issue 7 years ago • 6 comments

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: 'http://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 #70, provide a way to set more than just cachedir
  • or support a config file with -puppetfile parameter

Cheers, Mathieu

mchouque avatar Sep 04 '17 11:09 mchouque

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

xorpaul avatar Sep 04 '17 12:09 xorpaul

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 avatar Sep 04 '17 12:09 mchouque

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

mchouque avatar Sep 28 '17 15:09 mchouque

Could you tell me about your workaround?

Maybe others could also use it as well.

xorpaul avatar Sep 28 '17 16:09 xorpaul

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.

mchouque avatar Sep 28 '17 16:09 mchouque

Thanks for the info.

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

xorpaul avatar Sep 28 '17 16:09 xorpaul