saltstack-formulas / gitlab-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Apache License 2.0
29 stars 49 forks source link

sudo package requirement for Debian minimal install in packages.sls #7

Closed tinuva closed 10 years ago

tinuva commented 10 years ago

Hi,

When I have a debian 7 minimal install, it seems sudo was not installed, but is required by this gitlab-formula to get a proper install going, otherwise the states where commands must be run as the git user fail.

viq commented 10 years ago

But sudo is included in the packages.sls, so it should get installed...

tinuva commented 10 years ago

It is included within {% if grains['os_family'] == 'RedHat' %}. The Debian family part in the packages.sls does not have sudo and that is why I have this issue open.

viq commented 10 years ago

Oh, right, sorry, didn't look closely enough. On the other hand I'm not using sudo directly anywhere, so it must be salt using it... I'll have to have a look how salt will react when sudo appears in the middle of the run, whether the agent will be able to use it.

tinuva commented 10 years ago

Salt uses it in gitlab-shell.sls, where you specify commands should be run as user git. Eg. line 10 in gitlab-shell.sls. Which is why sudo is a required package, and should be installed before that state executes.

viq commented 10 years ago

Salt doesn't use sudo to run commands as user: https://github.com/saltstack/salt/blob/2014.1/salt/modules/cmdmod.py#L301 so I don't know why this fails.

whiteinge commented 10 years ago

@Tinuva can you run the command from the minion itself via salt-call? The debug logging should show which command it's failing on exactly. Something like:

salt-call -l debug state.sls gitlab
tinuva commented 10 years ago

Ok it looks like something else must have been wrong with my tree, and after fixing it whilst working on other issues, that this was resolved, and that it was my noobness thinking sudo is required.

After many many changes, doing a clean install without sudo as a required package for debian, it seems my gitlab installs just fine.

Can close this issue.