|
5 | 5 | # ['puppet_proxy_port'] - The port for the virtual host
|
6 | 6 | # ['disable_ssl'] - Disables SSL on the webserver. usefull if you use this master behind a loadbalancer. currently only supported by nginx, defaults to undef
|
7 | 7 | # ['backup_upstream'] - specify another puppet master as fallback. currently only supported by nginx
|
| 8 | +# ['unicorn_package'] - package name of a unicorn rpm. if provided we install it, otherwise we built it via gem/gcc |
| 9 | +# ['unicorn_path'] - custom path to the unicorn binary |
8 | 10 | #
|
9 | 11 | # Actions:
|
10 | 12 | # - Configures nginx and unicorn for puppet master use. Tested only on CentOS 7
|
|
26 | 28 | $puppet_proxy_port,
|
27 | 29 | $disable_ssl,
|
28 | 30 | $backup_upstream,
|
| 31 | + $unicorn_package, |
| 32 | + $unicorn_path, |
29 | 33 | ){
|
30 | 34 | include nginx
|
31 |
| - # install unicorn |
32 |
| - unless defined(Package['ruby-devel']) { |
33 |
| - package {'ruby-devel': |
| 35 | + |
| 36 | + # if this is provided we install the package from the repo, otherwise we build unicorn from scratch |
| 37 | + if $unicorn_package { |
| 38 | + package {$unicorn_package: |
| 39 | + ensure => 'latest', |
| 40 | + } |
| 41 | + } else { |
| 42 | + # install unicorn |
| 43 | + unless defined(Package['ruby-devel']) { |
| 44 | + package {'ruby-devel': |
| 45 | + ensure => 'latest', |
| 46 | + } |
| 47 | + } |
| 48 | + package {'gcc': |
34 | 49 | ensure => 'latest',
|
| 50 | + } -> |
| 51 | + package {['unicorn', 'rack']: |
| 52 | + ensure => 'latest', |
| 53 | + provider => 'gem', |
| 54 | + require => Package['ruby-devel'], |
35 | 55 | }
|
36 | 56 | }
|
37 |
| - package {'gcc': |
38 |
| - ensure => 'latest', |
39 |
| - } -> |
40 |
| - package {['unicorn', 'rack']: |
41 |
| - ensure => 'latest', |
42 |
| - provider => 'gem', |
43 |
| - require => Package['ruby-devel'], |
| 57 | + file {'unicorn-conf': |
| 58 | + path => '/etc/puppet/unicorn.conf', |
| 59 | + source => 'puppet:///modules/puppet/unicorn.conf', |
44 | 60 | } ->
|
45 | 61 | file {'copy-config':
|
46 | 62 | path => '/etc/puppet/config.ru',
|
47 | 63 | source => '/usr/share/puppet/ext/rack/config.ru',
|
48 | 64 | } ->
|
49 |
| - file {'unicorn-conf': |
50 |
| - path => '/etc/puppet/unicorn.conf', |
51 |
| - source => 'puppet:///modules/puppet/unicorn.conf', |
| 65 | + exec{'systemd-reload': |
| 66 | + command => '/usr/bin/systemctl daemon-reload', |
| 67 | + refreshonly => true, |
| 68 | + notify => Service['unicorn-puppetmaster'], |
52 | 69 | } ->
|
53 | 70 | file {'unicorn-service':
|
54 | 71 | path => '/usr/lib/systemd/system/unicorn-puppetmaster.service',
|
55 |
| - source => 'puppet:///modules/puppet/unicorn-puppetmaster.service', |
| 72 | + source => template('puppet/unicorn-puppetmaster.service'), |
56 | 73 | notify => Exec['systemd-reload'],
|
57 | 74 | } ->
|
58 |
| - exec{'systemd-reload': |
59 |
| - command => '/usr/bin/systemctl daemon-reload', |
60 |
| - refreshonly => true, |
61 |
| - notify => Service['unicorn-puppetmaster'], |
62 |
| - } |
63 | 75 | unless defined(Service['unicorn-puppetmaster']) {
|
64 | 76 | service{'unicorn-puppetmaster':
|
65 | 77 | ensure => 'running',
|
66 | 78 | enable => true,
|
67 |
| - require => Exec['systemd-reload'], |
68 | 79 | }
|
69 | 80 | }
|
70 | 81 | # update SELinux
|
|
0 commit comments