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

Wrong softlink created by formula-fetch? #197

Open
soostdijck opened this issue Jan 22, 2018 · 8 comments
Open

Wrong softlink created by formula-fetch? #197

soostdijck opened this issue Jan 22, 2018 · 8 comments
Labels
Milestone

Comments

@soostdijck
Copy link

I've been having trouble with the softlink that is created by the function linkFormulas() inside lib/kitchen/provisioner/formula-fetch.sh. For me it's creating a broken softlink to a dependency, inside my vagrant/kitchen test box.

My kitchen converge output is:

       Install External Dependencies
       Fetching: access
       git clone https://bitbucket.ripe.net/scm/salt/formula-access.git /usr/share/salt-formulas/env/_formulas/access -b master
       Cloning into '/usr/share/salt-formulas/env/_formulas/access'...
       remote: Counting objects: 248, done.
remote: Compressing objects: 100% (243/243), done.
remote: Total 248 (delta 121), reused 0 (delta 0)
Receiving objects: 100% (248/248), 63.04 KiB | 0 bytes/s, done.
Resolving deltas: 100% (121/121), done.
       chown: invalid user: ‘kitchen.kitchen’
       chown: invalid user: ‘kitchen.kitchen’
       Content of /tmp/kitchen//srv/salt :
       total 4
       drwxrwxr-x. 3 vagrant vagrant  47 Jan 22 11:55 .
       drwxrwxr-x. 4 vagrant vagrant  32 Jan 22 11:55 ..
       lrwxrwxrwx. 1 root    root     52 Jan 22 11:55 access -> /usr/share/salt-formulas/env/_formulas/access/access
       drwxrwxr-x. 4 vagrant vagrant 171 Jan 22 11:55 exim
       -rw-rw-r--. 1 vagrant vagrant  26 Jan 22 11:55 top.sls
       [ERROR   ] Specified SLS 'access.userfiles' in environment 'base' is not available on the salt master
       [ERROR   ] Template was specified incorrectly: False
       [CRITICAL] Pillar render error: Specified SLS 'access.userfiles' in environment 'base' is not available on the salt master

The softlink should instead link to access -> /usr/share/salt-formulas/env/_formulas/access and all would be well...

I think the issue is line 76 inside formula-fetch.sh - there is a $name too many. However I'm having a hard time testing this (to make a useful PR). I can't find how to change the salt_solo provisioner so that it pulls the scripts from https://github.com/saltstack/kitchen-salt/tree/master/lib/kitchen/provisioner from some other url.

@soostdijck
Copy link
Author

I think part of the problem might lie in the fact that I've put my .kitchen.yml inside the formula subdirectory, so my path looks like ~/git/salt/formula-core/exim/.kitchen.yml. I've got 'is_file_root: true'.

The reason for this layout in my case is that I have one formula-style git repo with multiple formulas in that same repo to keep the amount of repo's to a reasonable amount. So my layout it something like this:

ls -1 ~/git/salt/formula-core/
Gemfile
Gemfile.lock
README.md
exim
iptables
motd
munin-node
nrpe
ntp
selinux
snmp
etc...

@gtmanfred
Copy link
Contributor

is exim your formula root? or is git/salt/formula-core? because that is where all the formulas are located.

You might take a look at using dependencies with paths to the formula directories?

@gtmanfred gtmanfred added this to the Blocked milestone Jan 23, 2018
@soostdijck
Copy link
Author

The formula root is git/salt/formula-core but because there are many formulas in one git repo I have a .kitchen.yml in each subdirectory (exim, snmp, ntp,etc), so something like git/salt/formula-core/exim/.kitchen.yml.

My intention is to keep the kitchen configs simpler by not having one monolithic one at the top level of my formula (like hot it's normally done in formulas).

@epcim
Copy link
Contributor

epcim commented Jan 23, 2018 via email

@soostdijck
Copy link
Author

It would be nice if there was an option to pull these scripts from a custom location. Then users can hack around all they want.

@gtmanfred
Copy link
Contributor

I want to move this away from these scripts, and instead put as many of the dependencies in the sand box as possible (besides spm) so that they are just transferred over.

@soostdijck
Copy link
Author

Currently the state is "info needed". What info do you need? :)

@gtmanfred gtmanfred added bug and removed Info Needed labels Mar 13, 2018
@gtmanfred gtmanfred modified the milestones: Blocked, Approved Mar 13, 2018
@gtmanfred
Copy link
Contributor

updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants