|
1 | 1 | require 'voxpupuli/acceptance/spec_helper_acceptance' |
2 | 2 |
|
| 3 | +ENV['BEAKER_FACTER_GITLAB_IP'] = File.read(File.expand_path('~/GITLAB_IP')).chomp |
| 4 | + |
3 | 5 | configure_beaker do |host| |
4 | 6 | install_module_from_forge_on(host, 'puppetlabs/docker', '>= 0') |
5 | | - |
6 | | - # The omnibus installer use the following algorithm to know what to do. |
7 | | - # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/runit/recipes/default.rb |
8 | | - # If this peace of code trigger docker case, the installer hang indefinitly. |
9 | | - pp = %( |
10 | | - file {'/.dockerenv': |
11 | | - ensure => absent, |
12 | | - } |
13 | | - package { ['curl']: |
14 | | - ensure => present, |
15 | | - } |
16 | | - ) |
17 | | - |
18 | | - apply_manifest_on(host, pp, catch_failures: true) |
19 | | - |
20 | | - # https://gitlab.com/gitlab-org/omnibus-gitlab/issues/2229 |
21 | | - # There is no /usr/share/zoneinfo in latest Docker image for ubuntu 16.04 |
22 | | - # Gitlab installer fail without this file |
23 | | - tzdata = %( |
24 | | - package { ['tzdata']: |
25 | | - ensure => present, |
26 | | - } |
27 | | - ) |
28 | | - |
29 | | - apply_manifest_on(host, tzdata, catch_failures: true) if fact('os.release.major') =~ %r{(16.04|18.04)} |
30 | | - |
31 | | - # Setup Puppet Bolt |
32 | | - gitlab_ip = File.read(File.expand_path('~/GITLAB_IP')).chomp |
33 | | - bolt = <<-MANIFEST |
34 | | - $bolt_config = @("BOLTPROJECT"/L) |
35 | | - modulepath: "/etc/puppetlabs/code/modules:/etc/puppetlabs/code/environments/production/modules" |
36 | | - analytics: false |
37 | | - | BOLTPROJECT |
38 | | -
|
39 | | - package { 'puppet-bolt': |
40 | | - ensure => installed, |
41 | | - } |
42 | | -
|
43 | | - file { [ '/root/.puppetlabs', '/root/.puppetlabs/bolt', '/root/.puppetlabs/etc', '/root/.puppetlabs/etc/bolt']: |
44 | | - ensure => directory, |
45 | | - } |
46 | | -
|
47 | | - # Needs to existing to not trigger a warning sign... |
48 | | - file { '/root/.puppetlabs/etc/bolt/analytics.yaml': |
49 | | - ensure => file, |
50 | | - } |
51 | | -
|
52 | | - file { '/root/.puppetlabs/bolt/bolt-project.yaml': |
53 | | - ensure => file, |
54 | | - content => $bolt_config, |
55 | | - } |
56 | | -
|
57 | | - file_line { '/etc/hosts-gitlab': |
58 | | - path => '/etc/hosts', |
59 | | - line => '#{gitlab_ip} gitlab', |
60 | | - } |
61 | | - MANIFEST |
62 | | - apply_manifest_on(host, bolt, catch_failures: true) |
63 | 7 | end |
0 commit comments