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

Conflict with git formula #3

Open davidkarlsen opened 10 years ago

davidkarlsen commented 10 years ago

Please see this discussion: https://groups.google.com/forum/#!topic/salt-users/Mlr7oITFqZw basically the guitlab formula conflicts with the git formula and should rather include/depend on it.

gravyboat commented 10 years ago

Quick fix here: https://github.com/saltstack-formulas/gitlab-formula/pull/4

viq commented 10 years ago

@davidkarlsen this should be fixed now, please verify.

davidkarlsen commented 10 years ago

Doesn´t work for me:

EBUG   ] Rendered data from file: /var/cache/salt/minion/files/base/gitlab/nginx.sls:

nginx:
  pkg:
    - installed
  service:
    - running
    - enable: True
    - require:
      - pkg: nginx
      - user: nginx
    - watch:
      - file: gitlab-nginx
  file.absent:
    - name: /etc/nginx/sites-enabled/default.conf
  user.present:
    - name: www-data
    - groups:
      - git
    - require:
      - pkg: nginx

# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab
gitlab-nginx:
  file.managed:
    - name: /etc/nginx/sites-enabled/gitlab.conf
    - source: salt://gitlab/files/gitlab-nginx
    - template: jinja
    - user: root
    - group: root
    - mode: 644
    - require:
      - pkg: nginx

[DEBUG   ] Results of YAML rendering: 
OrderedDict([('nginx', OrderedDict([('pkg', ['installed']), ('service', ['running', OrderedDict([('enable', True)]), OrderedDict([('require', [OrderedDict([('pkg', 'nginx')]), OrderedDict([('user', 'nginx')])])]), OrderedDict([('watch', [OrderedDict([('file', 'gitlab-nginx')])])])]), ('file.absent', [OrderedDict([('name', '/etc/nginx/sites-enabled/default.conf')])]), ('user.present', [OrderedDict([('name', 'www-data')]), OrderedDict([('groups', ['git'])]), OrderedDict([('require', [OrderedDict([('pkg', 'nginx')])])])])])), ('gitlab-nginx', OrderedDict([('file.managed', [OrderedDict([('name', '/etc/nginx/sites-enabled/gitlab.conf')]), OrderedDict([('source', 'salt://gitlab/files/gitlab-nginx')]), OrderedDict([('template', 'jinja')]), OrderedDict([('user', 'root')]), OrderedDict([('group', 'root')]), OrderedDict([('mode', 644)]), OrderedDict([('require', [OrderedDict([('pkg', 'nginx')])])])])]))])
[DEBUG   ] Loaded no_out as virtual quiet
[DEBUG   ] Loaded json_out as virtual json
[DEBUG   ] Loaded yaml_out as virtual yaml
[DEBUG   ] Loaded pprint_out as virtual pprint
local:
    Data failed to compile:
----------
    No matching sls found for 'gitlab' in env 'base'
----------
    No matching sls found for 'gitlab' in env 'base'
root@main:/srv/pillar# 
viq commented 10 years ago

Could you wrap it in a code block? This formatting makes it hard to read.

davidkarlsen commented 10 years ago

@viq OK, done

davidkarlsen commented 10 years ago

ping?

tinuva commented 10 years ago

Just out of interest sake. If gitlab is to depend on the git formula, the git formula will need some changes for gitlab to work on CentOS ect. in the future.

For example the inclusion of the PUIAS_6_computational repository, is specifically to get a new enough version of GIT that is compatible with Gitlab. If Gitlab requires on another Git formula, this repository needs to be included in said formula.

whiteinge commented 10 years ago

Hm. Gitlab does require Git 1.8 or newer. CentOS 6 is currently on 1.7.1. This version incompatibility was present before #4 was merged and should be a new issue.

@Tinuva how have you configured CentOS to run GitLab? Mind filing a new issue with details?

viq commented 10 years ago

I was told it should actually work with what's available on CentOS, but I have not presonally verified yet - especially as I haven't yet managed on CentOS to make gitlab pick up a ruby new enough to work.

tinuva commented 10 years ago

@whiteinge I am still busy working out all the broken states that I have to get there. Will do once I have everything working.

viq commented 10 years ago

@Tinuva how are you getting a ruby new enough to run gitlab on CentOS?

viq commented 10 years ago

@davidkarlsen uhm, sorry. No, I don't really know why that's happening for you. What's your directory structure, where's your gitlab formula/state located?

davidkarlsen commented 10 years ago

I use gitfs:

gitfs_remotes:
  ....
  - git@github.com:davidkarlsen/git-formula.git
  - git@github.com:davidkarlsen/gitlab-formula.git
  ....

and have this in my state map:
  'roles:gitlab':
    - match: grain
    - gitlab

and my grains:
root@main:/srv/salt# cat /etc/salt/grains 
roles:
  - dnsserver
  - javabuild
  - smtpserver
  - saltmaster
  - gitlab
viq commented 10 years ago

@davidkarlsen it seems that one of the things gitlab formula references is not there - see #13236

I am working on refreshing the gitlab formula somewhat, and making sure the stuff it uses is either self-contained or explicitly mentioned, but it's currently work in progress.

davidkarlsen commented 10 years ago

@viq Which #13236 ?

viq commented 10 years ago

@davidkarlsen sorry, https://github.com/saltstack/salt/issues/13236

tinuva commented 10 years ago

@viq,

I finally got Gitlab to build and install via this saltstack formula from a clean CentOS 6 install.

Ruby and Git is now pulled from the following repository: http://ftp5.gwdg.de/pub/opensuse/repositories/home:/takehironet/CentOS_CentOS-6/home:takehironet.repo

I removed the CentOS-SCL repo, as well as the Puias computation repo after enabling Takehironet's repository.

That said, my tree is now a bit of a mess and need some cleaning up, but if you want I can still upload it so that you can have a look. It will need some more fine tuning to distinguish between CentOS 6 and 7 which will be released soon. It also needs to make use of more jinja maps, actually it need a lot of jinja love.

viq commented 10 years ago

@Tinuva thanks, I'll investigate that repo. Yeah, I would like to see your changes.

tinuva commented 10 years ago

@viq added it on here: https://github.com/Tinuva/gitlab-formula

viq commented 10 years ago

@Tinuva awesome, thank you.

arnisoph commented 10 years ago

I am working on refreshing the gitlab formula somewhat, and making sure the stuff it uses is either self-contained or explicitly mentioned, but it's currently work in progress.

@viq I refactored the formula and uploaded it to https://github.com/bechtoldt/gitlab-formula . Feel free to share your ideas.

viq commented 10 years ago

Have a look at a significant work @xmj did at https://github.com/viq/gitlab-formula-1/pull/1 for making this work better on RedHat/CentOS.

I'll try to look and comment, but I will apologise in advance as I am notoriously bad at doing things in any kind of timely manner :(

viq

arnisoph commented 10 years ago

@viq no worries, we share the same problem. :)

xmj commented 10 years ago

I'm working on a FreeBSD port of GitLab at the moment, and will then extend and amalgamate the GitLab formulas mentioned above to run it there too. :)