xorpaul / g10k

my r10k fork in Go
Apache License 2.0
127 stars 51 forks source link

g10k -puppetfile deletes other stuff in moduledir #75

Closed alex-harvey-z3q closed 6 years ago

alex-harvey-z3q commented 7 years ago

I would like to include roles and profiles in my control repo modules directory, as is common. Then I would like to use g10k to install the other modules from Puppetfile into the same directory.

It looks like r10k made this possible here. However, I see that g10k doesn't support this.

Is that something that's easy to fix?

xorpaul commented 6 years ago

With v0.4.3 I added support for local modules just like r10k supports:

mod 'localstuff', :local => true
[...]

With -debug you should see something like this in your output:

DEBUG Not deleting /tmp/example/foobar_local_modules/modules/localstuff as it is declared as a local module
baurmatt commented 6 years ago

The current README still mentions the local module as unsupported:

No 'local'-Modules support

Edit: Also the :local options seems to need the value as a string rather than the (for me) preferred boolean:

Before:

Error: Can not convert local parameter value true,:install_path =>  of module external to boolean. In /etc/puppetlabs/code/environments/pp-4170/Puppetfile line: mod 'external', :local        => true,:install_path => 'modules'
 # External submodules
 mod 'external', # Ensure external folder isn't purged by g10k
-  :local        => true,
+  :local        => 'true',
   :install_path => 'modules'
 mod 'apt',
   :git          => 'https://github.com/puppetlabs/puppetlabs-apt.git', 

After:

Resolving Git modules (43/43) 1.791s [====================================================================] 100%
Synced g10k.yaml with branch pp-4170 with 49 git repositories and 0 Forge modules in 11.5s with git (4.8s sync, I/O 25.9s) and Forge (0.0s query+download, I/O 0.0s) using 50 resolv and 20 extract workers
xorpaul commented 6 years ago

Nice catch 👍

Fixed with 5804e30049a3404997956c43264ebde6dc6a0fdc

alex-harvey-z3q commented 6 years ago

Thanks for this @xorpaul