Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # == Class: discourse_docker | 1 # == Class: discourse_docker |
2 # | 2 # |
3 # Depends on module docker (for now) | 3 # Depends on module docker (for now) |
4 # | 4 # |
5 # == Parameters: | 5 # == Parameters: |
6 | 6 |
7 # [*domain*] | 7 # [*domain*] |
8 # Set the domain (hostname) for the site. This will be used in both nginx and d iscourse settings. | 8 # Set the domain (hostname) for the site. This will be used in both nginx and d iscourse settings. |
9 # | 9 # |
10 # [*certificate*] | 10 # [*certificate*] |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 # } | 45 # } |
46 # } | 46 # } |
47 # | 47 # |
48 class discourse_docker( | 48 class discourse_docker( |
49 $domain, | 49 $domain, |
50 $certificate = hiera('discourse_docker::certificate', undef), | 50 $certificate = hiera('discourse_docker::certificate', undef), |
51 $private_key = hiera('discourse_docker::private_key', undef), | 51 $private_key = hiera('discourse_docker::private_key', undef), |
52 $site_settings = hiera('discourse_docker::site_settings', {}), | 52 $site_settings = hiera('discourse_docker::site_settings', {}), |
53 $is_default = hiera('discourse_docker::is_default', false), | 53 $is_default = hiera('discourse_docker::is_default', false), |
54 $admins = hiera('discourse_docker::admins', []), | 54 $admins = hiera('discourse_docker::admins', []), |
55 $smtp_host = hiera('discourse_docker::smtp_host', undef), | 55 $smtp_host = hiera('discourse_docker::smtp_host', '172.17.0.1'), |
mathias
2017/07/07 19:45:43
Since the template does not place any conditional
f.nicolaisen
2017/07/10 08:29:08
We could use 172.17.0.1 as configured in the hiera
mathias
2017/07/10 08:32:42
Why not use the formerly hard-coded DISCOURSE_SMTP
f.nicolaisen
2017/07/10 08:39:44
There is no smtp service on localhost. The contain
| |
56 $google_oauth2_client_id = hiera('discourse_docker::google_oauth2_client_id', 'undef'), | 56 $google_oauth2_client_id = hiera('discourse_docker::google_oauth2_client_id', 'undef'), |
57 $google_oauth2_client_secret = hiera('discourse_docker::google_oauth2_client_s ecret', 'undef'), | 57 $google_oauth2_client_secret = hiera('discourse_docker::google_oauth2_client_s ecret', 'undef'), |
58 ) { | 58 ) { |
59 | 59 |
60 include stdlib | 60 include stdlib |
61 | 61 |
62 package {'git': | 62 package {'git': |
63 ensure => present, | 63 ensure => present, |
64 } | 64 } |
65 | 65 |
66 file {'/var/discourse': | 66 file {'/var/discourse': |
67 ensure => directory, | 67 ensure => directory, |
68 mode => 755, | 68 mode => '755', |
69 owner => root, | 69 owner => root, |
70 group => root | 70 group => root |
71 } | 71 } |
72 | 72 |
73 exec {'fetch-discourse-docker': | 73 exec {'fetch-discourse-docker': |
74 command => "git clone https://github.com/discourse/discourse_docker.git /var /discourse", | 74 command => "git clone https://github.com/discourse/discourse_docker.git /var /discourse", |
75 path => ["/usr/bin/", "/bin/"], | 75 path => ["/usr/bin/", "/bin/"], |
76 user => root, | 76 user => root, |
77 timeout => 0, | 77 timeout => 0, |
78 require => [Package['git'], File['/var/discourse']], | 78 require => [Package['git'], File['/var/discourse']], |
79 unless => "test -d /var/discourse/.git" | 79 unless => "test -d /var/discourse/.git" |
80 } | 80 } |
81 | 81 |
82 file {'/var/discourse/containers/app.yml': | 82 file {'/var/discourse/containers/app.yml': |
83 ensure => file, | 83 ensure => file, |
84 mode => 600, | 84 mode => '600', |
85 owner => root, | 85 owner => root, |
86 group => root, | 86 group => root, |
87 content => template('discourse_docker/app.yml.erb'), | 87 content => template('discourse_docker/app.yml.erb'), |
88 require => Class['docker'], | 88 require => Class['docker'], |
89 } | 89 } |
90 | 90 |
91 exec {'rebuild': | 91 exec {'rebuild': |
92 command => '/var/discourse/launcher rebuild app --skip-prereqs', | 92 command => '/var/discourse/launcher rebuild app --skip-prereqs', |
93 user => root, | 93 user => root, |
94 subscribe => File['/var/discourse/containers/app.yml'], | 94 subscribe => File['/var/discourse/containers/app.yml'], |
(...skipping 14 matching lines...) Expand all Loading... | |
109 | 109 |
110 nginx::hostconfig {$domain: | 110 nginx::hostconfig {$domain: |
111 source => "puppet:///modules/discourse_docker/site.conf", | 111 source => "puppet:///modules/discourse_docker/site.conf", |
112 certificate => $certificate, | 112 certificate => $certificate, |
113 private_key => $private_key, | 113 private_key => $private_key, |
114 is_default => $is_default, | 114 is_default => $is_default, |
115 log => "access_log_intraforum" | 115 log => "access_log_intraforum" |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
LEFT | RIGHT |